From 123d90efa139546a623a4d86cd9aead8f461fb66 Mon Sep 17 00:00:00 2001 From: Adi Date: Sat, 19 Mar 2016 13:20:21 +0000 Subject: [PATCH 1/9] updated code of conduct --- CODE_OF_CONDUCT.md | 80 ++++++++++++++++++++++++++++++---------------- README.md | 2 +- 2 files changed, 53 insertions(+), 29 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1d4238e8..b3c97542 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,24 +1,41 @@ -# Contributor Code of Conduct +# Contributor Covenant Code of Conduct -As contributors and maintainers of this project, and in the interest of -fostering an open and welcoming community, we pledge to respect all people who -contribute through reporting issues, posting feature requests, updating -documentation, submitting pull requests or patches, and other activities. +## Our Pledge -We are committed to making participation in this project a harassment-free -experience for everyone, regardless of level of experience, gender, gender -identity and expression, sexual orientation, disability, personal appearance, -body size, race, ethnicity, age, religion, or nationality. +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery -* Personal attacks -* Trolling or insulting/derogatory comments +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment -* Publishing other's private information, such as physical or electronic - addresses, without explicit permission -* Other unethical or unprofessional conduct +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions @@ -26,25 +43,32 @@ that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. -By adopting this Code of Conduct, project maintainers commit themselves to -fairly and consistently applying these principles to every aspect of managing -this project. Project maintainers who do not follow or enforce the Code of -Conduct may be permanently removed from the project team. +## Scope This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting a project maintainer at adiinteractive@gmail.com. All +reported by contacting the project team at adiinteractive@gmail.com. All complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. Maintainers are -obligated to maintain confidentiality with regard to the reporter of an -incident. +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. +## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 1.3.0, available at -[http://contributor-covenant.org/version/1/3/0/][version] +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] [homepage]: http://contributor-covenant.org -[version]: http://contributor-covenant.org/version/1/3/0/ +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/README.md b/README.md index 034aa24c..ded26cdf 100644 --- a/README.md +++ b/README.md @@ -117,4 +117,4 @@ This content is released under the [MIT](http://opensource.org/licenses/MIT) Lic ### Contributor Code of Conduct ### -[Code of Conduct](https://github.com/CoralineAda/contributor_covenant) is adapted from [Contributor Covenant, version 1.3.0](http://contributor-covenant.org/version/1/3/0/) +[Code of Conduct](https://github.com/CoralineAda/contributor_covenant) is adapted from [Contributor Covenant, version 1.4](http://contributor-covenant.org/version/1/4) From 4539d308979b310d893b9c44a91cffba1e8ccb03 Mon Sep 17 00:00:00 2001 From: Adi Date: Fri, 25 Mar 2016 16:00:56 +0000 Subject: [PATCH 2/9] added code climate --- .codeclimate.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 00000000..e0e35ebf --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,10 @@ +engines: + haxe-checkstyle: + enabled: true + +exclude_paths: + - libs/**/* + +ratings: + paths: + - "**.hx" From acfc8c1b8a7a3bd40c563ca5d1768aeaebb886f6 Mon Sep 17 00:00:00 2001 From: Adi Date: Fri, 25 Mar 2016 16:05:37 +0000 Subject: [PATCH 3/9] Update .codeclimate.yml From 7fff4749f2e4100ed4a4720785b19be8467dbc40 Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:10:53 +0100 Subject: [PATCH 4/9] upgrade to v4 --- docs.xml | 10 +- haxelib.json | 6 +- libs/pixi.min.js | 19 +- logo.png | Bin 42928 -> 52364 bytes package.json | 4 +- samples/_output/alphamask.js | 2 +- samples/_output/alphamask.js.map | 4 +- samples/_output/audio.js | 2 +- samples/_output/audio.js.map | 4 +- samples/_output/bitmapfont.js | 14 +- samples/_output/bitmapfont.js.map | 4 +- samples/_output/blur.js | 2 +- samples/_output/blur.js.map | 4 +- samples/_output/bunnymark.js | 4 +- samples/_output/bunnymark.js.map | 4 +- samples/_output/colormatrix.js | 2 +- samples/_output/colormatrix.js.map | 4 +- samples/_output/devicedetection.js | 2 +- samples/_output/devicedetection.js.map | 4 +- samples/_output/deviceinfo.js | 2 +- samples/_output/deviceinfo.js.map | 4 +- samples/_output/dragging.js | 2 +- samples/_output/dragging.js.map | 4 +- samples/_output/events.js | 2 +- samples/_output/events.js.map | 4 +- samples/_output/graphics.js | 2 +- samples/_output/graphics.js.map | 4 +- samples/_output/libs/pixi.min.js | 19 +- samples/_output/loader.js | 2 +- samples/_output/loader.js.map | 4 +- samples/_output/mask.js | 2 +- samples/_output/mask.js.map | 4 +- samples/_output/movieclip.js | 2 +- samples/_output/movieclip.js.map | 4 +- samples/_output/nape.js | 645 +++++++++---------- samples/_output/nape.js.map | 6 +- samples/_output/retina.js | 2 +- samples/_output/retina.js.map | 4 +- samples/_output/rope.js | 2 +- samples/_output/rope.js.map | 4 +- samples/_output/spine.js | 2 +- samples/_output/spine.js.map | 4 +- samples/_output/spritesheet.js | 2 +- samples/_output/spritesheet.js.map | 4 +- samples/_output/textureswap.js | 2 +- samples/_output/textureswap.js.map | 4 +- samples/_output/tiling.js | 2 +- samples/_output/tiling.js.map | 4 +- samples/_output/video.js | 2 +- samples/_output/video.js.map | 4 +- src/pixi/core/particles/ParticleContainer.hx | 2 +- 51 files changed, 406 insertions(+), 445 deletions(-) diff --git a/docs.xml b/docs.xml index 66746e7b..0afabc71 100644 --- a/docs.xml +++ b/docs.xml @@ -14928,7 +14928,7 @@ * @param [properties.alpha=false] {Bool} When true, alpha be uploaded and applied. * @param [batchSize=15000] {Int} Number of particles per batch.]]> - "PIXI.ParticleContainer" + "PIXI.particles.ParticleContainer" @@ -18370,22 +18370,22 @@ * Can be found in libs folder. "libs/stats.min.js" * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed]]> - - <_onWindowResize set="method" line="227"> + + <_onWindowResize set="method" line="228"> - <_onRequestAnimationFrame set="method" line="237"> + <_onRequestAnimationFrame set="method" line="238"> - + diff --git a/haxelib.json b/haxelib.json index a6107ff5..c584d330 100644 --- a/haxelib.json +++ b/haxelib.json @@ -11,12 +11,12 @@ "extern", "web" ], - "description": "Externs of pixi.js v3 for Haxe - JavaScript 2D webGL renderer with canvas fallback.", + "description": "Externs of pixi.js v4.x for Haxe - JavaScript 2D webGL renderer with canvas fallback.", "contributors": [ "adireddy" ], - "releasenote": "minor bug fix in Application class", - "version": "3.1.0", + "releasenote": "v4 update", + "version": "4.0.0-rc.2", "url": "https://github.com/pixijs/pixi-haxe", "dependencies": { "perf.js": "" diff --git a/libs/pixi.min.js b/libs/pixi.min.js index a04c9a06..fa1048b3 100644 --- a/libs/pixi.min.js +++ b/libs/pixi.min.js @@ -1,11 +1,10 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=0&&t.length%1===0}function c(t,e){for(var r=-1,i=t.length;++ri?i:null}):(r=Y(t),e=r.length,function(){return i++,e>i?r[i]:null})}function y(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;r>n;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function x(t){return function(e,r,i){return t(e,i)}}function b(t){return function(e,r,i){i=u(i||n),e=e||[];var o=m(e);if(0>=t)return i(null);var s=!1,a=0,l=!1;!function c(){if(s&&0>=a)return i(null);for(;t>a&&!l;){var n=o();if(null===n)return s=!0,void(0>=a&&i(null));a+=1,r(e[n],n,h(function(t){a-=1,t?(i(t),l=!0):c()}))}}()}}function _(t){return function(e,r,i){return t(N.eachOf,e,r,i)}}function T(t){return function(e,r,i,n){return t(b(r),e,i,n)}}function E(t){return function(e,r,i){return t(N.eachOfSeries,e,r,i)}}function S(t,e,r,i){i=u(i||n),e=e||[];var o=l(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){o[e]=r,i(t)})},function(t){i(t,o)})}function w(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(p(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function A(t,e,r,i){w(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function C(t,e,r){return function(i,n,o,s){function a(){s&&s(r(!1,void 0))}function h(t,i,n){return s?void o(t,function(i){s&&e(i)&&(s(r(!0,t)),s=o=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(s=o,o=n,t(i,h,a))}}function M(t,e){return e}function R(t,e,r){r=r||n;var i=l(e)?[]:{};t(e,function(t,e,r){t(y(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function O(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function P(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length&&t.idle()?N.setImmediate(function(){t.drain()}):(c(e,function(e){var o={data:e,callback:i||n};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated()}),void N.setImmediate(t.process))}function o(t,e){return function(){s-=1;var r=!1,i=arguments;c(e,function(t){c(a,function(e,i){e!==t||r||(a.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a=[],u={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(t,e){i(u,t,!1,e)},kill:function(){u.drain=n,u.tasks=[]},unshift:function(t,e){i(u,t,!0,e)},process:function(){for(;!u.paused&&s=e;e++)N.setImmediate(u.process)}}};return u}function F(t){return y(function(e,r){e.apply(null,r.concat([y(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,function(e){console[t](e)}))})]))})}function D(t){return function(e,r,i){t(d(e),r,i)}}function B(t){return y(function(e,r){var i=y(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function L(t){return y(function(e){var r=e.pop();e.push(function(){var t=arguments;i?N.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var I,N={},U="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i||this;null!=U&&(I=U.async),N.noConflict=function(){return U.async=I,N};var k=Object.prototype.toString,j=Array.isArray||function(t){return"[object Array]"===k.call(t)},X=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},Y=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},G="function"==typeof setImmediate&&setImmediate,z=G?function(t){G(t)}:function(t){setTimeout(t,0)};"object"==typeof e&&"function"==typeof e.nextTick?N.nextTick=e.nextTick:N.nextTick=z,N.setImmediate=G?z:N.nextTick,N.forEach=N.each=function(t,e,r){return N.eachOf(t,x(e),r)},N.forEachSeries=N.eachSeries=function(t,e,r){return N.eachOfSeries(t,x(e),r)},N.forEachLimit=N.eachLimit=function(t,e,r,i){return b(e)(t,x(r),i)},N.forEachOf=N.eachOf=function(t,e,r){function i(t){a--,t?r(t):null===o&&0>=a&&r(null)}r=u(r||n),t=t||[];for(var o,s=m(t),a=0;null!=(o=s());)a+=1,e(t[o],o,h(i));0===a&&r(null)},N.forEachOfSeries=N.eachOfSeries=function(t,e,r){function i(){var n=!0;return null===s?r(null):(e(t[s],s,h(function(t){if(t)r(t);else{if(s=o(),null===s)return r(null);n?N.setImmediate(i):i()}})),void(n=!1))}r=u(r||n),t=t||[];var o=m(t),s=o();i()},N.forEachOfLimit=N.eachOfLimit=function(t,e,r,i){b(e)(t,r,i)},N.map=_(S),N.mapSeries=E(S),N.mapLimit=T(S),N.inject=N.foldl=N.reduce=function(t,e,r,i){N.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},N.foldr=N.reduceRight=function(t,e,r,i){var n=p(t,o).reverse();N.reduce(n,e,r,i)},N.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=j(t)?[]:{}),N.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},N.select=N.filter=_(w),N.selectLimit=N.filterLimit=T(w),N.selectSeries=N.filterSeries=E(w),N.reject=_(A),N.rejectLimit=T(A),N.rejectSeries=E(A),N.any=N.some=C(N.eachOf,s,o),N.someLimit=C(N.eachOfLimit,s,o),N.all=N.every=C(N.eachOf,a,a),N.everyLimit=C(N.eachOfLimit,a,a),N.detect=C(N.eachOf,o,M),N.detectSeries=C(N.eachOfSeries,o,M),N.detectLimit=C(N.eachOfLimit,o,M),N.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0}N.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,p(e.sort(i),function(t){return t.value}))})},N.auto=function(t,e,r){function i(t){m.unshift(t)}function o(t){var e=g(m,t);e>=0&&m.splice(e,1)}function s(){h--,c(m.slice(0),function(t){t()})}"function"==typeof arguments[1]&&(r=e,e=null),r=u(r||n);var a=Y(t),h=a.length;if(!h)return r(null);e||(e=h);var l={},p=0,d=!1,m=[];i(function(){h||r(null,l)}),c(a,function(n){function a(){return e>p&&f(x,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(n)}function h(){a()&&(p++,o(h),c[c.length-1](m,l))}if(!d){for(var u,c=j(t[n])?t[n]:[t[n]],m=y(function(t,e){if(p--,e.length<=1&&(e=e[0]),t){var i={};v(l,function(t,e){i[e]=t}),i[n]=e,d=!0,r(t,i)}else l[n]=e,N.setImmediate(s)}),x=c.slice(0,c.length-1),b=x.length;b--;){if(!(u=t[x[b]]))throw new Error("Has nonexistent dependency in "+x.join(", "));if(j(u)&&g(u,n)>=0)throw new Error("Has cyclic dependencies")}a()?(p++,c[c.length-1](m,l)):i(h)}})},N.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}N.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var o=5,s=0,a=[],h={times:o,interval:s},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},N.waterfall=function(t,e){function r(t){return y(function(i,n){if(i)e.apply(null,[i].concat(n));else{var o=t.next();o?n.push(r(o)):n.push(e),L(t).apply(null,n)}})}if(e=u(e||n),!j(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(N.iterator(t))():e()},N.parallel=function(t,e){R(N.eachOf,t,e)},N.parallelLimit=function(t,e,r){R(b(e),t,r)},N.series=function(t,e){R(N.eachOfSeries,t,e)},N.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return ri;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function o(t,e,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length?N.setImmediate(function(){t.drain()}):void c(e,function(e){var a={data:e,priority:o,callback:"function"==typeof s?s:n};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),N.setImmediate(t.process)})}var s=N.queue(t,e);return s.push=function(t,e,r){o(s,t,e,r)},delete s.unshift,s},N.cargo=function(t,e){return P(t,1,e)},N.log=F("log"),N.dir=F("dir"),N.memoize=function(t,e){var r={},i={},n=Object.prototype.hasOwnProperty;e=e||o;var s=y(function(o){var s=o.pop(),a=e.apply(null,o);n.call(r,a)?N.setImmediate(function(){s.apply(null,r[a])}):n.call(i,a)?i[a].push(s):(i[a]=[s],t.apply(null,o.concat([y(function(t){r[a]=t;var e=i[a];delete i[a];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return s.memo=r,s.unmemoized=t,s},N.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},N.times=D(N.map),N.timesSeries=D(N.mapSeries),N.timesLimit=function(t,e,r,i){return N.mapLimit(d(t),e,r,i)},N.seq=function(){var t=arguments;return y(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=n,N.reduce(t,e,function(t,e,i){e.apply(r,t.concat([y(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},N.compose=function(){return N.seq.apply(null,Array.prototype.reverse.call(arguments))},N.applyEach=B(N.eachOf),N.applyEachSeries=B(N.eachOfSeries),N.forever=function(t,e){function r(t){return t?i(t):void o(r)}var i=h(e||n),o=L(t);r()},N.ensureAsync=L,N.constant=y(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),N.wrapSync=N.asyncify=function(t){return y(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}X(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof r&&r.exports?r.exports=N:"function"==typeof t&&t.amd?t([],function(){return N}):U.async=N}()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;s>h;h++)if(n[h]!==o[h]){a=h;break}for(var u=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e,r){function i(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&n()}function n(){if(!l){var t=setTimeout(i);l=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(i=r[0]+"@",t=r[1]),t=t.replace(D,".");var n=t.split("."),o=s(n,e).join(".");return i+o}function h(t){for(var e,r,i=[],n=0,o=t.length;o>n;)e=t.charCodeAt(n++),e>=55296&&56319>=e&&o>n?(r=t.charCodeAt(n++),56320==(64512&r)?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--)):i.push(e);return i}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function l(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:E}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function p(t,e,r){var i=0;for(t=r?I(t/C):t>>1,t+=I(t/e);t>L*w>>1;i+=E)t=I(t/L);return I(i+(L+1)*t/(t+A))}function d(t){var e,r,i,n,s,a,h,c,d,f,v=[],g=t.length,m=0,y=R,x=M;for(r=t.lastIndexOf(O),0>r&&(r=0),i=0;r>i;++i)t.charCodeAt(i)>=128&&o("not-basic"),v.push(t.charCodeAt(i));for(n=r>0?r+1:0;g>n;){for(s=m,a=1,h=E;n>=g&&o("invalid-input"),c=l(t.charCodeAt(n++)),(c>=E||c>I((T-m)/a))&&o("overflow"),m+=c*a,d=x>=h?S:h>=x+w?w:h-x,!(d>c);h+=E)f=E-d,a>I(T/f)&&o("overflow"),a*=f;e=v.length+1,x=p(m-s,e,0==s),I(m/e)>T-y&&o("overflow"),y+=I(m/e),m%=e,v.splice(m++,0,y)}return u(v)}function f(t){var e,r,i,n,s,a,u,l,d,f,v,g,m,y,x,b=[];for(t=h(t),g=t.length,e=R,r=0,s=M,a=0;g>a;++a)v=t[a],128>v&&b.push(N(v));for(i=n=b.length,n&&b.push(O);g>i;){for(u=T,a=0;g>a;++a)v=t[a],v>=e&&u>v&&(u=v);for(m=i+1,u-e>I((T-r)/m)&&o("overflow"),r+=(u-e)*m,e=u,a=0;g>a;++a)if(v=t[a],e>v&&++r>T&&o("overflow"),v==e){for(l=r,d=E;f=s>=d?S:d>=s+w?w:d-s,!(f>l);d+=E)x=l-f,y=E-f,b.push(N(c(f+x%y,0))),l=I(x/y);b.push(N(c(l,0))),s=p(r,m,i==n),r=0,++i}++r,++e}return b.join("")}function v(t){return a(t,function(t){return P.test(t)?d(t.slice(4).toLowerCase()):t})}function g(t){return a(t,function(t){return F.test(t)?"xn--"+f(t):t})}var m="object"==typeof i&&i&&!i.nodeType&&i,y="object"==typeof r&&r&&!r.nodeType&&r,x="object"==typeof e&&e;(x.global===x||x.window===x||x.self===x)&&(n=x);var b,_,T=2147483647,E=36,S=1,w=26,A=38,C=700,M=72,R=128,O="-",P=/^xn--/,F=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=E-S,I=Math.floor,N=String.fromCharCode;if(b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:d,encode:f,toASCII:g,toUnicode:v},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return b});else if(m&&y)if(r.exports==m)y.exports=b;else for(_ in b)b.hasOwnProperty(_)&&(m[_]=b[_]);else n.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;u>l;++l){var c,p,d,f,v=t[l].replace(a,"%20"),g=v.indexOf(r);g>=0?(c=v.substr(0,g),p=v.substr(g+1)):(c=v,p=""),d=decodeURIComponent(c),f=decodeURIComponent(p),i(s,d)?n(s[d])?s[d].push(f):s[d]=[s[d],f]:s[d]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],6:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(v),m=["'"].concat(g),y=["%","/","?",";","#"].concat(m),x=["/","?","#"],b=255,_=/^[a-z0-9A-Z_-]{0,63}$/,T=/^([a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=t("querystring");i.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t;i=i.trim();var n=d.exec(i);if(n){n=n[0];var o=n.toLowerCase();this.protocol=o,i=i.substr(n.length)}if(r||n||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||n&&S[n]||(i=i.substr(2),this.slashes=!0)}if(!S[n]&&(s||n&&!w[n])){for(var a=-1,u=0;ul)&&(a=l)}var c,f;f=-1===a?i.lastIndexOf("@"):i.lastIndexOf("@",a),-1!==f&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;ul)&&(a=l)}-1===a&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var g=this.hostname.split(/\./),u=0,C=g.length;C>u;u++){var M=g[u];if(M&&!M.match(_)){for(var R="",O=0,P=M.length;P>O;O++)R+=M.charCodeAt(O)>127?"x":M[O];if(!R.match(_)){var F=g.slice(0,u),D=g.slice(u+1),B=M.match(T);B&&(F.push(B[1]),D.unshift(B[2])),D.length&&(i="/"+D.join(".")+i),this.hostname=F.join(".");break}}}if(this.hostname.length>b?this.hostname="":this.hostname=this.hostname.toLowerCase(),!v){for(var L=this.hostname.split("."),I=[],u=0;uu;u++){var j=m[u],X=encodeURIComponent(j);X===j&&(X=escape(j)),i=i.split(j).join(X)}var Y=i.indexOf("#");-1!==Y&&(this.hash=i.substr(Y),i=i.slice(0,Y));var G=i.indexOf("?");if(-1!==G?(this.search=i.substr(G),this.query=i.substr(G+1),e&&(this.query=A.parse(this.query)),i=i.slice(0,G)):e&&(this.search="",this.query={}),i&&(this.pathname=i),w[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",N=this.search||"";this.path=U+N}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=A.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||w[e])&&n!==!1?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+n+r+s+i},i.prototype.resolve=function(t){return this.resolveObject(n(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(h(t)){var e=new i;e.parse(t,!1,!0),t=e}var r=new i;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!w[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||S[t.protocol])r.pathname=t.pathname;else{for(var n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),p=u||a||r.host&&t.pathname,d=p,f=r.pathname&&r.pathname.split("/")||[],n=t.pathname&&t.pathname.split("/")||[],v=r.protocol&&!w[r.protocol];if(v&&(r.hostname="",r.port=null,r.host&&(""===f[0]?f[0]=r.host:f.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),p=p&&(""===n[0]||""===f[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,f=n;else if(n.length)f||(f=[]),f.pop(),f=f.concat(n),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(v){r.hostname=r.host=f.shift();var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!f.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var m=f.slice(-1)[0],y=(r.host||t.host)&&("."===m||".."===m)||""===m,x=0,b=f.length;b>=0;b--)m=f[b],"."==m?f.splice(b,1):".."===m?(f.splice(b,1),x++):x&&(f.splice(b,1),x--);if(!p&&!d)for(;x--;x)f.unshift("..");!p||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),y&&"/"!==f.join("/").substr(-1)&&f.push("");var _=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(v){r.hostname=r.host=_?"":f.length?f.shift():"";var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return p=p||r.host&&f.length,p&&!_&&f.unshift(""),f.length?r.pathname=f.join("/"):(r.pathname=null,r.path=null),l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:4,querystring:7}],9:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,a=n(t,0,o,r,!0),h=[];if(!a)return h;var u,l,p,d,f,v,g;if(i&&(a=c(t,e,a,r)),t.length>80*r){u=p=t[0],l=d=t[1];for(var m=r;o>m;m+=r)f=t[m],v=t[m+1],u>f&&(u=f),l>v&&(l=v),f>p&&(p=f),v>d&&(d=v);g=Math.max(p-u,d-l)}return s(a,h,r,u,l,g),h}function n(t,e,r,i,n){var o,s,a,h=0;for(o=e,s=r-i;r>o;o+=i)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(n===h>0)for(o=e;r>o;o+=i)a=M(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=M(o,t[o],t[o+1],a);return a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!T(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(R(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function s(t,e,r,i,n,c,p){if(t){!p&&c&&v(t,i,n,c);for(var d,f,g=t;t.prev!==t.next;)if(d=t.prev,f=t.next,c?h(t,i,n,c):a(t))e.push(d.i/r),e.push(t.i/r),e.push(f.i/r),R(t),t=f.next,g=f.next;else if(t=f,t===g){p?1===p?(t=u(t,e,r),s(t,e,r,i,n,c,2)):2===p&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(_(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(x(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&_(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(_(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=m(a,h,e,r,i),p=m(u,l,e,r,i),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;E(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return i}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&b(h,u)){var l=C(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var s,a,h,u,l,c=[];for(s=0,a=e.length;a>s;s++)h=e[s]*i,u=a-1>s?e[s+1]*i:t.length,l=n(t,h,u,i,!1),l===l.next&&(l.steiner=!0),c.push(y(l));for(c.sort(p),s=0;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);n>=a&&a>s&&(s=a,r=i.x=i.x&&i.x>=r.x&&x(oh||h===l&&i.x>r.x)&&w(i,t)&&(r=i,l=h)),i=i.next;return r}function v(t,e,r,i){var n=t;do null===n.z&&(n.z=m(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,g(n)}function g(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;u>e&&(a++,i=i.nextZ,i);e++);for(h=u;a>0||h>0&&i;)0===a?(n=i,i=i.nextZ,h--):0!==h&&i?r.z<=i.z?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--):(n=r,r=r.nextZ,a--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}function m(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function b(t,e){return T(t,e)||t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&w(t,e)&&w(e,t)&&A(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function T(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,i){return _(t,e,r)>0!=_(t,e,i)>0&&_(r,i,t)>0!=_(r,i,e)>0}function S(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0; - r=r.next}while(r!==t);return!1}function w(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function A(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function C(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function M(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=i},{}],10:[function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var o="function"!=typeof Object.create?"~":!1;n.prototype._events=void 0,n.prototype.listeners=function(t,e){var r=o?o+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,a=new Array(s);s>n;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,s),!0}for(u=1,h=new Array(c-1);c>u;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var p,d=l.length;for(u=0;d>u;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(p=1,h=new Array(c-1);c>p;p++)h[p-1]=arguments[p];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=o?o+t:t;if(!this._events||!this._events[n])return this;var s=this._events[n],a=[];if(e)if(s.fn)(s.fn!==e||i&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,u=s.length;u>h;h++)(s[h].fn!==e||i&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=o,"undefined"!=typeof e&&(e.exports=n)},{}],11:[function(t,e,r){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var r,s,a=i(t),h=1;h=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,i(n))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var i=0,n=function(){e(t[i],function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length?r():n())})};n()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,i){var n=d(e);n.apply(null,[t,r,i])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,i){if(i=i||function(){},!e.length||0>=t)return i();var n=0,o=0,s=0;!function a(){if(n>=e.length)return i();for(;t>s&&o=e.length?i():a())})}()}},f=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},v=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},g=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},m=function(t,e,r,i){if(e=l(e,function(t,e){return{index:e,value:t}}),i){var n=[];t(e,function(t,e){r(t.value,function(r,i){n[t.index]=i,e(r)})},function(t){i(t,n)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=f(m),s.mapSeries=g(m),s.mapLimit=function(t,e,r,i){return y(e)(t,r,i)};var y=function(t){return v(t,m)};s.reduce=function(t,e,r,i){s.eachSeries(t,function(t,i){r(e,t,function(t,r){e=r,i(t)})},function(t){i(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,i){var n=l(t,function(t){return t}).reverse();s.reduce(n,e,r,i)},s.foldr=s.reduceRight;var x=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=f(x),s.filterSeries=g(x),s.select=s.filter,s.selectSeries=s.filterSeries;var b=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=f(b),s.rejectSeries=g(b);var _=function(t,e,r,i){t(e,function(t,e){r(t,function(r){r?(i(t),i=function(){}):e()})},function(t){i()})};s.detect=f(_),s.detectSeries=g(_),s.some=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t&&(r(!0),r=function(){}),i()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t||(r(!1),r=function(){}),i()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){if(t)return r(t);var i=function(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0};r(null,l(e.sort(i),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=p(t),i=r.length;if(!i)return e();var n={},o=[],a=function(t){o.unshift(t)},l=function(t){for(var e=0;ei;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function n(t,e,n,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:n,callback:"function"==typeof o?o:null};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){n(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,i=[],n={tasks:i,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),u(t,function(t){i.push({data:t,callback:"function"==typeof r?r:null}),n.drained=!1,n.saturated&&i.length===e&&n.saturated()}),s.setImmediate(n.process)},process:function o(){if(!r){if(0===i.length)return n.drain&&!n.drained&&n.drain(),void(n.drained=!0);var s="number"==typeof e?i.splice(0,e):i.splice(0,i.length),a=l(s,function(t){return t.data});n.empty&&n.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return i.length},running:function(){return r}};return n};var S=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=S("log"),s.dir=S("dir"),s.memoize=function(t,e){var r={},i={};e=e||function(t){return t};var n=function(){var n=Array.prototype.slice.call(arguments),o=n.pop(),a=e.apply(null,n);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in i?i[a].push(o):(i[a]=[o],t.apply(null,n.concat([function(){r[a]=arguments;var t=i[a];delete i[a];for(var e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)}])))};return n.memo=r,n.unmemoized=t,n},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.map(i,e,r)},s.timesSeries=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.mapSeries(i,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();s.reduce(t,r,function(t,r,i){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);i(t,e)}]))},function(t,r){i.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var w=function(t,e){var r=function(){var r=this,i=Array.prototype.slice.call(arguments),n=i.pop();return t(e,function(t,e){t.apply(r,i.concat([e]))},n)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return r.apply(this,i)}return r};s.applyEach=f(w),s.applyEachSeries=g(w),s.forever=function(t,e){function r(i){if(i){if(e)return e(i);throw i}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):n.async=s}()}).call(this,e("_process"))},{_process:3}],13:[function(t,e,r){function i(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=n.queue(this._boundLoadResource,e),this.resources={}}var n=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.add=i.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n0)if(this.xhrType===i.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===i.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},i.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},i.prototype._determineXhrType=function(){return i._xhrTypeMap[this._getExtension()]||i.XHR_RESPONSE_TYPE.TEXT},i.prototype._determineLoadType=function(){return i._loadTypeMap[this._getExtension()]||i.LOAD_TYPE.XHR},i.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?");-1!==i&&(e=e.substring(0,i)),t=e.substring(e.lastIndexOf(".")+1)}return t},i.prototype._getMimeFromXhrType=function(t){switch(t){case i.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case i.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case i.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case i.XHR_RESPONSE_TYPE.JSON:return"application/json";case i.XHR_RESPONSE_TYPE.DEFAULT:case i.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},i.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},i._loadTypeMap={gif:i.LOAD_TYPE.IMAGE,png:i.LOAD_TYPE.IMAGE,bmp:i.LOAD_TYPE.IMAGE,jpg:i.LOAD_TYPE.IMAGE,jpeg:i.LOAD_TYPE.IMAGE,tif:i.LOAD_TYPE.IMAGE,tiff:i.LOAD_TYPE.IMAGE,webp:i.LOAD_TYPE.IMAGE,tga:i.LOAD_TYPE.IMAGE},i._xhrTypeMap={xhtml:i.XHR_RESPONSE_TYPE.DOCUMENT,html:i.XHR_RESPONSE_TYPE.DOCUMENT,htm:i.XHR_RESPONSE_TYPE.DOCUMENT,xml:i.XHR_RESPONSE_TYPE.DOCUMENT,tmx:i.XHR_RESPONSE_TYPE.DOCUMENT,tsx:i.XHR_RESPONSE_TYPE.DOCUMENT,svg:i.XHR_RESPONSE_TYPE.DOCUMENT,gif:i.XHR_RESPONSE_TYPE.BLOB,png:i.XHR_RESPONSE_TYPE.BLOB,bmp:i.XHR_RESPONSE_TYPE.BLOB,jpg:i.XHR_RESPONSE_TYPE.BLOB,jpeg:i.XHR_RESPONSE_TYPE.BLOB,tif:i.XHR_RESPONSE_TYPE.BLOB,tiff:i.XHR_RESPONSE_TYPE.BLOB,webp:i.XHR_RESPONSE_TYPE.BLOB,tga:i.XHR_RESPONSE_TYPE.BLOB,json:i.XHR_RESPONSE_TYPE.JSON,text:i.XHR_RESPONSE_TYPE.TEXT,txt:i.XHR_RESPONSE_TYPE.TEXT},i.setExtensionLoadType=function(t,e){o(i._loadTypeMap,t,e)},i.setExtensionXhrType=function(t,e){o(i._xhrTypeMap,t,e)}},{eventemitter3:10,url:8}],15:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",i=new Array(4),n=0,o=0,s=0;n>2,i[1]=(3&e[0])<<4|e[1]>>4,i[2]=(15&e[1])<<2|e[2]>>6,i[3]=63&e[2],s=n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o=0;r--)this.updateAccessibleObjects(e[r])},i.prototype.update=function(){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;othis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},i.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.title=t.accessibleTitle||"displayObject "+this.tabIndex,t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},i.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},i.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},i.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction; - e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},i.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},i.prototype._onMouseMove=function(){this.deactivate()},i.prototype.destroy=function(){this.div=null;for(var t=0;t1)for(var r=0;e>r;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},i.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},i.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(0>r||0>i)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t,this.onChildrenChange(i>r?r:i)}},i.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},i.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);o.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},i.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},i.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;e>r;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(-1===i)return;t.parent=null,o.removeItems(this.children,i,1),this.onChildrenChange(i),t.emit("removed",this)}return t},i.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,o.removeItems(this.children,t,1),this.onChildrenChange(t),e.emit("removed",this),e},i.prototype.removeChildren=function(t,e){var r,i,n=t||0,o="number"==typeof e?e:this.children.length,s=o-n;if(s>0&&o>=s){for(r=this.children.splice(n,s),i=0;it;++t)this.children[t].updateTransform()}},i.prototype.containerUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=0,l=this.children.length;l>u;++u){var c=this.children[u];c.visible&&(h=!0,t=this.children[u].getBounds(),i=ie?s:e,a=a>r?a:r)}if(!h)return n.Rectangle.EMPTY;var p=this._bounds;p.x=i,p.y=o,p.width=s-i,p.height=a-o,this._currentBounds=p}return this._currentBounds},i.prototype.containerGetBounds=i.prototype.getBounds,i.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=n.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(n.Matrix.IDENTITY)},i.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},i.prototype._renderWebGL=function(t){},i.prototype._renderCanvas=function(t){},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},i.prototype.destroy=function(t){if(s.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":33,"../textures/RenderTexture":71,"../utils":77,"./DisplayObject":24}],24:[function(t,e,r){function i(){s.call(this),this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.skew=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new n.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}var n=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),h=new n.Matrix,u={worldTransform:new n.Matrix,worldAlpha:1,children:[]};i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.updateTransform=function(){var t,e,r,i,n,o,s=this.parent.worldTransform,u=this.worldTransform;this.skew.x||this.skew.y?(h.setTransform(this.position.x,this.position.y,this.pivot.x,this.pivot.y,this.scale.x,this.scale.y,this.rotation,this.skew.x,this.skew.y),u.a=h.a*s.a+h.b*s.c,u.b=h.a*s.b+h.b*s.d,u.c=h.c*s.a+h.d*s.c,u.d=h.c*s.b+h.d*s.d,u.tx=h.tx*s.a+h.ty*s.c+s.tx,u.ty=h.tx*s.b+h.ty*s.d+s.ty):this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,i=this._cr*this.scale.y,n=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(n-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*i),u.a=t*s.a+e*s.c,u.b=t*s.b+e*s.d,u.c=r*s.a+i*s.c,u.d=r*s.b+i*s.d,u.tx=n*s.a+o*s.c+s.tx,u.ty=n*s.b+o*s.d+s.ty):(t=this.scale.x,i=this.scale.y,n=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*i,u.a=t*s.a,u.b=t*s.b,u.c=i*s.c,u.d=i*s.d,u.tx=n*s.a+o*s.c+s.tx,u.ty=n*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(t){return n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},i.prototype.toLocal=function(t,e,r){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t,r)},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.generateTexture=function(t,e,r){var i=this.getLocalBounds(),n=new o(t,0|i.width,0|i.height,e,r);return h.tx=-i.x,h.ty=-i.y,n.render(this,h),n},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.position.x=t||0,this.position.y=e||0,this.scale.x=r?r:1,this.scale.y=i?i:1,this.rotation=n||0,this.skew.x=o||0,this.skew.y=s||0,this.pivot.x=a||0,this.pivot.y=h||0,this},i.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.skew=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":33,"../textures/RenderTexture":71,eventemitter3:10}],25:[function(t,e,r){function i(){n.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new u.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var n=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),h=t("./GraphicsData"),u=t("../math"),l=t("../const"),c=new u.Point;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){var t=new i;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)l=c/s,n=h+(t-h)*l,o=u+(e-u)*l,a.push(n+(t+(r-t)*l-n)*l,o+(e+(i-e)*l-o)*l);return this.dirty=this.boundsDirty=!0,this},i.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,h,u,l,c=20,p=this.currentPath.shape.points,d=p[p.length-2],f=p[p.length-1],v=0,g=1;c>=g;++g)v=g/c,s=1-v,a=s*s,h=a*s,u=v*v,l=u*v,p.push(h*d+3*a*v*t+3*s*u*r+l*n,h*f+3*a*v*e+3*s*u*i+l*o);return this.dirty=this.boundsDirty=!0,this},i.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,u=s-t,l=i-e,c=r-t,p=Math.abs(h*c-u*l);if(1e-8>p||0===n)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=h*h+u*u,f=l*l+c*c,v=h*l+u*c,g=n*Math.sqrt(d)/p,m=n*Math.sqrt(f)/p,y=g*v/d,x=m*v/f,b=g*c+m*u,_=g*l+m*h,T=u*(m+y),E=h*(m+y),S=c*(g+x),w=l*(g+x),A=Math.atan2(E-_,T-b),C=Math.atan2(w-_,S-b);this.arc(b+t,_+e,n,A,C,u*l>c*h)}return this.dirty=this.boundsDirty=!0,this},i.prototype.arc=function(t,e,r,i,n,o){if(o=o||!1,i===n)return this;!o&&i>=n?n+=2*Math.PI:o&&n>=i&&(i+=2*Math.PI);var s=o?-1*(i-n):n-i,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(i)*r,u=e+Math.sin(i)*r;this.currentPath?this.currentPath.shape.points.push(h,u):this.moveTo(h,u);for(var l=this.currentPath.shape.points,c=s/(2*a),p=2*c,d=Math.cos(c),f=Math.sin(c),v=a-1,g=v%1/v,m=0;v>=m;m++){var y=m+g*m,x=c+i+p*y,b=Math.cos(x),_=-Math.sin(x);l.push((d*b+f*_)*r+t,(d*-_+f*b)*r+e)}return this.dirty=this.boundsDirty=!0,this},i.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.prototype.drawRect=function(t,e,r,i){return this.drawShape(new u.Rectangle(t,e,r,i)),this},i.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new u.RoundedRectangle(t,e,r,i,n)),this},i.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},i.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new u.Ellipse(t,e,r,i)),this},i.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof u.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;ig?g:S,S=S>y?y:S,S=S>b?b:S,w=w>m?m:w,w=w>x?x:w,w=w>_?_:w,T=g>T?g:T,T=y>T?y:T,T=b>T?b:T,E=m>E?m:E,E=x>E?x:E,E=_>E?_:E,this._bounds.x=S,this._bounds.width=T-S,this._bounds.y=w,this._bounds.height=E-w,this._currentBounds=this._bounds}return this._currentBounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,i=a+u>i?a+u:i;else if(d===l.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,u=n.radius+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else if(d===l.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,u=n.height+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else{o=n.points;for(var v=0;vs-f?s-f:t,e=s+f>e?s+f:e,r=r>a-f?a-f:r,i=a+f>i?a+f:i}}else t=0,e=0,r=0,i=0;var g=this.boundsPadding;this._localBounds.x=t-g,this._localBounds.width=e-t+2*g,this._localBounds.y=r-g,this._localBounds.height=i-r+2*g},i.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===l.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},i.prototype.destroy=function(){n.prototype.destroy.apply(this,arguments);for(var t=0;ta;a++)e=s.data[a],1===s.data[a].mode?(r.stencilManager.pushStencil(t,e),i.uniform1f(r.shaderManager.complexPrimitiveShader.uniforms.alpha._location,t.worldAlpha*e.alpha),i.drawElements(i.TRIANGLE_FAN,4,i.UNSIGNED_SHORT,2*(e.indices.length-4)),r.stencilManager.popStencil(t,e)):(o=r.shaderManager.primitiveShader,r.shaderManager.setShader(o),i.uniformMatrix3fv(o.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),i.uniformMatrix3fv(o.uniforms.projectionMatrix._location,!1,r.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(o.uniforms.tint._location,n.hex2rgb(t.tint)),i.uniform1f(o.uniforms.alpha._location,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,e.buffer),i.vertexAttribPointer(o.attributes.aVertexPosition,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(o.attributes.aColor,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.indexBuffer),i.drawElements(i.TRIANGLE_STRIP,e.indices.length,i.UNSIGNED_SHORT,0)),r.drawCount++},i.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[e.id];r||(r=t._webGL[e.id]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var h=this.buildPoly(a,o);h||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(i=0;i32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},i.prototype.buildRectangle=function(t,e){var r=t.shape,i=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var h=n.hex2rgb(t.fillColor),u=t.fillAlpha,l=h[0]*u,c=h[1]*u,p=h[2]*u,d=e.points,f=e.indices,v=d.length/6;d.push(i,o),d.push(l,c,p,u),d.push(i+s,o),d.push(l,c,p,u),d.push(i,o+a),d.push(l,c,p,u),d.push(i+s,o+a),d.push(l,c,p,u),f.push(v,v,v+1,v+2,v+3,v+3)}if(t.lineWidth){var g=t.points;t.points=[i,o,i+s,o,i+s,o+a,i,o+a,i,o],this.buildLine(t,e),t.points=g}},i.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,i=r.x,o=r.y,s=r.width,a=r.height,h=r.radius,u=[];if(u.push(i,o+h),this.quadraticBezierCurve(i,o+a-h,i,o+a,i+h,o+a,u),this.quadraticBezierCurve(i+s-h,o+a,i+s,o+a,i+s,o+a-h,u),this.quadraticBezierCurve(i+s,o+h,i+s,o,i+s-h,o,u),this.quadraticBezierCurve(i+h,o,i,o,i,o+h+1e-10,u),t.fill){var c=n.hex2rgb(t.fillColor),p=t.fillAlpha,d=c[0]*p,f=c[1]*p,v=c[2]*p,g=e.points,m=e.indices,y=g.length/6,x=l(u,null,2),b=0;for(b=0;b=m;m++)g=m/f,h=a(t,r,g),u=a(e,i,g),l=a(r,n,g),c=a(i,o,g),p=a(h,l,g),d=a(u,c,g),v.push(p,d);return v},i.prototype.buildCircle=function(t,e){var r,i,o=t.shape,a=o.x,h=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,i=o.radius):(r=o.width,i=o.height);var u=Math.floor(30*Math.sqrt(o.radius))||Math.floor(15*Math.sqrt(o.width+o.height)),l=2*Math.PI/u,c=0;if(t.fill){var p=n.hex2rgb(t.fillColor),d=t.fillAlpha,f=p[0]*d,v=p[1]*d,g=p[2]*d,m=e.points,y=e.indices,x=m.length/6;for(y.push(x),c=0;u+1>c;c++)m.push(a,h,f,v,g,d),m.push(a+Math.sin(l*c)*r,h+Math.cos(l*c)*i,f,v,g,d),y.push(x++,x++);y.push(x-1)}if(t.lineWidth){var b=t.points;for(t.points=[],c=0;u+1>c;c++)t.points.push(a+Math.sin(l*c)*r,h+Math.cos(l*c)*i);this.buildLine(t,e),t.points=b}},i.prototype.buildLine=function(t,e){var r=0,i=t.points;if(0!==i.length){var s=new o.Point(i[0],i[1]),a=new o.Point(i[i.length-2],i[i.length-1]);if(s.x===a.x&&s.y===a.y){i=i.slice(),i.pop(),i.pop(),a=new o.Point(i[i.length-2],i[i.length-1]);var h=a.x+.5*(s.x-a.x),u=a.y+.5*(s.y-a.y);i.unshift(h,u),i.push(h,u)}var l,c,p,d,f,v,g,m,y,x,b,_,T,E,S,w,A,C,M,R,O,P,F,D=e.points,B=e.indices,L=i.length/2,I=i.length,N=D.length/6,U=t.lineWidth/2,k=n.hex2rgb(t.lineColor),j=t.lineAlpha,X=k[0]*j,Y=k[1]*j,G=k[2]*j;for(p=i[0],d=i[1],f=i[2],v=i[3],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,D.push(p-y,d-x,X,Y,G,j),D.push(p+y,d+x,X,Y,G,j),r=1;L-1>r;r++)p=i[2*(r-1)],d=i[2*(r-1)+1],f=i[2*r],v=i[2*r+1],g=i[2*(r+1)],m=i[2*(r+1)+1],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,b=-(v-m),_=f-g,F=Math.sqrt(b*b+_*_),b/=F,_/=F,b*=U,_*=U,S=-x+d-(-x+v),w=-y+f-(-y+p),A=(-y+p)*(-x+v)-(-y+f)*(-x+d),C=-_+m-(-_+v),M=-b+f-(-b+g),R=(-b+g)*(-_+v)-(-b+f)*(-_+m),O=S*M-C*w,Math.abs(O)<.1?(O+=10.1,D.push(f-y,v-x,X,Y,G,j),D.push(f+y,v+x,X,Y,G,j)):(l=(w*R-M*A)/O,c=(C*A-S*R)/O,P=(l-f)*(l-f)+(c-v)*(c-v),P>19600?(T=y-b,E=x-_,F=Math.sqrt(T*T+E*E),T/=F,E/=F,T*=U,E*=U,D.push(f-T,v-E),D.push(X,Y,G,j),D.push(f+T,v+E),D.push(X,Y,G,j),D.push(f-T,v-E),D.push(X,Y,G,j),I++):(D.push(l,c),D.push(X,Y,G,j),D.push(f-(l-f),v-(c-v)),D.push(X,Y,G,j)));for(p=i[2*(L-2)],d=i[2*(L-2)+1],f=i[2*(L-1)],v=i[2*(L-1)+1],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,D.push(f-y,v-x),D.push(X,Y,G,j),D.push(f+y,v+x),D.push(X,Y,G,j),B.push(N),r=0;I>r;r++)B.push(N++);B.push(N-1)}},i.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var i=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=n.hex2rgb(t.fillColor);for(var o,s,a=1/0,h=-(1/0),u=1/0,l=-(1/0),c=0;co?o:a,h=o>h?o:h,u=u>s?s:u,l=s>l?s:l;r.push(a,u,h,u,h,l,a,l);var p=r.length/2;for(c=0;p>c;c++)i.push(c)}},i.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var i=e.points,o=e.indices,s=r.length/2,a=n.hex2rgb(t.fillColor),h=t.fillAlpha,u=a[0]*h,c=a[1]*h,p=a[2]*h,d=l(r,null,2);if(!d)return!1;var f=i.length/6,v=0;for(v=0;vv;v++)i.push(r[2*v],r[2*v+1],u,c,p,h);return!0}}},{"../../const":22,"../../math":33,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63,"../../utils":77,"./WebGLGraphicsData":28,earcut:9}],28:[function(t,e,r){function i(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}i.prototype.constructor=i,e.exports=i,i.prototype.reset=function(){this.points.length=0,this.indices.length=0},i.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},i.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var i=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),WebGLManager:t("./renderers/webgl/managers/WebGLManager"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),TextureShader:t("./renderers/webgl/shaders/TextureShader"),PrimitiveShader:t("./renderers/webgl/shaders/PrimitiveShader"),ComplexPrimitiveShader:t("./renderers/webgl/shaders/ComplexPrimitiveShader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":33,"./particles/ParticleContainer":39,"./particles/webgl/ParticleRenderer":41,"./renderers/canvas/CanvasRenderer":44,"./renderers/canvas/utils/CanvasBuffer":45,"./renderers/canvas/utils/CanvasGraphics":46,"./renderers/webgl/WebGLRenderer":49,"./renderers/webgl/filters/AbstractFilter":50,"./renderers/webgl/filters/FXAAFilter":51,"./renderers/webgl/filters/SpriteMaskFilter":52,"./renderers/webgl/managers/ShaderManager":56,"./renderers/webgl/managers/WebGLManager":58,"./renderers/webgl/shaders/ComplexPrimitiveShader":59,"./renderers/webgl/shaders/PrimitiveShader":60,"./renderers/webgl/shaders/Shader":61,"./renderers/webgl/shaders/TextureShader":62,"./renderers/webgl/utils/ObjectRenderer":63,"./renderers/webgl/utils/RenderTarget":65,"./sprites/Sprite":67,"./sprites/webgl/SpriteRenderer":68,"./text/Text":69,"./textures/BaseTexture":70,"./textures/RenderTexture":71,"./textures/Texture":72,"./textures/TextureUvs":73,"./textures/VideoBaseTexture":74,"./ticker":76,"./utils":77}],30:[function(t,e,r){function i(t){return 0>t?-1:t>0?1:0}function n(){for(var t=0;16>t;t++){var e=[];c.push(e);for(var r=0;16>r;r++)for(var n=i(o[t]*o[r]+a[t]*s[r]),p=i(s[t]*o[r]+h[t]*s[r]),d=i(o[t]*a[r]+a[t]*h[r]),f=i(s[t]*a[r]+h[t]*h[r]),v=0;16>v;v++)if(o[v]===n&&s[v]===p&&a[v]===d&&h[v]===f){e.push(v);break}}for(t=0;16>t;t++){var g=new l; - g.set(o[t],s[t],a[t],h[t],0,0),u.push(g)}}var o=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=t("./Matrix"),c=[];n();var p={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return c[t][e]},sub:function(t,e){return c[t][p.inv(e)]},rotate180:function(t){return 4^t},isSwapWidthHeight:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?p.S:p.N:2*Math.abs(e)<=Math.abs(t)?t>0?p.E:p.W:e>0?t>0?p.SE:p.SW:t>0?p.NE:p.NW},matrixAppendRotationInv:function(t,e,r,i){var n=u[p.inv(e)];r=r||0,i=i||0,n.tx=r,n.ty=i,t.append(n)}};e.exports=p},{"./Matrix":31}],31:[function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=t("./Point");i.prototype.constructor=i,e.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*r*i+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){var u,l,c,p,d,f,v,g,m,y;return d=Math.sin(s),f=Math.cos(s),v=Math.cos(h),g=Math.sin(h),m=-Math.sin(a),y=Math.cos(a),u=f*n,l=d*n,c=-d*o,p=f*o,this.a=v*u+g*c,this.b=v*l+g*p,this.c=m*u+y*c,this.d=m*l+y*p,this.tx=t+(r*u+i*c),this.ty=e+(r*l+i*p),this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},{"./Point":32}],32:[function(t,e,r){function i(t,e){this.x=t||0,this.y=e||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y)},i.prototype.copy=function(t){this.set(t.x,t.y)},i.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},i.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],33:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),GroupD8:t("./GroupD8"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./GroupD8":30,"./Matrix":31,"./Point":32,"./shapes/Circle":34,"./shapes/Ellipse":35,"./shapes/Polygon":36,"./shapes/Rectangle":37,"./shapes/RoundedRectangle":38}],34:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":37}],35:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=o.SHAPES.ELIP}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":37}],36:[function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)i.push(e[s].x,e[s].y);e=i}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var n=t("../Point"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;i>n;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1],l=a>e!=u>e&&(h-s)*(e-a)/(u-a)+s>t;l&&(r=!r)}return r}},{"../../const":22,"../Point":32}],37:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],39:[function(t,e,r){function i(t,e,r){n.call(this),r=r||15e3,t=t||15e3;var i=16384;r>i&&(r=i),r>t&&(r=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._buffers=null,this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var n=t("../display/Container"),o=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);er;r+=6,i+=4)this.indices[r+0]=i+0,this.indices[r+1]=i+1,this.indices[r+2]=i+2,this.indices[r+3]=i+0,this.indices[r+4]=i+2,this.indices[r+5]=i+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new h.Matrix}var n=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),h=t("../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,o.registerPlugin("particle",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,uploadFunction:this.uploadAlpha,offset:0}]},i.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},i.prototype.render=function(t){var e=t.children,r=e.length,i=t._maxSize,n=t._batchSize;if(0!==r){r>i&&(r=i),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var o=this.renderer.gl,s=t.worldTransform.copy(this.tempMatrix);s.prepend(this.renderer.currentRenderTarget.projectionMatrix),o.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,s.toArray(!0)),o.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var a=e[0]._texture.baseTexture;if(a._glTextures[o.id])o.bindTexture(o.TEXTURE_2D,a._glTextures[o.id]);else{if(!this.renderer.updateTexture(a))return;t._properties[0]&&t._properties[3]||(t._bufferToUpdate=0)}for(var h=0,u=0;r>h;h+=n,u+=1){var l=r-h;l>n&&(l=n);var c=t._buffers[u];c.uploadDynamic(e,h,l),t._bufferToUpdate===u&&(c.uploadStatic(e,h,l),t._bufferToUpdate=u+1),c.bind(this.shader),o.drawElements(o.TRIANGLES,6*l,o.UNSIGNED_SHORT,0),this.renderer.drawCount++}}},i.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._maxSize,o=t._batchSize,s=t._properties;for(e=0;n>e;e+=o)i.push(new a(r,this.properties,s,o));return i},i.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,u,l,c,p,d,f,v=0;r>v;v++)s=t[e+v],a=s._texture,u=s.scale.x,l=s.scale.y,a.trim?(h=a.trim,p=h.x-s.anchor.x*h.width,c=p+a.crop.width,f=h.y-s.anchor.y*h.height,d=f+a.crop.height):(c=a._frame.width*(1-s.anchor.x),p=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),f=a._frame.height*-s.anchor.y),i[o]=p*u,i[o+1]=f*l,i[o+n]=c*u,i[o+n+1]=f*l,i[o+2*n]=c*u,i[o+2*n+1]=d*l,i[o+3*n]=p*u,i[o+3*n+1]=d*l,o+=4*n},i.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},i.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},i.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":33,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63,"./ParticleBuffer":40,"./ParticleShader":42}],42:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var n=t("../../renderers/webgl/shaders/TextureShader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../renderers/webgl/shaders/TextureShader":62}],43:[function(t,e,r){function i(t,e,r,i){if(a.call(this),n.sayHello(t),i)for(var h in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof i[h]&&(i[h]=s.DEFAULT_RENDER_OPTIONS[h]);else i=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution,this.transparent=i.transparent,this.autoResize=i.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this.roundPixels=i.roundPixels,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var n=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgb)}}}),i.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},i.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":33,"../utils":77,eventemitter3:10}],44:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"Canvas",t,e,r),this.type=h.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var n=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),h=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,s.pluginTarget.mixin(i),i.prototype.render=function(t){this.emit("prerender");var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.context.globalCompositeOperation=this.blendModes[h.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context),this.emit("postrender")},i.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.context[this.smoothProperty]=h.SCALE_MODES.DEFAULT===h.SCALE_MODES.LINEAR)},i.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[h.BLEND_MODES.SCREEN]="screen",this.blendModes[h.BLEND_MODES.OVERLAY]="overlay",this.blendModes[h.BLEND_MODES.DARKEN]="darken",this.blendModes[h.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[h.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[h.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[h.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[h.BLEND_MODES.HUE]="hue",this.blendModes[h.BLEND_MODES.SATURATION]="saturate",this.blendModes[h.BLEND_MODES.COLOR]="color",this.blendModes[h.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[h.BLEND_MODES.SCREEN]="source-over",this.blendModes[h.BLEND_MODES.OVERLAY]="source-over",this.blendModes[h.BLEND_MODES.DARKEN]="source-over",this.blendModes[h.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[h.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[h.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[h.BLEND_MODES.HUE]="source-over",this.blendModes[h.BLEND_MODES.SATURATION]="source-over",this.blendModes[h.BLEND_MODES.COLOR]="source-over",this.blendModes[h.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":33,"../../utils":77,"../SystemRenderer":43,"./utils/CanvasMaskManager":47}],45:[function(t,e,r){function i(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),i.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},i.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},i.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],46:[function(t,e,r){var i=t("../../../const"),n={};e.exports=n,n.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var n=0;nC?C:A,e.beginPath(),e.moveTo(T,E+A),e.lineTo(T,E+w-A),e.quadraticCurveTo(T,E+w,T+A,E+w),e.lineTo(T+S-A,E+w),e.quadraticCurveTo(T+S,E+w,T+S,E+w-A),e.lineTo(T+S,E+A),e.quadraticCurveTo(T+S,E,T+S-A,E),e.lineTo(T+A,E),e.quadraticCurveTo(T,E,T,E+A),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},n.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var n=0;r>n;n++){var o=t.graphicsData[n],s=o.shape;if(o.type===i.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hw?w:S,e.moveTo(b,_+S),e.lineTo(b,_+E-S),e.quadraticCurveTo(b,_+E,b+S,_+E),e.lineTo(b+T-S,_+E),e.quadraticCurveTo(b+T,_+E,b+T,_+E-S),e.lineTo(b+T,_+S),e.quadraticCurveTo(b+T,_,b+T-S,_),e.lineTo(b+S,_),e.quadraticCurveTo(b,_,b,_+S),e.closePath()}}}},n.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}}},{"../../../const":22}],47:[function(t,e,r){function i(){}var n=t("./CanvasGraphics");i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,i=t.worldTransform,o=e.resolution;e.context.setTransform(i.a*o,i.b*o,i.c*o,i.d*o,i.tx*o,i.ty*o),t.texture||(n.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},i.prototype.popMask=function(t){t.context.restore()},i.prototype.destroy=function(){}},{"./CanvasGraphics":46}],48:[function(t,e,r){var i=t("../../../utils"),n={};e.exports=n,n.getTintedTexture=function(t,e){var r=t.texture;e=n.roundColor(e);var i="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[i])return r.tintCache[i];var o=n.canvas||document.createElement("canvas");if(n.tintMethod(r,e,o),n.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=o,n.canvas=null;return o},n.tintWithMultiply=function(t,e,r){var i=r.getContext("2d"),n=t.baseTexture.resolution,o=t.crop.clone();o.x*=n,o.y*=n,o.width*=n,o.height*=n,r.width=o.width,r.height=o.height,i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,o.width,o.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height)},n.tintWithOverlay=function(t,e,r){var i=r.getContext("2d"),n=t.baseTexture.resolution,o=t.crop.clone();o.x*=n,o.y*=n,o.width*=n,o.height*=n,r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,o.width,o.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height)},n.tintWithPerPixel=function(t,e,r){var n=r.getContext("2d"),o=t.baseTexture.resolution,s=t.crop.clone();s.x*=o,s.y*=o,s.width*=o,s.height*=o,r.width=s.width,r.height=s.height,n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height);for(var a=i.hex2rgb(e),h=a[0],u=a[1],l=a[2],c=n.getImageData(0,0,s.width,s.height),p=c.data,d=0;de;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":62}],51:[function(t,e,r){function i(){n.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FXAA_REDUCE_MIN\n #define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n #define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n #define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var n=t("./AbstractFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager,n=this.getShader(t);i.applyFilter(n,e,r)}},{"./AbstractFilter":50}],52:[function(t,e,r){function i(t){var e=new o.Matrix;n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var n=t("./AbstractFilter"),o=t("../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":33,"./AbstractFilter":50}],53:[function(t,e,r){function i(t){n.call(this,t),this.currentBlendMode=99999}var n=t("./WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":58}],54:[function(t,e,r){function i(t){n.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new h.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var n=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),h=t("../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},i.prototype.setFilterStack=function(t){this.filterStack=t},i.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var i=0|e[0].padding;if(r.x-=i,r.y-=i,r.width+=2*i,r.height+=2*i,this.renderer.currentRenderTarget.transform){var n=this.renderer.currentRenderTarget.transform;r.x+=n.tx,r.y+=n.ty,this.capFilterArea(r),r.x-=n.tx,r.y-=n.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},i.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var i=e.renderTarget,n=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),n.bindBuffer(n.ARRAY_BUFFER,this.quad.vertexBuffer),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,n.FLOAT,!1,0,0),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,n.FLOAT,!1,0,32),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,n.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,i),this.returnRenderTarget(r);else{for(var a=r,h=this.getRenderTarget(!0),u=0;uthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},i.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(i,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(i,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(i,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},i.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},i.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var i=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,i.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i.magFilter?i.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i.wrapT?i.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},i.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},i.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":77}],62:[function(t,e,r){function i(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var h in o)a[h]=o[h];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var l in s)u[l]=s[l];e=e||i.defaultVertexSrc,r=r||i.defaultFragmentSrc,n.call(this,t,e,r,a,u)}var n=t("./Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),i.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":61}],63:[function(t,e,r){function i(t){n.call(this,t)}var n=t("../managers/WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.start=function(){},i.prototype.stop=function(){this.flush()},i.prototype.flush=function(){},i.prototype.render=function(t){}},{"../managers/WebGLManager":58}],64:[function(t,e,r){function i(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}i.prototype.constructor=i,i.prototype.map=function(t,e){var r=0,i=0;this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.upload()},i.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},i.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},e.exports=i},{}],65:[function(t,e,r){var i=t("../../../math"),n=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,h,u){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new i.Rectangle(0,0,1,1),this.resolution=h||o.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=u,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var l=n.isPowerOfTwo(e,r);l?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var i=this.frame||this.size;this.calculateProjection(i)}},a.prototype.destroy=function(){var t=this.gl;t.deleteRenderbuffer(this.stencilBuffer),t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":33,"../../../utils":77,"./StencilMaskStack":66}],66:[function(t,e,r){function i(){this.stencilStack=[],this.reverse=!0,this.count=0}i.prototype.constructor=i,e.exports=i},{}],67:[function(t,e,r){function i(t){s.call(this),this.anchor=new n.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var n=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),h=t("../utils"),u=t("../const"),l=new n.Point,c=n.GroupD8,p=new n.Matrix;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture._frame.width},set:function(t){var e=h.sign(this.scale.x)||1;this.scale.x=e*t/this.texture._frame.width,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this.texture._frame.height},set:function(t){var e=h.sign(this.scale.y)||1;this.scale.y=e*t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),i.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=h.sign(this.scale.x)*this._width/this.texture.frame.width),this._height&&(this.scale.y=h.sign(this.scale.y)*this._height/this.texture.frame.height)},i.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},i.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,i,n,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),h=o*-this.anchor.x,u=s*(1-this.anchor.y),l=s*-this.anchor.y,c=t||this.worldTransform,p=c.a,d=c.b,f=c.c,v=c.d,g=c.tx,m=c.ty,y=p*h+f*l+g,x=v*l+d*h+m,b=p*a+f*l+g,_=v*l+d*a+m,T=p*a+f*u+g,E=v*u+d*a+m,S=p*h+f*u+g,w=v*u+d*h+m;if(e=y,e=e>b?b:e,e=e>T?T:e,e=e>S?S:e,i=x,i=i>_?_:i,i=i>E?E:i,i=i>w?w:i,r=y,r=b>r?b:r,r=T>r?T:r,r=S>r?S:r,n=x,n=_>n?_:n,n=E>n?E:n,n=w>n?w:n,this.children.length){var A=this.containerGetBounds();a=A.x,h=A.x+A.width,u=A.y,l=A.y+A.height,e=a>e?e:a,i=u>i?i:u,r=r>h?r:h,n=n>l?n:l}var C=this._bounds;C.x=e,C.width=r-e,C.y=i,C.height=n-i,this._currentBounds=C}return this._currentBounds},i.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,l);var e,r=this._texture._frame.width,i=this._texture._frame.height,n=-r*this.anchor.x;return l.x>n&&l.xe&&l.yi;i+=6,o+=4)this.indices[i+0]=o+0,this.indices[i+1]=o+1,this.indices[i+2]=o+2,this.indices[i+3]=o+0,this.indices[i+4]=o+2,this.indices[i+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var n=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,o.registerPlugin("sprite",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},i.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var i,n,o,s,a=t.anchor.x,h=t.anchor.y;if(e.trim&&void 0===t.tileScale){var u=e.trim;n=u.x-a*u.width,i=n+e.crop.width,s=u.y-h*u.height,o=s+e.crop.height}else i=e._frame.width*(1-a),n=e._frame.width*-a,o=e._frame.height*(1-h),s=e._frame.height*-h;var l=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,p=c.a,d=c.b,f=c.c,v=c.d,g=c.tx,m=c.ty,y=this.colors,x=this.positions;if(this.renderer.roundPixels){var b=this.renderer.resolution;x[l]=((p*n+f*s+g)*b|0)/b,x[l+1]=((v*s+d*n+m)*b|0)/b,x[l+5]=((p*i+f*s+g)*b|0)/b,x[l+6]=((v*s+d*i+m)*b|0)/b,x[l+10]=((p*i+f*o+g)*b|0)/b,x[l+11]=((v*o+d*i+m)*b|0)/b,x[l+15]=((p*n+f*o+g)*b|0)/b,x[l+16]=((v*o+d*n+m)*b|0)/b}else x[l]=p*n+f*s+g,x[l+1]=v*s+d*n+m,x[l+5]=p*i+f*s+g,x[l+6]=v*s+d*i+m,x[l+10]=p*i+f*o+g,x[l+11]=v*o+d*i+m,x[l+15]=p*n+f*o+g,x[l+16]=v*o+d*n+m;x[l+2]=r.x0,x[l+3]=r.y0,x[l+7]=r.x1,x[l+8]=r.y1,x[l+12]=r.x2,x[l+13]=r.y2,x[l+17]=r.x3,x[l+18]=r.y3;var _=t.tint;y[l+4]=y[l+9]=y[l+14]=y[l+19]=(_>>16)+(65280&_)+((255&_)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},i.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var i,n,o,s,a=0,h=0,u=null,l=this.renderer.blendModeManager.currentBlendMode,c=null,p=!1,d=!1,f=0,v=this.currentBatchSize;v>f;f++)s=this.sprites[f],i=s._texture.baseTexture,n=s.blendMode,o=s.shader||this.shader,p=l!==n,d=c!==o,(u!==i||p||d)&&(this.renderBatch(u,a,h),h=f,a=0,u=i,p&&(l=n,this.renderer.blendModeManager.setBlendMode(l)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(u,a,h),this.currentBatchSize=0}},i.prototype.renderBatch=function(t,e,r){if(0!==e){var i=this.renderer.gl;t._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,t._glTextures[i.id]):this.renderer.updateTexture(t),i.drawElements(i.TRIANGLES,6*e,i.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},i.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},i.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.call(this),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63}],69:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var i=o.fromCanvas(this.canvas);i.trim=new s.Rectangle,n.call(this,i),this.text=t,this.style=e}var n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fontPropertiesCache={},i.fontPropertiesCanvas=document.createElement("canvas"),i.fontPropertiesContext=i.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(i.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=void 0!==t.dropShadowAngle?t.dropShadowAngle:Math.PI/6,t.dropShadowDistance=void 0!==t.dropShadowDistance?t.dropShadowDistance:5,t.dropShadowBlur=void 0!==t.dropShadowBlur?t.dropShadowBlur:0,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),i=new Array(r.length),n=0,o=this.determineFontProperties(t.font),s=0;s0?(this.context.shadowColor=t.dropShadowColor,this.context.shadowBlur=t.dropShadowBlur):this.context.fillStyle=t.dropShadowColor;var d=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,f=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(s=0;sh;h++){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d+=p}for(e.ascent=s-h,d=c-p,f=!1,h=a;h>s;h--){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d-=p}e.descent=h-s,e.fontSize=e.ascent+e.descent,i.fontPropertiesCache[t]=e}return e},i.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;no?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=u,e+=" "+s[a])}n0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.clear=function(){this.valid&&(this.renderer.type===l.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},i.prototype.renderWebGL=function(t,e,r,i){if(this.valid){if(i=void 0!==i?i:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,i){t.worldTransform.identity(),t.currentBounds=null;var n,o,s=t.children;for(n=0,o=s.length;o>n;++n)s[n].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},i.prototype.renderCanvas=function(t,e,r,i){if(this.valid){i=!!i;var n=c;n.identity(),e&&n.append(e);var o=t.worldTransform;t.worldTransform=n,t.worldAlpha=1;var s,a,h=t.children;for(s=0,a=h.length;a>s;++s)h[s].updateTransform();r&&this.textureBuffer.clear();var u=this.textureBuffer.context,l=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=l,t.worldTransform===n&&(t.worldTransform=o)}},i.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},i.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},i.prototype.getBase64=function(){return this.getCanvas().toDataURL()},i.prototype.getCanvas=function(){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,i=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null);var n=new h(e,r),o=n.context.getImageData(0,0,e,r);return o.data.set(i),n.context.putImageData(o,0,0),n.canvas}return this.textureBuffer.canvas},i.prototype.getPixels=function(){var t,e;if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var i=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},i.prototype.getPixel=function(t,e){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,i=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer), - r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":33,"../renderers/canvas/utils/CanvasBuffer":45,"../renderers/webgl/managers/FilterManager":54,"../renderers/webgl/utils/RenderTarget":65,"./BaseTexture":70,"./Texture":72}],72:[function(t,e,r){function i(t,e,r,n,o){if(a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this._rotate=+(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw"attempt to use diamond-shaped UVs. If you are sure, set rotation manually";t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),u=t("../utils");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}},rotate:{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new i(n.fromImage(t,e,r)),u.TextureCache[t]=o),o},i.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(o.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(o.fromUrl(t,e))},i.addTextureToCache=function(t,e){u.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},i.EMPTY=new i(new n)},{"../math":33,"../utils":77,"./BaseTexture":70,"./TextureUvs":73,"./VideoBaseTexture":74,eventemitter3:10}],73:[function(t,e,r){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=i;var n=t("../math/GroupD8");i.prototype.set=function(t,e,r){var i=e.width,o=e.height;if(r){var s=n.isSwapWidthHeight(r),a=(s?t.height:t.width)/2/i,h=(s?t.width:t.height)/2/o,u=t.x/i+a,l=t.y/o+h;r=n.add(r,n.NW),this.x0=u+a*n.uX(r),this.y0=l+h*n.uY(r),r=n.add(r,2),this.x1=u+a*n.uX(r),this.y1=l+h*n.uY(r),r=n.add(r,2),this.x2=u+a*n.uX(r),this.y2=l+h*n.uY(r),r=n.add(r,2),this.x3=u+a*n.uX(r),this.y3=l+h*n.uY(r)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o}},{"../math/GroupD8":30}],74:[function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),s.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=i},{"../const":22,eventemitter3:10}],76:[function(t,e,r){var i=t("./Ticker"),n=new i;n.autoStart=!0,e.exports={shared:n,Ticker:i}},{"./Ticker":75}],77:[function(t,e,r){var i=t("../const"),n=e.exports={_uid:0,_saidHello:!1,EventEmitter:t("eventemitter3"),pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++n._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+t+" - http://www.pixijs.com/");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(i){return!1}},sign:function(t){return t?0>t?-1:1:0},removeItems:function(t,e,r){var i=t.length;if(!(e>=i||0===r)){r=e+r>i?i-e:r;for(var n=e,o=i-r;o>n;++n)t[n]=t[n+r];t.length=o}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":78,async:1,eventemitter3:10}],78:[function(t,e,r){function i(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){i(t)}}},{}],79:[function(t,e,r){var i=t("./core"),n=t("./mesh"),o=t("./extras"),s=t("./filters");i.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},i.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(i,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),i.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),i.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),n.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),n.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),i.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),i.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),i.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),i.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),i}}}),i.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},i.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},i.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},i.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),i.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),i.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),i.SpriteMaskFilter}}}),i.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),i.utils.uid()}},{"./core":29,"./extras":86,"./filters":103,"./mesh":128}],80:[function(t,e,r){function i(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):i.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){for(var t=i.fonts[this._font.name],e=new n.Point,r=null,o=[],s=0,a=0,h=[],u=0,l=this._font.size/t.size,c=-1,p=0,d=0;d0&&e.x*l>this.maxWidth)n.utils.removeItems(o,c,d-c),d=c,c=-1,h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var v=t.chars[f];v&&(r&&v.kerning[r]&&(e.x+=v.kerning[r]),o.push({texture:v.texture,line:u,charCode:f,position:new n.Point(e.x+v.xOffset,e.y+v.yOffset)}),s=e.x+(v.texture.width+v.xOffset),e.x+=v.xAdvance,p=Math.max(p,v.yOffset+v.texture.height),r=f)}}h.push(s),a=Math.max(a,s);var g=[];for(d=0;u>=d;d++){var m=0;"right"===this._font.align?m=a-h[d]:"center"===this._font.align&&(m=(a-h[d])/2),g.push(m)}var y=o.length,x=this.tint;for(d=0;y>d;d++){var b=this._glyphs[d];b?b.texture=o[d].texture:(b=new n.Sprite(o[d].texture),this._glyphs.push(b)),b.position.x=(o[d].position.x+g[o[d].line])*l,b.position.y=o[d].position.y*l,b.scale.x=b.scale.y=l,b.tint=x,b.parent||this.addChild(b)}for(d=y;dt&&(t+=this._textures.length),t}}}),i.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},i.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this._texture=this._textures[this.currentFrame]},i.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;0>r;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},i.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},i.fromFrames=function(t){for(var e=[],r=0;rx?x:t,t=t>_?_:t,t=t>E?E:t,r=y,r=r>b?b:r,r=r>T?T:r,r=r>S?S:r,e=m,e=x>e?x:e,e=_>e?_:e,e=E>e?E:e,i=y,i=b>i?b:i,i=T>i?T:i,i=S>i?S:i;var w=this._bounds;return w.x=t,w.width=e-t,w.y=r,w.height=i-r,this._currentBounds=w,w},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,i=this._height,n=-r*this.anchor.x;return o.x>n&&o.xe&&o.y 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],88:[function(t,e,r){function i(){n.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new n.AbstractFilter}var n=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,i),t.blendModeManager.setBlendMode(n.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,i,r),t.blendModeManager.setBlendMode(n.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(i)},Object.defineProperties(i.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":91,"../blur/BlurYFilter":92 -}],89:[function(t,e,r){function i(t,e){n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new n.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(n,e,o,i);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,u,l,e,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},i.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],95:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],96:[function(t,e,r){function i(t,e,r){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],97:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i},{"../../core":29}],98:[function(t,e,r){function i(t,e){var r=new n.Matrix;t.renderable=!1,n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision mediump float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:r.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=r,(null===e||void 0===e)&&(e=20),this.scale=new n.Point(e,e)}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager;i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],99:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * dimensions.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],100:[function(t,e,r){function i(){n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(i.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function i(){n.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var n=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,i),this.tiltShiftYFilter.applyFilter(t,i,r),t.filterManager.returnRenderTarget(i)},Object.defineProperties(i.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function i(){n.call(this)}var n=t("./TiltShiftAxisFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function i(){n.call(this)}var n=t("./TiltShiftAxisFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){(function(r){t("./polyfill");var i=e.exports=t("./core");i.extras=t("./extras"),i.filters=t("./filters"),i.interaction=t("./interaction"),i.loaders=t("./loaders"),i.mesh=t("./mesh"),i.accessibility=t("./accessibility"),i.loader=new i.loaders.Loader,Object.assign(i,t("./deprecation")),r.PIXI=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":21,"./core":29,"./deprecation":79,"./extras":86,"./filters":103,"./interaction":118,"./loaders":121,"./mesh":128,"./polyfill":133}],116:[function(t,e,r){function i(){this.global=new n.Point,this.target=null,this.originalEvent=null}var n=t("../core");i.prototype.constructor=i,e.exports=i,i.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}},{"../core":29}],117:[function(t,e,r){function i(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var n=t("../core"),o=t("./InteractionData");Object.assign(n.DisplayObject.prototype,t("./interactiveTarget")),i.prototype.constructor=i,e.exports=i,i.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;h--){var u=a[h];if(this.processInteractive(t,u,r,i,s)){if(!u.parent)continue;o=!0,s=!1,u.interactive&&(i=!1)}}return n&&(i&&!o&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),o=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(o=e.containsPoint(t))),e.interactive&&r(e,o)),o},i.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},i.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},i.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},i.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},i.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},i.prototype.processMouseMove=function(t,e){this.processMouseOverOut(t,e),(!this.moveWhenInside||e)&&this.dispatchEvent(t,"mousemove",this.eventData)},i.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},i.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},i.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},i.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},i.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},i.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},i.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,this.moveWhenInside),this.returnTouchData(o)}},i.prototype.processTouchMove=function(t,e){(!this.moveWhenInside||e)&&this.dispatchEvent(t,"touchmove",this.eventData)},i.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},i.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",i),n.CanvasRenderer.registerPlugin("interaction",i)},{"../core":29,"./InteractionData":116,"./interactiveTarget":119}],118:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":116,"./InteractionManager":117,"./interactiveTarget":119}],119:[function(t,e,r){var i={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=i},{}],120:[function(t,e,r){function i(t,e){var r={},i=t.data.getElementsByTagName("info")[0],n=t.data.getElementsByTagName("common")[0];r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hn;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},i.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;n>o;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},i.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,h=this._texture.baseTexture.height,u=e[i],l=e[n],c=e[o],p=e[i+1],d=e[n+1],f=e[o+1],v=r[i]*a,g=r[n]*a,m=r[o]*a,y=r[i+1]*h,x=r[n+1]*h,b=r[o+1]*h;if(this.canvasPadding>0){var _=this.canvasPadding/this.worldTransform.a,T=this.canvasPadding/this.worldTransform.d,E=(u+l+c)/3,S=(p+d+f)/3,w=u-E,A=p-S,C=Math.sqrt(w*w+A*A);u=E+w/C*(C+_),p=S+A/C*(C+T),w=l-E,A=d-S,C=Math.sqrt(w*w+A*A),l=E+w/C*(C+_),d=S+A/C*(C+T),w=c-E,A=f-S,C=Math.sqrt(w*w+A*A),c=E+w/C*(C+_),f=S+A/C*(C+T)}t.save(),t.beginPath(),t.moveTo(u,p),t.lineTo(l,d),t.lineTo(c,f),t.closePath(),t.clip();var M=v*x+y*m+g*b-x*m-y*g-v*b,R=u*x+y*c+l*b-x*c-y*l-u*b,O=v*l+u*m+g*c-l*m-u*g-v*c,P=v*x*c+y*l*m+u*g*b-u*x*m-y*g*c-v*l*b,F=p*x+y*f+d*b-x*f-y*d-p*b,D=v*d+p*m+g*f-d*m-p*g-v*f,B=v*x*f+y*d*m+p*g*b-p*x*m-y*g*f-v*d*b;t.transform(R/M,F/M,O/M,D/M,P/M,B/M),t.drawImage(s,0,0),t.restore()},i.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;i-2>n;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],u=r[o+1],l=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,l),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},i.prototype._onTextureUpdate=function(){this.updateFrame=!0},i.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,u=-(1/0),l=-(1/0),c=1/0,p=1/0,d=this.vertices,f=0,v=d.length;v>f;f+=2){var g=d[f],m=d[f+1],y=r*g+o*m+a,x=s*m+i*g+h;c=c>y?y:c,p=p>x?x:p,u=y>u?y:u,l=x>l?x:l}if(c===-(1/0)||l===1/0)return n.Rectangle.EMPTY;var b=this._bounds;b.x=c,b.width=u-c,b.y=p,b.height=l-p,this._currentBounds=b}return this._currentBounds},i.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,n=this.vertices,a=s.points;if(this.drawMode===i.DRAW_MODES.TRIANGLES){var h=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*h[e],l=2*h[e+1],c=2*h[e+2];if(a[0]=n[u],a[1]=n[u+1],a[2]=n[l],a[3]=n[l+1],a[4]=n[c],a[5]=n[c+1],s.contains(o.x,o.y))return!0}}else for(r=n.length,e=0;r>e;e+=6)if(a[0]=n[e],a[1]=n[e+1],a[2]=n[e+2],a[3]=n[e+3],a[4]=n[e+4],a[5]=n[e+5],s.contains(o.x,o.y))return!0;return!1},i.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],126:[function(t,e,r){function i(t,e,r){n.call(this,t),this._ready=!0,this.segmentsX=e||10,this.segmentsY=r||10,this.drawMode=n.DRAW_MODES.TRIANGLES,this.refresh()}var n=t("./Mesh");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.segmentsX*this.segmentsY,e=[],r=[],i=[],n=[],o=this.texture,s=this.segmentsX-1,a=this.segmentsY-1,h=0,u=o.width/s,l=o.height/a;for(h=0;t>h;h++){var c=h%this.segmentsX,p=h/this.segmentsX|0;e.push(c*u,p*l),i.push(o._uvs.x0+(o._uvs.x1-o._uvs.x0)*(c/(this.segmentsX-1)),o._uvs.y0+(o._uvs.y3-o._uvs.y0)*(p/(this.segmentsY-1)))}var d=s*a;for(h=0;d>h;h++){var f=h%s,v=h/s|0,g=v*this.segmentsX+f,m=v*this.segmentsX+f+1,y=(v+1)*this.segmentsX+f,x=(v+1)*this.segmentsX+f+1;n.push(g,m,y),n.push(m,x,y)}this.vertices=new Float32Array(e),this.uvs=new Float32Array(i),this.colors=new Float32Array(r),this.indices=new Uint16Array(n)},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()}},{"./Mesh":125}],127:[function(t,e,r){function i(t,e){n.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var n=t("./Mesh"),o=t("../core");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,i=this.colors,n=this._texture._uvs,s=new o.Point(n.x0,n.y0),a=new o.Point(n.x2-n.x0,n.y2-n.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var h,u,l,c=t.length,p=1;c>p;p++)h=t[p],u=4*p,l=p/(c-1),e[u]=l*a.x+s.x,e[u+1]=0+s.y,e[u+2]=l*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*p,i[u]=1,i[u+1]=1,u=2*p,r[u]=u,r[u+1]=u+1;this.dirty=!0}},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},i.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,u=0,l=this.vertices,c=t.length,p=0;c>p;p++)r=t[p],i=4*p,e=p1&&(n=1),o=Math.sqrt(h*h+u*u),s=this._texture.height/2,h/=o,u/=o,h*=s,u*=s,l[i]=r.x+h,l[i+1]=r.y+u,l[i+2]=r.x-h,l[i+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":125}],128:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Plane:t("./Plane"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":125,"./Plane":126,"./Rope":127,"./webgl/MeshRenderer":129,"./webgl/MeshShader":130}],129:[function(t,e,r){function i(t){n.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3;this.currentShader=null}var n=t("../../core"),o=t("../Mesh");i.prototype=Object.create(n.ObjectRenderer.prototype),i.prototype.constructor=i,e.exports=i,n.WebGLRenderer.registerPlugin("mesh",i),i.prototype.onContextChange=function(){},i.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,i=t._texture.baseTexture,n=t.shader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),n=n?n.shaders[r.id]||n.getShader(e):e.shaderManager.plugins.meshShader,this.renderer.shaderManager.setShader(n),n.uniforms.translationMatrix.value=t.worldTransform.toArray(!0),n.uniforms.projectionMatrix.value=e.currentRenderTarget.projectionMatrix.toArray(!0),n.uniforms.alpha.value=t.worldAlpha,n.syncUniforms(),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices), - r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},i.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},i.prototype.flush=function(){},i.prototype.start=function(){this.currentShader=null},i.prototype.destroy=function(){n.ObjectRenderer.prototype.destroy.call(this)}},{"../../core":29,"../Mesh":125}],130:[function(t,e,r){function i(t){n.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var n=t("../../core");i.prototype=Object.create(n.Shader.prototype),i.prototype.constructor=i,e.exports=i,n.ShaderManager.registerPlugin("meshShader",i)},{"../../core":29}],131:[function(t,e,r){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},{}],132:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":11}],133:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign")},{"./Math.sign":131,"./Object.assign":132,"./requestAnimationFrame":134}],134:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;ni&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[115])(115)}); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){var t=this.gl;t.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],3:[function(t,e,r){var i=t("./GLTexture"),n=function(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100};n.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new i(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},n.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},n.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT)},n.prototype.bind=function(){var t=this.gl;this.texture&&this.texture.unbind(),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},n.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},n.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},n.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},n.createRGBA=function(t,e,r,o){var s=i.fromData(t,null,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},n.createFloat32=function(t,e,r,o){var s=new i.fromData(t,o,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},e.exports=n},{"./GLTexture":5}],4:[function(t,e,r){var i=t("./shader/compileProgram"),n=t("./shader/extractAttributes"),o=t("./shader/extractUniforms"),s=t("./shader/generateUniformAccessObject"),a=function(t,e,r){this.gl=t,this.program=i(t,e,r),this.attributes=n(t,this.program);var a=o(t,this.program);this.uniforms=s(t,a)};a.prototype.bind=function(){this.gl.useProgram(this.program)},a.prototype.destroy=function(){this.gl},e.exports=a},{"./shader/compileProgram":9,"./shader/extractAttributes":11,"./shader/extractUniforms":12,"./shader/generateUniformAccessObject":13}],5:[function(t,e,r){var i=function(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||0,this.height=r||0,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE};i.prototype.upload=function(t){this.bind();var e=this.gl;this.width=t.videoWidth||t.width,this.height=t.videoHeight||t.height,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t)};var n=!1;i.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(this.width=e||this.width,this.height=r||this.height,t instanceof Float32Array){if(!n){var o=i.getExtension("OES_texture_float");if(!o)throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,0,this.format,this.width,this.height,0,this.format,this.type,t||null)},i.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},i.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},i.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},i.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},i.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},i.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},i.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},i.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},i.prototype.destroy=function(){var t=this.gl;t.deleteTexture(this.texture)},i.fromSource=function(t,e,r){var n=new i(t);return n.premultiplyAlpha=r||!1,n.upload(e),n},i.fromData=function(t,e,r,n){var o=new i(t);return o.uploadData(e,r,n),o},e.exports=i},{}],6:[function(t,e,r){function i(t,e){if(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}var n=t("./setVertexAttribArrays");i.prototype.constructor=i,e.exports=i,i.prototype.bind=function(){return this.nativeVao?(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty&&(this.dirty=!1,this.activate())):this.activate(),this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;rs;s++){var a=t.getActiveAttrib(e,s),h=i(t,a.type);r[a.name]={type:h,size:n(h),location:t.getAttribLocation(e,a.name),pointer:function(e,r,i,n){t.vertexAttribPointer(this.location,this.size,e||t.FLOAT,r||!1,i||0,n||0)}}}return r};e.exports=o},{"./mapSize":14,"./mapType":15}],12:[function(t,e,r){var i=t("./mapType"),n=t("./defaultValue"),o=function(t,e){for(var r={},o=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),s=0;o>s;s++){var a=t.getActiveUniform(e,s),h=a.name.replace(/\[.*?\]/,""),u=i(t,a.type);r[h]={type:u,size:a.size,location:t.getUniformLocation(e,h),value:n(u,a.size)}}return r};e.exports=o},{"./defaultValue":10,"./mapType":15}],13:[function(t,e,r){var i=function(t,e){var r={data:{}};r.gl=t;for(var i=Object.keys(e),a=0;a=0&&t.length%1===0}function c(t,e){for(var r=-1,i=t.length;++ri?i:null}):(r=X(t),e=r.length,function(){return i++,e>i?r[i]:null})}function x(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;r>n;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function m(t){return function(e,r,i){return t(e,i)}}function T(t){return function(e,r,i){i=u(i||n),e=e||[];var o=y(e);if(0>=t)return i(null);var s=!1,a=0,l=!1;!function c(){if(s&&0>=a)return i(null);for(;t>a&&!l;){var n=o();if(null===n)return s=!0,void(0>=a&&i(null));a+=1,r(e[n],n,h(function(t){a-=1,t?(i(t),l=!0):c()}))}}()}}function b(t){return function(e,r,i){return t(N.eachOf,e,r,i)}}function _(t){return function(e,r,i,n){return t(T(r),e,i,n)}}function w(t){return function(e,r,i){return t(N.eachOfSeries,e,r,i)}}function E(t,e,r,i){i=u(i||n),e=e||[];var o=l(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){o[e]=r,i(t)})},function(t){i(t,o)})}function S(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(p(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function C(t,e,r,i){S(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function M(t,e,r){return function(i,n,o,s){function a(){s&&s(r(!1,void 0))}function h(t,i,n){return s?void o(t,function(i){s&&e(i)&&(s(r(!0,t)),s=o=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(s=o,o=n,t(i,h,a))}}function R(t,e){return e}function A(t,e,r){r=r||n;var i=l(e)?[]:{};t(e,function(t,e,r){t(x(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function O(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function P(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length&&t.idle()?N.setImmediate(function(){t.drain()}):(c(e,function(e){var o={data:e,callback:i||n};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated()}),void N.setImmediate(t.process))}function o(t,e){return function(){s-=1;var r=!1,i=arguments;c(e,function(t){c(a,function(e,i){e!==t||r||(a.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a=[],u={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(t,e){i(u,t,!1,e)},kill:function(){u.drain=n,u.tasks=[]},unshift:function(t,e){i(u,t,!0,e)},process:function(){for(;!u.paused&&s=e;e++)N.setImmediate(u.process)}}};return u}function D(t){return x(function(e,r){e.apply(null,r.concat([x(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,function(e){console[t](e)}))})]))})}function L(t){return function(e,r,i){t(d(e),r,i)}}function I(t){return x(function(e,r){var i=x(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function B(t){return x(function(e){var r=e.pop();e.push(function(){var t=arguments;i?N.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var F,N={},k="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i||this;null!=k&&(F=k.async),N.noConflict=function(){return k.async=F,N};var U=Object.prototype.toString,j=Array.isArray||function(t){return"[object Array]"===U.call(t)},G=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},X=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},W="function"==typeof setImmediate&&setImmediate,z=W?function(t){W(t)}:function(t){setTimeout(t,0)};"object"==typeof e&&"function"==typeof e.nextTick?N.nextTick=e.nextTick:N.nextTick=z,N.setImmediate=W?z:N.nextTick,N.forEach=N.each=function(t,e,r){return N.eachOf(t,m(e),r)},N.forEachSeries=N.eachSeries=function(t,e,r){return N.eachOfSeries(t,m(e),r)},N.forEachLimit=N.eachLimit=function(t,e,r,i){return T(e)(t,m(r),i)},N.forEachOf=N.eachOf=function(t,e,r){function i(t){a--,t?r(t):null===o&&0>=a&&r(null)}r=u(r||n),t=t||[];for(var o,s=y(t),a=0;null!=(o=s());)a+=1,e(t[o],o,h(i));0===a&&r(null)},N.forEachOfSeries=N.eachOfSeries=function(t,e,r){function i(){var n=!0;return null===s?r(null):(e(t[s],s,h(function(t){if(t)r(t);else{if(s=o(),null===s)return r(null);n?N.setImmediate(i):i()}})),void(n=!1))}r=u(r||n),t=t||[];var o=y(t),s=o();i()},N.forEachOfLimit=N.eachOfLimit=function(t,e,r,i){T(e)(t,r,i)},N.map=b(E),N.mapSeries=w(E),N.mapLimit=_(E),N.inject=N.foldl=N.reduce=function(t,e,r,i){N.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},N.foldr=N.reduceRight=function(t,e,r,i){var n=p(t,o).reverse();N.reduce(n,e,r,i)},N.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=j(t)?[]:{}),N.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},N.select=N.filter=b(S),N.selectLimit=N.filterLimit=_(S),N.selectSeries=N.filterSeries=w(S),N.reject=b(C),N.rejectLimit=_(C),N.rejectSeries=w(C),N.any=N.some=M(N.eachOf,s,o),N.someLimit=M(N.eachOfLimit,s,o),N.all=N.every=M(N.eachOf,a,a),N.everyLimit=M(N.eachOfLimit,a,a),N.detect=M(N.eachOf,o,R),N.detectSeries=M(N.eachOfSeries,o,R),N.detectLimit=M(N.eachOfLimit,o,R),N.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0}N.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,p(e.sort(i),function(t){return t.value}))})},N.auto=function(t,e,r){function i(t){y.unshift(t)}function o(t){var e=g(y,t);e>=0&&y.splice(e,1)}function s(){h--,c(y.slice(0),function(t){t()})}"function"==typeof arguments[1]&&(r=e,e=null),r=u(r||n);var a=X(t),h=a.length;if(!h)return r(null);e||(e=h);var l={},p=0,d=!1,y=[];i(function(){h||r(null,l)}),c(a,function(n){function a(){return e>p&&f(m,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(n)}function h(){a()&&(p++,o(h),c[c.length-1](y,l))}if(!d){for(var u,c=j(t[n])?t[n]:[t[n]],y=x(function(t,e){if(p--,e.length<=1&&(e=e[0]),t){var i={};v(l,function(t,e){i[e]=t}),i[n]=e,d=!0,r(t,i)}else l[n]=e,N.setImmediate(s)}),m=c.slice(0,c.length-1),T=m.length;T--;){if(!(u=t[m[T]]))throw new Error("Has nonexistent dependency in "+m.join(", "));if(j(u)&&g(u,n)>=0)throw new Error("Has cyclic dependencies")}a()?(p++,c[c.length-1](y,l)):i(h)}})},N.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}N.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var o=5,s=0,a=[],h={times:o,interval:s},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},N.waterfall=function(t,e){function r(t){return x(function(i,n){if(i)e.apply(null,[i].concat(n));else{var o=t.next();o?n.push(r(o)):n.push(e),B(t).apply(null,n)}})}if(e=u(e||n),!j(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(N.iterator(t))():e()},N.parallel=function(t,e){A(N.eachOf,t,e)},N.parallelLimit=function(t,e,r){A(T(e),t,r)},N.series=function(t,e){A(N.eachOfSeries,t,e)},N.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return ri;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function o(t,e,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length?N.setImmediate(function(){t.drain()}):void c(e,function(e){var a={data:e,priority:o,callback:"function"==typeof s?s:n};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),N.setImmediate(t.process)})}var s=N.queue(t,e);return s.push=function(t,e,r){o(s,t,e,r)},delete s.unshift,s},N.cargo=function(t,e){return P(t,1,e)},N.log=D("log"),N.dir=D("dir"),N.memoize=function(t,e){var r={},i={},n=Object.prototype.hasOwnProperty;e=e||o;var s=x(function(o){var s=o.pop(),a=e.apply(null,o);n.call(r,a)?N.setImmediate(function(){s.apply(null,r[a])}):n.call(i,a)?i[a].push(s):(i[a]=[s],t.apply(null,o.concat([x(function(t){r[a]=t;var e=i[a];delete i[a];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return s.memo=r,s.unmemoized=t,s},N.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},N.times=L(N.map),N.timesSeries=L(N.mapSeries),N.timesLimit=function(t,e,r,i){return N.mapLimit(d(t),e,r,i)},N.seq=function(){var t=arguments;return x(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=n,N.reduce(t,e,function(t,e,i){e.apply(r,t.concat([x(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},N.compose=function(){return N.seq.apply(null,Array.prototype.reverse.call(arguments))},N.applyEach=I(N.eachOf),N.applyEachSeries=I(N.eachOfSeries),N.forever=function(t,e){function r(t){return t?i(t):void o(r)}var i=h(e||n),o=B(t);r()},N.ensureAsync=B,N.constant=x(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),N.wrapSync=N.asyncify=function(t){return x(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}G(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof r&&r.exports?r.exports=N:"function"==typeof t&&t.amd?t([],function(){return N}):k.async=N}()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:19}],17:[function(t,e,r){"use strict";"use restrict";function i(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var n=32;r.INT_BITS=n,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(0>t)},r.abs=function(t){var e=t>>n-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],18:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;s>h;h++)if(n[h]!==o[h]){a=h;break}for(var u=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:19}],19:[function(t,e,r){function i(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&n()}function n(){if(!l){var t=setTimeout(i);l=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(i=r[0]+"@",t=r[1]),t=t.replace(L,".");var n=t.split("."),o=s(n,e).join(".");return i+o}function h(t){for(var e,r,i=[],n=0,o=t.length;o>n;)e=t.charCodeAt(n++),e>=55296&&56319>=e&&o>n?(r=t.charCodeAt(n++),56320==(64512&r)?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--)):i.push(e);return i}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function l(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:w}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function p(t,e,r){var i=0;for(t=r?F(t/M):t>>1,t+=F(t/e);t>B*S>>1;i+=w)t=F(t/B);return F(i+(B+1)*t/(t+C))}function d(t){var e,r,i,n,s,a,h,c,d,f,v=[],g=t.length,y=0,x=A,m=R;for(r=t.lastIndexOf(O),0>r&&(r=0),i=0;r>i;++i)t.charCodeAt(i)>=128&&o("not-basic"),v.push(t.charCodeAt(i));for(n=r>0?r+1:0;g>n;){for(s=y,a=1,h=w;n>=g&&o("invalid-input"),c=l(t.charCodeAt(n++)),(c>=w||c>F((_-y)/a))&&o("overflow"),y+=c*a,d=m>=h?E:h>=m+S?S:h-m,!(d>c);h+=w)f=w-d,a>F(_/f)&&o("overflow"),a*=f;e=v.length+1,m=p(y-s,e,0==s),F(y/e)>_-x&&o("overflow"),x+=F(y/e),y%=e,v.splice(y++,0,x)}return u(v)}function f(t){var e,r,i,n,s,a,u,l,d,f,v,g,y,x,m,T=[];for(t=h(t),g=t.length,e=A,r=0,s=R,a=0;g>a;++a)v=t[a],128>v&&T.push(N(v));for(i=n=T.length,n&&T.push(O);g>i;){for(u=_,a=0;g>a;++a)v=t[a],v>=e&&u>v&&(u=v);for(y=i+1,u-e>F((_-r)/y)&&o("overflow"),r+=(u-e)*y,e=u,a=0;g>a;++a)if(v=t[a],e>v&&++r>_&&o("overflow"),v==e){for(l=r,d=w;f=s>=d?E:d>=s+S?S:d-s,!(f>l);d+=w)m=l-f,x=w-f,T.push(N(c(f+m%x,0))),l=F(m/x);T.push(N(c(l,0))),s=p(r,y,i==n),r=0,++i}++r,++e}return T.join("")}function v(t){return a(t,function(t){return P.test(t)?d(t.slice(4).toLowerCase()):t})}function g(t){return a(t,function(t){return D.test(t)?"xn--"+f(t):t})}var y="object"==typeof i&&i&&!i.nodeType&&i,x="object"==typeof r&&r&&!r.nodeType&&r,m="object"==typeof e&&e;m.global!==m&&m.window!==m&&m.self!==m||(n=m);var T,b,_=2147483647,w=36,E=1,S=26,C=38,M=700,R=72,A=128,O="-",P=/^xn--/,D=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=w-E,F=Math.floor,N=String.fromCharCode;if(T={version:"1.3.2",ucs2:{decode:h,encode:u},decode:d,encode:f,toASCII:g,toUnicode:v},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return T});else if(y&&x)if(r.exports==y)x.exports=T;else for(b in T)T.hasOwnProperty(b)&&(y[b]=T[b]);else n.punycode=T}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;u>l;++l){var c,p,d,f,v=t[l].replace(a,"%20"),g=v.indexOf(r);g>=0?(c=v.substr(0,g),p=v.substr(g+1)):(c=v,p=""),d=decodeURIComponent(c),f=decodeURIComponent(p),i(s,d)?n(s[d])?s[d].push(f):s[d]=[s[d],f]:s[d]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],22:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(v),y=["'"].concat(g),x=["%","/","?",";","#"].concat(y),m=["/","?","#"],T=255,b=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=t("querystring");i.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t;i=i.trim();var n=d.exec(i);if(n){n=n[0];var o=n.toLowerCase();this.protocol=o,i=i.substr(n.length)}if(r||n||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||n&&E[n]||(i=i.substr(2),this.slashes=!0)}if(!E[n]&&(s||n&&!S[n])){for(var a=-1,u=0;ul)&&(a=l)}var c,f;f=-1===a?i.lastIndexOf("@"):i.lastIndexOf("@",a),-1!==f&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;ul)&&(a=l)}-1===a&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var g=this.hostname.split(/\./),u=0,M=g.length;M>u;u++){var R=g[u];if(R&&!R.match(b)){for(var A="",O=0,P=R.length;P>O;O++)A+=R.charCodeAt(O)>127?"x":R[O];if(!A.match(b)){var D=g.slice(0,u),L=g.slice(u+1),I=R.match(_);I&&(D.push(I[1]),L.unshift(I[2])),L.length&&(i="/"+L.join(".")+i),this.hostname=D.join(".");break}}}if(this.hostname.length>T?this.hostname="":this.hostname=this.hostname.toLowerCase(),!v){for(var B=this.hostname.split("."),F=[],u=0;uu;u++){var j=y[u],G=encodeURIComponent(j);G===j&&(G=escape(j)),i=i.split(j).join(G)}var X=i.indexOf("#");-1!==X&&(this.hash=i.substr(X),i=i.slice(0,X));var W=i.indexOf("?");if(-1!==W?(this.search=i.substr(W),this.query=i.substr(W+1),e&&(this.query=C.parse(this.query)),i=i.slice(0,W)):e&&(this.search="",this.query={}),i&&(this.pathname=i),S[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",N=this.search||"";this.path=k+N}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=C.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||S[e])&&n!==!1?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+n+r+s+i},i.prototype.resolve=function(t){return this.resolveObject(n(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(h(t)){var e=new i;e.parse(t,!1,!0),t=e}var r=new i;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),S[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!S[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||E[t.protocol])r.pathname=t.pathname;else{for(var n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),p=u||a||r.host&&t.pathname,d=p,f=r.pathname&&r.pathname.split("/")||[],n=t.pathname&&t.pathname.split("/")||[],v=r.protocol&&!S[r.protocol];if(v&&(r.hostname="",r.port=null,r.host&&(""===f[0]?f[0]=r.host:f.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),p=p&&(""===n[0]||""===f[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,f=n;else if(n.length)f||(f=[]),f.pop(),f=f.concat(n),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(v){r.hostname=r.host=f.shift();var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!f.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var y=f.slice(-1)[0],x=(r.host||t.host)&&("."===y||".."===y)||""===y,m=0,T=f.length;T>=0;T--)y=f[T],"."==y?f.splice(T,1):".."===y?(f.splice(T,1),m++):m&&(f.splice(T,1),m--);if(!p&&!d)for(;m--;m)f.unshift("..");!p||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),x&&"/"!==f.join("/").substr(-1)&&f.push("");var b=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(v){r.hostname=r.host=b?"":f.length?f.shift():"";var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return p=p||r.host&&f.length,p&&!b&&f.unshift(""),f.length?r.pathname=f.join("/"):(r.pathname=null,r.path=null),l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:20,querystring:23}],25:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,a=n(t,0,o,r,!0),h=[];if(!a)return h;var u,l,p,d,f,v,g;if(i&&(a=c(t,e,a,r)),t.length>80*r){u=p=t[0],l=d=t[1];for(var y=r;o>y;y+=r)f=t[y],v=t[y+1],u>f&&(u=f),l>v&&(l=v),f>p&&(p=f),v>d&&(d=v);g=Math.max(p-u,d-l)}return s(a,h,r,u,l,g),h}function n(t,e,r,i,n){var o,s,a,h=0;for(o=e,s=r-i;r>o;o+=i)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(n===h>0)for(o=e;r>o;o+=i)a=R(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=R(o,t[o],t[o+1],a);return a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!_(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(A(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function s(t,e,r,i,n,c,p){if(t){!p&&c&&v(t,i,n,c);for(var d,f,g=t;t.prev!==t.next;)if(d=t.prev,f=t.next,c?h(t,i,n,c):a(t))e.push(d.i/r),e.push(t.i/r),e.push(f.i/r),A(t),t=f.next,g=f.next;else if(t=f,t===g){p?1===p?(t=u(t,e,r),s(t,e,r,i,n,c,2)):2===p&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(b(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(m(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(b(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=y(a,h,e,r,i),p=y(u,l,e,r,i),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;w(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),A(i),A(i.next),i=t=o),i=i.next}while(i!==t);return i}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&T(h,u)){var l=M(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var s,a,h,u,l,c=[];for(s=0,a=e.length;a>s;s++)h=e[s]*i,u=a-1>s?e[s+1]*i:t.length,l=n(t,h,u,i,!1),l===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(p),s=0;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);n>=a&&a>s&&(s=a,r=i.x=i.x&&i.x>=r.x&&m(oh||h===l&&i.x>r.x)&&S(i,t)&&(r=i,l=h)),i=i.next;return r}function v(t,e,r,i){var n=t;do null===n.z&&(n.z=y(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,g(n)}function g(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;u>e&&(a++,i=i.nextZ,i);e++);for(h=u;a>0||h>0&&i;)0===a?(n=i,i=i.nextZ,h--):0!==h&&i?r.z<=i.z?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--):(n=r,r=r.nextZ,a--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}function y(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function x(t){var e=t,r=t;do e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function T(t,e){return _(t,e)||t.next.i!==e.i&&t.prev.i!==e.i&&!E(t,e)&&S(t,e)&&S(e,t)&&C(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,r,i){return b(t,e,r)>0!=b(t,e,i)>0&&b(r,i,t)>0!=b(r,i,e)>0}function E(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&w(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function C(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function M(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function R(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=i},{}],26:[function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var o="function"!=typeof Object.create?"~":!1;n.prototype._events=void 0,n.prototype.listeners=function(t,e){var r=o?o+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,a=new Array(s);s>n;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,s),!0}for(u=1,h=new Array(c-1);c>u;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var p,d=l.length;for(u=0;d>u;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(p=1,h=new Array(c-1);c>p;p++)h[p-1]=arguments[p];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=o?o+t:t;if(!this._events||!this._events[n])return this;var s=this._events[n],a=[];if(e)if(s.fn)(s.fn!==e||i&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,u=s.length;u>h;h++)(s[h].fn!==e||i&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=o,"undefined"!=typeof e&&(e.exports=n)},{}],27:[function(e,r,i){!function(e){var i=/iPhone/i,n=/iPod/i,o=/iPad/i,s=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,a=/Android/i,h=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,u=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,l=/IEMobile/i,c=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,p=/BlackBerry/i,d=/BB10/i,f=/Opera Mini/i,v=/(CriOS|Chrome)(?=.*\bMobile\b)/i,g=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,y=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),x=function(t,e){return t.test(e)},m=function(t){var e=t||navigator.userAgent,r=e.split("[FBAN");return"undefined"!=typeof r[1]&&(e=r[0]),this.apple={phone:x(i,e),ipod:x(n,e),tablet:!x(i,e)&&x(o,e),device:x(i,e)||x(n,e)||x(o,e)},this.amazon={phone:x(h,e),tablet:!x(h,e)&&x(u,e),device:x(h,e)||x(u,e)},this.android={phone:x(h,e)||x(s,e),tablet:!x(h,e)&&!x(s,e)&&(x(u,e)||x(a,e)),device:x(h,e)||x(u,e)||x(s,e)||x(a,e)},this.windows={phone:x(l,e),tablet:x(c,e),device:x(l,e)||x(c,e)},this.other={blackberry:x(p,e),blackberry10:x(d,e),opera:x(f,e),firefox:x(g,e),chrome:x(v,e),device:x(p,e)||x(d,e)||x(f,e)||x(g,e)||x(v,e)},this.seven_inch=x(y,e),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window?this:void 0},T=function(){var t=new m;return t.Class=m,t};"undefined"!=typeof r&&r.exports&&"undefined"==typeof window?r.exports=m:"undefined"!=typeof r&&r.exports&&"undefined"!=typeof window?r.exports=T():"function"==typeof t&&t.amd?t("isMobile",[],e.isMobile=T()):e.isMobile=T()}(this)},{}],28:[function(t,e,r){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var r,s,a=i(t),h=1;h=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,i(n))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var i=0,n=function(){e(t[i],function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length?r():n())})};n()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,i){var n=d(e);n.apply(null,[t,r,i])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,i){if(i=i||function(){},!e.length||0>=t)return i();var n=0,o=0,s=0;!function a(){if(n>=e.length)return i();for(;t>s&&o=e.length?i():a())})}()}},f=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},v=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},g=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},y=function(t,e,r,i){if(e=l(e,function(t,e){return{index:e,value:t}}),i){var n=[];t(e,function(t,e){r(t.value,function(r,i){n[t.index]=i,e(r)})},function(t){i(t,n)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=f(y),s.mapSeries=g(y),s.mapLimit=function(t,e,r,i){return x(e)(t,r,i)};var x=function(t){return v(t,y)};s.reduce=function(t,e,r,i){s.eachSeries(t,function(t,i){r(e,t,function(t,r){e=r,i(t)})},function(t){i(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,i){var n=l(t,function(t){return t}).reverse();s.reduce(n,e,r,i)},s.foldr=s.reduceRight;var m=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=f(m),s.filterSeries=g(m),s.select=s.filter,s.selectSeries=s.filterSeries;var T=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=f(T),s.rejectSeries=g(T);var b=function(t,e,r,i){t(e,function(t,e){r(t,function(r){r?(i(t),i=function(){}):e()})},function(t){i()})};s.detect=f(b),s.detectSeries=g(b),s.some=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t&&(r(!0),r=function(){}),i()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t||(r(!1),r=function(){}),i()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){if(t)return r(t);var i=function(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0};r(null,l(e.sort(i),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=p(t),i=r.length;if(!i)return e();var n={},o=[],a=function(t){o.unshift(t)},l=function(t){for(var e=0;ei;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function n(t,e,n,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:n,callback:"function"==typeof o?o:null};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){n(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,i=[],n={tasks:i,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),u(t,function(t){i.push({data:t,callback:"function"==typeof r?r:null}),n.drained=!1,n.saturated&&i.length===e&&n.saturated()}),s.setImmediate(n.process)},process:function o(){if(!r){if(0===i.length)return n.drain&&!n.drained&&n.drain(),void(n.drained=!0);var s="number"==typeof e?i.splice(0,e):i.splice(0,i.length),a=l(s,function(t){return t.data});n.empty&&n.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return i.length},running:function(){return r}};return n};var E=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=E("log"),s.dir=E("dir"),s.memoize=function(t,e){var r={},i={};e=e||function(t){return t};var n=function(){var n=Array.prototype.slice.call(arguments),o=n.pop(),a=e.apply(null,n);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in i?i[a].push(o):(i[a]=[o],t.apply(null,n.concat([function(){r[a]=arguments;var t=i[a];delete i[a];for(var e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)}])))};return n.memo=r,n.unmemoized=t,n},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.map(i,e,r)},s.timesSeries=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.mapSeries(i,e,r)},s.seq=function(){var t=arguments; + return function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();s.reduce(t,r,function(t,r,i){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);i(t,e)}]))},function(t,r){i.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var S=function(t,e){var r=function(){var r=this,i=Array.prototype.slice.call(arguments),n=i.pop();return t(e,function(t,e){t.apply(r,i.concat([e]))},n)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return r.apply(this,i)}return r};s.applyEach=f(S),s.applyEachSeries=g(S),s.forever=function(t,e){function r(i){if(i){if(e)return e(i);throw i}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):n.async=s}()}).call(this,e("_process"))},{_process:19}],30:[function(t,e,r){function i(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=n.queue(this._boundLoadResource,e),this.resources={}}var n=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.add=i.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n0)if(this.xhrType===i.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===i.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},i.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},i.prototype._determineXhrType=function(){return i._xhrTypeMap[this._getExtension()]||i.XHR_RESPONSE_TYPE.TEXT},i.prototype._determineLoadType=function(){return i._loadTypeMap[this._getExtension()]||i.LOAD_TYPE.XHR},i.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?");-1!==i&&(e=e.substring(0,i)),t=e.substring(e.lastIndexOf(".")+1)}return t},i.prototype._getMimeFromXhrType=function(t){switch(t){case i.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case i.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case i.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case i.XHR_RESPONSE_TYPE.JSON:return"application/json";case i.XHR_RESPONSE_TYPE.DEFAULT:case i.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},i.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},i._loadTypeMap={gif:i.LOAD_TYPE.IMAGE,png:i.LOAD_TYPE.IMAGE,bmp:i.LOAD_TYPE.IMAGE,jpg:i.LOAD_TYPE.IMAGE,jpeg:i.LOAD_TYPE.IMAGE,tif:i.LOAD_TYPE.IMAGE,tiff:i.LOAD_TYPE.IMAGE,webp:i.LOAD_TYPE.IMAGE,tga:i.LOAD_TYPE.IMAGE},i._xhrTypeMap={xhtml:i.XHR_RESPONSE_TYPE.DOCUMENT,html:i.XHR_RESPONSE_TYPE.DOCUMENT,htm:i.XHR_RESPONSE_TYPE.DOCUMENT,xml:i.XHR_RESPONSE_TYPE.DOCUMENT,tmx:i.XHR_RESPONSE_TYPE.DOCUMENT,tsx:i.XHR_RESPONSE_TYPE.DOCUMENT,svg:i.XHR_RESPONSE_TYPE.DOCUMENT,gif:i.XHR_RESPONSE_TYPE.BLOB,png:i.XHR_RESPONSE_TYPE.BLOB,bmp:i.XHR_RESPONSE_TYPE.BLOB,jpg:i.XHR_RESPONSE_TYPE.BLOB,jpeg:i.XHR_RESPONSE_TYPE.BLOB,tif:i.XHR_RESPONSE_TYPE.BLOB,tiff:i.XHR_RESPONSE_TYPE.BLOB,webp:i.XHR_RESPONSE_TYPE.BLOB,tga:i.XHR_RESPONSE_TYPE.BLOB,json:i.XHR_RESPONSE_TYPE.JSON,text:i.XHR_RESPONSE_TYPE.TEXT,txt:i.XHR_RESPONSE_TYPE.TEXT},i.setExtensionLoadType=function(t,e){o(i._loadTypeMap,t,e)},i.setExtensionXhrType=function(t,e){o(i._xhrTypeMap,t,e)}},{eventemitter3:26,url:24}],32:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",i=new Array(4),n=0,o=0,s=0;n>2,i[1]=(3&e[0])<<4|e[1]>>4,i[2]=(15&e[1])<<2|e[2]>>6,i[3]=63&e[2],s=n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o=0;r--)this.updateAccessibleObjects(e[r])}},i.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;othis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},i.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleTitle||t.accessibleHint||(e.title="displayObject "+this.tabIndex),t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},i.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},i.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},i.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},i.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},i.prototype._onMouseMove=function(){this.deactivate()},i.prototype.destroy=function(){this.div=null;for(var t=0;t1)for(var r=0;e>r;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},i.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},i.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(0>r||0>i)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t,this.onChildrenChange(i>r?r:i)}},i.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},i.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);o.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},i.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},i.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;e>r;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(-1===i)return;t.parent=null,o.removeItems(this.children,i,1),this.onChildrenChange(i),t.emit("removed",this)}return t},i.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,o.removeItems(this.children,t,1),this.onChildrenChange(t),e.emit("removed",this),e},i.prototype.removeChildren=function(t,e){var r,i,n=t||0,o="number"==typeof e?e:this.children.length,s=o-n;if(s>0&&o>=s){for(r=this.children.splice(n,s),i=0;it;++t)this.children[t].updateTransform();this._currentBounds=null}},i.prototype.containerUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=0,l=this.children.length;l>u;++u){var c=this.children[u];c.visible&&(t=this.children[u].getBounds(),t!==n.Rectangle.EMPTY&&(h=!0,i=ie?s:e,a=a>r?a:r))}if(!h)return this._currentBounds=n.Rectangle.EMPTY,this._currentBounds;var p=this._bounds;p.x=i,p.y=o,p.width=s-i,p.height=a-o,this._currentBounds=p}return this._currentBounds},i.prototype.containerGetBounds=i.prototype.getBounds,i.prototype.getLocalBounds=function(){var t=this.transform.worldTransform;this.transform.worldTransform=n.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.transform.worldTransform=t,this._currentBounds=null,this.getBounds(n.Matrix.IDENTITY)},i.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},i.prototype._renderWebGL=function(t){},i.prototype._renderCanvas=function(t){},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},i.prototype.destroy=function(t){if(s.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":61,"../utils":108,"./DisplayObject":41}],41:[function(t,e,r){function i(){o.call(this),this.transform=new s,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.filterArea=null,this.hitArea=null,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}var n=t("../math"),o=t("eventemitter3"),s=t("./Transform"),a={worldTransform:new n.Matrix,worldAlpha:1,children:[]};i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},worldTransform:{get:function(){return this.transform.worldTransform}},localTransform:{get:function(){return this.transform.localTransform}},position:{get:function(){return this.transform.position},set:function(t){this.transform.position=t}},scale:{get:function(){return this.transform.scale},set:function(t){this.transform.scale=t}},pivot:{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot=t}},skew:{get:function(){return this.transform.skew},set:function(t){this.transform.skew=t}},rotation:{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.updateTransform=function(){this.transform=this.parent.transform.updateChildTransform(this.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(t){return n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=a,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},i.prototype.toLocal=function(t,e,r){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=a,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t,r)},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.position.x=t||0,this.position.y=e||0,this.scale.x=r?r:1,this.scale.y=i?i:1,this.rotation=n||0,this.skew.x=o||0,this.skew.y=s||0,this.pivot.x=a||0,this.pivot.y=h||0,this},i.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.skew=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../math":61,"./Transform":43,eventemitter3:26}],42:[function(t,e,r){function i(t,e,r,i){this._x=r||0,this._y=i||0,this.cb=t,this.scope=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.cb.call(this.scope)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.cb.call(this.scope)}}}),i.prototype.set=function(t,e){this._x=t||0,this._y=e||(0!==e?this._x:0),this.transform._versionLocal++}},{}],43:[function(t,e,r){function i(){this.worldTransform=new n.Matrix,this.localTransform=new n.Matrix,this.position=new n.Point(0),this.scale=new n.Point(1,1),this.skew=new o(this.updateSkew,this,0,0),this.pivot=new n.Point(0),this._rotation=0,this._sr=Math.sin(0),this._cr=Math.cos(0),this._cy=Math.cos(0),this._sy=Math.sin(0),this._nsx=Math.sin(0),this._cx=Math.cos(0),this._dirty=!1,this.updated=!0}var n=t("../math"),o=t("./ObservablePoint");i.prototype.constructor=i,i.prototype.updateSkew=function(){this._cy=Math.cos(this.skew.y),this._sy=Math.sin(this.skew.y),this._nsx=Math.sin(this.skew.x),this._cx=Math.cos(this.skew.x)},i.prototype.updateTransform=function(t){var e,r,i,n,o=t.worldTransform,s=this.worldTransform,a=this.localTransform;e=this._cr*this.scale.x,r=this._sr*this.scale.x,i=-this._sr*this.scale.y,n=this._cr*this.scale.y,a.a=this._cy*e+this._sy*i,a.b=this._cy*r+this._sy*n,a.c=this._nsx*e+this._cx*i,a.d=this._nsx*r+this._cx*n,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),s.a=a.a*o.a+a.b*o.c,s.b=a.a*o.b+a.b*o.d,s.c=a.c*o.a+a.d*o.c,s.d=a.c*o.b+a.d*o.d,s.tx=a.tx*o.a+a.ty*o.c+o.tx,s.ty=a.tx*o.b+a.ty*o.d+o.ty},i.prototype.updateChildTransform=function(t){return t.updateTransform(this),t},Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this._sr=Math.sin(t),this._cr=Math.cos(t)}}}),e.exports=i},{"../math":61,"./ObservablePoint":42}],44:[function(t,e,r){function i(){this.worldTransform=new n.Matrix,this.localTransform=new n.Matrix,this.position=new o(this,0),this.scale=new o(this,1,1),this.pivot=new o(this,0),this.skew=new o(this,0),this._rotation=0,this._sr=Math.sin(0),this._cr=Math.cos(0),this._dirtyLocal=0,this._versionLocal=0,this._versionGlobal=0}var n=t("../math"),o=t("./ObservablePoint");i.prototype.constructor=i,i.prototype.updateTransform=function(t){var e=t.worldTransform,r=this.worldTransform,i=this.localTransform;this._dirtyLocal!==this._versionLocal&&(i.a=this._cr*this.scale._x,i.b=this._sr*this.scale._x,i.c=-this._sr*this.scale._y,i.d=this._cr*this.scale._y,i.tx=this.position._x-(this.pivot._x*i.a+this.pivot._y*i.c),i.ty=this.position._y-(this.pivot._x*i.b+this.pivot._y*i.d),this._dirtyLocal=this._versionLocal),r.a=i.a*e.a+i.b*e.c,r.b=i.a*e.b+i.b*e.d,r.c=i.c*e.a+i.d*e.c,r.d=i.c*e.b+i.d*e.d,r.tx=i.tx*e.a+i.ty*e.c+e.tx,r.ty=i.tx*e.b+i.ty*e.d+e.ty,this._versionGlobal++,this.updated=!0},i.prototype.updateChildTransform=function(t){return t.updateTransform(this),t},Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this._sr=Math.sin(t),this._cr=Math.cos(t)}}}),e.exports=i},{"../math":61,"./ObservablePoint":42}],45:[function(t,e,r){function i(){o.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=c.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1,this._spriteRect=null,this._fastRect=!1}var n,o=t("../display/Container"),s=t("../textures/RenderTexture"),a=t("../textures/Texture"),h=t("./GraphicsData"),u=t("../sprites/Sprite"),l=t("../math"),c=t("../const"),p=t("./utils/bezierCurveTo"),d=t("../renderers/canvas/CanvasRenderer"),f=new l.Matrix,v=new l.Point; + i._SPRITE_TEXTURE=null,i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){var t=new i;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)l=c/s,n=h+(t-h)*l,o=u+(e-u)*l,a.push(n+(t+(r-t)*l-n)*l,o+(e+(i-e)*l-o)*l);return this.dirty=this.boundsDirty=!0,this},i.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,a=s[s.length-2],h=s[s.length-1];return s.length-=2,p(a,h,t,e,r,i,n,o,s),this.dirty=this.boundsDirty=!0,this},i.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,u=s-t,l=i-e,c=r-t,p=Math.abs(h*c-u*l);if(1e-8>p||0===n)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var d=h*h+u*u,f=l*l+c*c,v=h*l+u*c,g=n*Math.sqrt(d)/p,y=n*Math.sqrt(f)/p,x=g*v/d,m=y*v/f,T=g*c+y*u,b=g*l+y*h,_=u*(y+x),w=h*(y+x),E=c*(g+m),S=l*(g+m),C=Math.atan2(w-b,_-T),M=Math.atan2(S-b,E-T);this.arc(T+t,b+e,n,C,M,u*l>c*h)}return this.dirty=this.boundsDirty=!0,this},i.prototype.arc=function(t,e,r,i,n,o){if(o=o||!1,i===n)return this;!o&&i>=n?n+=2*Math.PI:o&&n>=i&&(i+=2*Math.PI);var s=o?-1*(i-n):n-i,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(i)*r,u=e+Math.sin(i)*r;this.currentPath?this.currentPath.shape.points.push(h,u):this.moveTo(h,u);for(var l=this.currentPath.shape.points,c=s/(2*a),p=2*c,d=Math.cos(c),f=Math.sin(c),v=a-1,g=v%1/v,y=0;v>=y;y++){var x=y+g*y,m=c+i+p*x,T=Math.cos(m),b=-Math.sin(m);l.push((d*T+f*b)*r+t,(d*-b+f*T)*r+e)}return this.dirty=this.boundsDirty=!0,this},i.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.prototype.drawRect=function(t,e,r,i){return this.drawShape(new l.Rectangle(t,e,r,i)),this},i.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new l.RoundedRectangle(t,e,r,i,n)),this},i.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},i.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new l.Ellipse(t,e,r,i)),this},i.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof l.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;ig?g:E,E=E>x?x:E,E=E>T?T:E,S=S>y?y:S,S=S>m?m:S,S=S>b?b:S,_=g>_?g:_,_=x>_?x:_,_=T>_?T:_,w=y>w?y:w,w=m>w?m:w,w=b>w?b:w,this._bounds.x=E,this._bounds.width=_-E,this._bounds.y=S,this._bounds.height=w-S,this._currentBounds=this._bounds}return this._currentBounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,v);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,i=a+u>i?a+u:i;else if(d===c.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,u=n.radius+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else if(d===c.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,u=n.height+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else{o=n.points;for(var v=0;vs-f?s-f:t,e=s+f>e?s+f:e,r=r>a-f?a-f:r,i=a+f>i?a+f:i}}else t=0,e=0,r=0,i=0;var g=this.boundsPadding;this._localBounds.x=t-g,this._localBounds.width=e-t+2*g,this._localBounds.y=r-g,this._localBounds.height=i-r+2*g},i.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===c.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},i.prototype.generateCanvasTexture=function(t,e){e=e||1;var r=this.getLocalBounds(),i=new s.create(r.width*e,r.height*e);n||(n=new d),f.tx=-r.x,f.ty=-r.y,n.render(this,i,!1,f);var o=a.fromCanvas(i.baseTexture._canvasRenderTarget.canvas,t);return o.baseTexture.resolution=e,o},i.prototype.destroy=function(){o.prototype.destroy.apply(this,arguments);for(var t=0;tO?O:A,r.beginPath(),r.moveTo(S,C+A),r.lineTo(S,C+R-A),r.quadraticCurveTo(S,C+R,S+A,C+R),r.lineTo(S+M-A,C+R),r.quadraticCurveTo(S+M,C+R,S+M,C+R-A),r.lineTo(S+M,C+A),r.quadraticCurveTo(S+M,C,S+M-A,C),r.lineTo(S+A,C),r.quadraticCurveTo(S,C,S,C+A),r.closePath(),(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}}},i.prototype.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}},i.prototype.destroy=function(){this.renderer=null}},{"../../const":39,"../../renderers/canvas/CanvasRenderer":68}],48:[function(t,e,r){var i=function(t,e,r,i,n,o,s,a,h){h=h||[];var u,l,c,p,d,f=20;h.push(t,e);for(var v=0,g=1;f>=g;++g)v=g/f,u=1-v,l=u*u,c=l*u,p=v*v,d=p*v,h.push(c*t+3*l*v*r+3*u*p*n+d*s,c*e+3*l*v*i+3*u*p*o+d*a);return h};e.exports=i},{}],49:[function(t,e,r){function i(t){s.call(this,t),this.graphicsDataPool=[],this.primitiveShader=null,this.gl=t.gl,this.CONTEXT_UID=0}var n=t("../../utils"),o=t("../../const"),s=t("../../renderers/webgl/utils/ObjectRenderer"),a=t("../../renderers/webgl/WebGLRenderer"),h=t("./WebGLGraphicsData"),u=t("./shaders/PrimitiveShader"),l=t("./utils/buildPoly"),c=t("./utils/buildRectangle"),p=t("./utils/buildRoundedRectangle"),d=t("./utils/buildCircle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,a.registerPlugin("graphics",i),i.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new u(this.gl)},i.prototype.destroy=function(){s.prototype.destroy.call(this);for(var t=0;ta;a++){e=o.data[a];var u=e.shader;r.bindShader(u),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.tint=n.hex2rgb(t.tint),u.uniforms.alpha=t.worldAlpha,e.vao.bind().draw(i.TRIANGLE_STRIP,e.indices.length).unbind()}},i.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[this.CONTEXT_UID];r||(r=t._webGL[this.CONTEXT_UID]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i32e4)&&(r=this.graphicsDataPool.pop()||new h(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState),r.reset(e),t.data.push(r)),r.dirty=!0,r}},{"../../const":39,"../../renderers/webgl/WebGLRenderer":75,"../../renderers/webgl/utils/ObjectRenderer":85,"../../utils":108,"./WebGLGraphicsData":50,"./shaders/PrimitiveShader":51,"./utils/buildCircle":52,"./utils/buildPoly":54,"./utils/buildRectangle":55,"./utils/buildRoundedRectangle":56}],50:[function(t,e,r){function i(t,e,r){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=n.GLBuffer.createVertexBuffer(t),this.indexBuffer=n.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.glPoints=null,this.glIndices=null,this.shader=e,this.vao=new n.VertexArrayObject(t,r).addIndex(this.indexBuffer).addAttribute(this.buffer,e.attributes.aVertexPosition,t.FLOAT,!1,24,0).addAttribute(this.buffer,e.attributes.aColor,t.FLOAT,!1,24,8)}var n=t("pixi-gl-core");i.prototype.constructor=i,e.exports=i,i.prototype.reset=function(){this.points.length=0,this.indices.length=0},i.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},i.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{"pixi-gl-core":1}],51:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],52:[function(t,e,r){var i=t("./buildLine"),n=t("../../../const"),o=t("../../../utils"),s=function(t,e){var r,s,a=t.shape,h=a.x,u=a.y;t.type===n.SHAPES.CIRC?(r=a.radius,s=a.radius):(r=a.width,s=a.height);var l=Math.floor(30*Math.sqrt(a.radius))||Math.floor(15*Math.sqrt(a.width+a.height)),c=2*Math.PI/l,p=0;if(t.fill){var d=o.hex2rgb(t.fillColor),f=t.fillAlpha,v=d[0]*f,g=d[1]*f,y=d[2]*f,x=e.points,m=e.indices,T=x.length/6;for(m.push(T),p=0;l+1>p;p++)x.push(h,u,v,g,y,f),x.push(h+Math.sin(c*p)*r,u+Math.cos(c*p)*s,v,g,y,f),m.push(T++,T++);m.push(T-1)}if(t.lineWidth){var b=t.points;for(t.points=[],p=0;l+1>p;p++)t.points.push(h+Math.sin(c*p)*r,u+Math.cos(c*p)*s);i(t,e),t.points=b}};e.exports=s},{"../../../const":39,"../../../utils":108,"./buildLine":53}],53:[function(t,e,r){var i=t("../../../math"),n=t("../../../utils"),o=function(t,e){var r=0,o=t.points;if(0!==o.length){var s=new i.Point(o[0],o[1]),a=new i.Point(o[o.length-2],o[o.length-1]);if(s.x===a.x&&s.y===a.y){o=o.slice(),o.pop(),o.pop(),a=new i.Point(o[o.length-2],o[o.length-1]);var h=a.x+.5*(s.x-a.x),u=a.y+.5*(s.y-a.y);o.unshift(h,u),o.push(h,u)}var l,c,p,d,f,v,g,y,x,m,T,b,_,w,E,S,C,M,R,A,O,P,D,L=e.points,I=e.indices,B=o.length/2,F=o.length,N=L.length/6,k=t.lineWidth/2,U=n.hex2rgb(t.lineColor),j=t.lineAlpha,G=U[0]*j,X=U[1]*j,W=U[2]*j;for(p=o[0],d=o[1],f=o[2],v=o[3],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,L.push(p-x,d-m,G,X,W,j),L.push(p+x,d+m,G,X,W,j),r=1;B-1>r;r++)p=o[2*(r-1)],d=o[2*(r-1)+1],f=o[2*r],v=o[2*r+1],g=o[2*(r+1)],y=o[2*(r+1)+1],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,T=-(v-y),b=f-g,D=Math.sqrt(T*T+b*b),T/=D,b/=D,T*=k,b*=k,E=-m+d-(-m+v),S=-x+f-(-x+p),C=(-x+p)*(-m+v)-(-x+f)*(-m+d),M=-b+y-(-b+v),R=-T+f-(-T+g),A=(-T+g)*(-b+v)-(-T+f)*(-b+y),O=E*R-M*S,Math.abs(O)<.1?(O+=10.1,L.push(f-x,v-m,G,X,W,j),L.push(f+x,v+m,G,X,W,j)):(l=(S*A-R*C)/O,c=(M*C-E*A)/O,P=(l-f)*(l-f)+(c-v)*(c-v),P>19600?(_=x-T,w=m-b,D=Math.sqrt(_*_+w*w),_/=D,w/=D,_*=k,w*=k,L.push(f-_,v-w),L.push(G,X,W,j),L.push(f+_,v+w),L.push(G,X,W,j),L.push(f-_,v-w),L.push(G,X,W,j),F++):(L.push(l,c),L.push(G,X,W,j),L.push(f-(l-f),v-(c-v)),L.push(G,X,W,j)));for(p=o[2*(B-2)],d=o[2*(B-2)+1],f=o[2*(B-1)],v=o[2*(B-1)+1],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,L.push(f-x,v-m),L.push(G,X,W,j),L.push(f+x,v+m),L.push(G,X,W,j),I.push(N),r=0;F>r;r++)I.push(N++);I.push(N-1)}};e.exports=o},{"../../../math":61,"../../../utils":108}],54:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=t("earcut"),s=function(t,e){t.points=t.shape.points.slice();var r=t.points;if(t.shape.closed&&(r[0]===r[r.length-2]&&r[1]===r[r.length-1]||r.push(r[0],r[1])),t.fill&&r.length>6){var s=e.points,a=e.indices,h=r.length/2,u=n.hex2rgb(t.fillColor),l=t.fillAlpha,c=u[0]*l,p=u[1]*l,d=u[2]*l,f=o(r,null,2);if(!f)return;var v=s.length/6,g=0;for(g=0;gg;g++)s.push(r[2*g],r[2*g+1],c,p,d,l)}t.lineWidth>0&&i(t,e)};e.exports=s},{"../../../utils":108,"./buildLine":53,earcut:25}],55:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=function(t,e){var r=t.shape,o=r.x,s=r.y,a=r.width,h=r.height;if(t.fill){var u=n.hex2rgb(t.fillColor),l=t.fillAlpha,c=u[0]*l,p=u[1]*l,d=u[2]*l,f=e.points,v=e.indices,g=f.length/6;f.push(o,s),f.push(c,p,d,l),f.push(o+a,s),f.push(c,p,d,l),f.push(o,s+h),f.push(c,p,d,l),f.push(o+a,s+h),f.push(c,p,d,l),v.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var y=t.points;t.points=[o,s,o+a,s,o+a,s+h,o,s+h,o,s],i(t,e),t.points=y}};e.exports=o},{"../../../utils":108,"./buildLine":53}],56:[function(t,e,r){var i=t("earcut"),n=t("./buildLine"),o=t("../../../utils"),s=function(t,e){var r=t.shape,s=r.x,h=r.y,u=r.width,l=r.height,c=r.radius,p=[];if(p.push(s,h+c),a(s,h+l-c,s,h+l,s+c,h+l,p),a(s+u-c,h+l,s+u,h+l,s+u,h+l-c,p),a(s+u,h+c,s+u,h,s+u-c,h,p),a(s+c,h,s,h,s,h+c+1e-10,p),t.fill){var d=o.hex2rgb(t.fillColor),f=t.fillAlpha,v=d[0]*f,g=d[1]*f,y=d[2]*f,x=e.points,m=e.indices,T=x.length/6,b=i(p,null,2),_=0;for(_=0;_=y;y++)g=y/f,h=a(t,r,g),u=a(e,i,g),l=a(r,n,g),c=a(i,o,g),p=a(h,l,g),d=a(u,c,g),v.push(p,d);return v};e.exports=s},{"../../../utils":108,"./buildLine":53,earcut:25}],57:[function(t,e,r){var i=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Transform:t("./display/Transform"),TransformStatic:t("./display/TransformStatic"),Sprite:t("./sprites/Sprite"),CanvasSpriteRender:t("./sprites/canvas/CanvasSpriteRenderer"),CanvasTinter:t("./sprites/canvas/CanvasTinter"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),CanvasGraphicsRenderer:t("./graphics/canvas/CanvasGraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),BaseRenderTexture:t("./textures/BaseRenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasRenderTarget:t("./renderers/canvas/utils/CanvasRenderTarget"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),WebGLManager:t("./renderers/webgl/managers/WebGLManager"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),Quad:t("./renderers/webgl/utils/Quad"),SpriteMaskFilter:t("./renderers/webgl/filters/spriteMask/SpriteMaskFilter"),Filter:t("./renderers/webgl/filters/Filter"),glCore:t("pixi-gl-core"),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},{"./const":39,"./display/Container":40,"./display/DisplayObject":41,"./display/Transform":43,"./display/TransformStatic":44,"./graphics/Graphics":45,"./graphics/GraphicsData":46,"./graphics/canvas/CanvasGraphicsRenderer":47,"./graphics/webgl/GraphicsRenderer":49,"./math":61,"./renderers/canvas/CanvasRenderer":68,"./renderers/canvas/utils/CanvasRenderTarget":70,"./renderers/webgl/WebGLRenderer":75,"./renderers/webgl/filters/Filter":77,"./renderers/webgl/filters/spriteMask/SpriteMaskFilter":80,"./renderers/webgl/managers/WebGLManager":84,"./renderers/webgl/utils/ObjectRenderer":85,"./renderers/webgl/utils/Quad":86,"./renderers/webgl/utils/RenderTarget":87,"./sprites/Sprite":91,"./sprites/canvas/CanvasSpriteRenderer":92,"./sprites/canvas/CanvasTinter":93,"./sprites/webgl/SpriteRenderer":95,"./text/Text":97,"./textures/BaseRenderTexture":98,"./textures/BaseTexture":99,"./textures/RenderTexture":100,"./textures/Texture":101,"./textures/TextureUvs":102,"./textures/VideoBaseTexture":103,"./ticker":105,"./utils":108,"pixi-gl-core":1}],58:[function(t,e,r){function i(t){return 0>t?-1:t>0?1:0}function n(){for(var t=0;16>t;t++){var e=[];c.push(e);for(var r=0;16>r;r++)for(var n=i(o[t]*o[r]+a[t]*s[r]),p=i(s[t]*o[r]+h[t]*s[r]),d=i(o[t]*a[r]+a[t]*h[r]),f=i(s[t]*a[r]+h[t]*h[r]),v=0;16>v;v++)if(o[v]===n&&s[v]===p&&a[v]===d&&h[v]===f){e.push(v);break}}for(t=0;16>t;t++){var g=new l;g.set(o[t],s[t],a[t],h[t],0,0),u.push(g)}}var o=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=t("./Matrix"),c=[];n();var p={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return c[t][e]},sub:function(t,e){return c[t][p.inv(e)]},rotate180:function(t){return 4^t},isSwapWidthHeight:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?p.S:p.N:2*Math.abs(e)<=Math.abs(t)?t>0?p.E:p.W:e>0?t>0?p.SE:p.SW:t>0?p.NE:p.NW},matrixAppendRotationInv:function(t,e,r,i){var n=u[p.inv(e)];r=r||0,i=i||0,n.tx=r,n.ty=i,t.append(n)}};e.exports=p},{"./Matrix":59}],59:[function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=t("./Point");i.prototype.constructor=i,e.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*r*i+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){var u,l,c,p,d,f,v,g,y,x;return d=Math.sin(s),f=Math.cos(s),v=Math.cos(h),g=Math.sin(h),y=-Math.sin(a),x=Math.cos(a),u=f*n,l=d*n,c=-d*o,p=f*o,this.a=v*u+g*c,this.b=v*l+g*p,this.c=y*u+x*c,this.d=y*l+x*p,this.tx=t+(r*u+i*c),this.ty=e+(r*l+i*p),this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},{"./Point":60}],60:[function(t,e,r){function i(t,e){this.x=t||0,this.y=e||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y)},i.prototype.copy=function(t){this.set(t.x,t.y)},i.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},i.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],61:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),GroupD8:t("./GroupD8"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./GroupD8":58,"./Matrix":59,"./Point":60,"./shapes/Circle":62,"./shapes/Ellipse":63,"./shapes/Polygon":64,"./shapes/Rectangle":65,"./shapes/RoundedRectangle":66}],62:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":39,"./Rectangle":65}],63:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=o.SHAPES.ELIP}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":39,"./Rectangle":65}],64:[function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)i.push(e[s].x,e[s].y);e=i}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var n=t("../Point"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;i>n;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1],l=a>e!=u>e&&(h-s)*(e-a)/(u-a)+s>t;l&&(r=!r)}return r}},{"../../const":39,"../Point":60}],65:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.x+t.width&&(this.width=t.width-this.x,this.width<0&&(this.width=0)),this.y+this.height>t.y+t.height&&(this.height=t.height-this.y,this.height<0&&(this.height=0))},i.prototype.enlarge=function(t){if(t!==i.EMPTY){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=r-e,this.y=n,this.height=o-n}}},{"../../const":39}],66:[function(t,e,r){function i(t,e,r,i,o){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.radius=o||20,this.type=n.SHAPES.RREC}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius); +},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}},{"../../const":39}],67:[function(t,e,r){function i(t,e,r,i){if(u.call(this),n.sayHello(t),i)for(var o in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof i[o]&&(i[o]=s.DEFAULT_RENDER_OPTIONS[o]);else i=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution,this.transparent=i.transparent,this.autoResize=i.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this.roundPixels=i.roundPixels,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new a,this._lastObjectRendered=this._tempDisplayObjectParent}var n=t("../utils"),o=t("../math"),s=t("../const"),a=t("../display/Container"),h=t("../textures/RenderTexture"),u=t("eventemitter3"),l=new o.Matrix;i.prototype=Object.create(u.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgba)}}}),i.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},i.prototype.generateTexture=function(t,e,r){var i=t.getLocalBounds(),n=h.create(0|i.width,0|i.height,e,r);return l.tx=-i.x,l.ty=-i.y,this.render(t,n,!1,l,!0),n},i.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this.backgroundColor=0,this._tempDisplayObjectParent=null,this._lastObjectRendered=null}},{"../const":39,"../display/Container":40,"../math":61,"../textures/RenderTexture":100,"../utils":108,eventemitter3:26}],68:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"Canvas",t,e,r),this.type=u.RENDERER_TYPE.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.rootResolution=this.resolution,this.refresh=!0,this.maskManager=new o(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this.blendModes=a(),this._activeBlendMode=null,this.context=null,this.renderingToScreen=!1,this.resize(t,e)}var n=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("./utils/CanvasRenderTarget"),a=t("./utils/mapCanvasBlendModesToPixi"),h=t("../../utils"),u=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,h.pluginTarget.mixin(i),i.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender"),e?(e=e.baseTexture||e,e._canvasRenderTarget||(e._canvasRenderTarget=new s(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):(this.context=this.rootContext,this.resolution=this.rootResolution);var o=this.context;if(this._lastObjectRendered=t,!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?i.copy(h):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}o.setTransform(1,0,0,1,0,0),o.globalAlpha=1,o.globalCompositeOperation=this.blendModes[u.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(o.fillStyle="black",o.clear()),(r||this.clearBeforeRender)&&(this.transparent?o.clearRect(0,0,this.width,this.height):(o.fillStyle=this._backgroundColorString,o.fillRect(0,0,this.width,this.height)));var l=this.context;this.context=o,t.renderCanvas(this),this.context=l,this.emit("postrender")}},i.prototype.setBlendMode=function(t){this._activeBlendMode!==t&&(this.context.globalCompositeOperation=this.blendModes[t])},i.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.rootContext[this.smoothProperty]=u.SCALE_MODES.DEFAULT===u.SCALE_MODES.LINEAR)}},{"../../const":39,"../../utils":108,"../SystemRenderer":67,"./utils/CanvasMaskManager":69,"./utils/CanvasRenderTarget":70,"./utils/mapCanvasBlendModesToPixi":72}],69:[function(t,e,r){function i(t){this.renderer=t}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var r=t.alpha,i=t.transform.worldTransform,n=e.resolution;e.context.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=r},i.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hS?S:E,e.moveTo(T,b+E),e.lineTo(T,b+w-E),e.quadraticCurveTo(T,b+w,T+E,b+w),e.lineTo(T+_-E,b+w),e.quadraticCurveTo(T+_,b+w,T+_,b+w-E),e.lineTo(T+_,b+E),e.quadraticCurveTo(T+_,b,T+_-E,b),e.lineTo(T+E,b),e.quadraticCurveTo(T,b,T,b+E),e.closePath()}}}},i.prototype.popMask=function(t){t.context.restore()},i.prototype.destroy=function(){}},{"../../../const":39}],70:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||n.RESOLUTION,this.resize(t,e)}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),i.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},i.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},i.prototype.destroy=function(){this.context=null,this.canvas=null}},{"../../../const":39}],71:[function(t,e,r){var i=function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]};e.exports=i},{}],72:[function(t,e,r){function i(t){return t=t||[],o()?(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="multiply",t[n.BLEND_MODES.SCREEN]="screen",t[n.BLEND_MODES.OVERLAY]="overlay",t[n.BLEND_MODES.DARKEN]="darken",t[n.BLEND_MODES.LIGHTEN]="lighten",t[n.BLEND_MODES.COLOR_DODGE]="color-dodge",t[n.BLEND_MODES.COLOR_BURN]="color-burn",t[n.BLEND_MODES.HARD_LIGHT]="hard-light",t[n.BLEND_MODES.SOFT_LIGHT]="soft-light",t[n.BLEND_MODES.DIFFERENCE]="difference",t[n.BLEND_MODES.EXCLUSION]="exclusion",t[n.BLEND_MODES.HUE]="hue",t[n.BLEND_MODES.SATURATION]="saturate",t[n.BLEND_MODES.COLOR]="color",t[n.BLEND_MODES.LUMINOSITY]="luminosity"):(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="source-over",t[n.BLEND_MODES.SCREEN]="source-over",t[n.BLEND_MODES.OVERLAY]="source-over",t[n.BLEND_MODES.DARKEN]="source-over",t[n.BLEND_MODES.LIGHTEN]="source-over",t[n.BLEND_MODES.COLOR_DODGE]="source-over",t[n.BLEND_MODES.COLOR_BURN]="source-over",t[n.BLEND_MODES.HARD_LIGHT]="source-over",t[n.BLEND_MODES.SOFT_LIGHT]="source-over",t[n.BLEND_MODES.DIFFERENCE]="source-over",t[n.BLEND_MODES.EXCLUSION]="source-over",t[n.BLEND_MODES.HUE]="source-over",t[n.BLEND_MODES.SATURATION]="source-over",t[n.BLEND_MODES.COLOR]="source-over",t[n.BLEND_MODES.LUMINOSITY]="source-over"),t}var n=t("../../../const"),o=t("./canUseNewCanvasBlendModes");e.exports=i},{"../../../const":39,"./canUseNewCanvasBlendModes":71}],73:[function(t,e,r){function i(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=3600,this.checkCountMax=600,this.mode=n.GC_MODES.DEFAULT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.count++,this.mode!==n.GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},i.prototype.run=function(){var t,e,r=this.renderer.textureManager,i=r._managedTextures,n=!1;for(t=0;tthis.maxIdle&&(r.destroyTexture(o,!0),i[t]=null,n=!0)}if(n){for(e=0,t=0;t=0;r--)this.unload(t.children[r])}},{"../../const":39}],74:[function(t,e,r){var i=t("pixi-gl-core").GLTexture,n=t("../../const"),o=t("./utils/RenderTarget"),s=t("../../utils"),a=function(t){this.renderer=t,this.gl=t.gl,this._managedTextures=[]};a.prototype.bindTexture=function(){},a.prototype.getTexture=function(){},a.prototype.updateTexture=function(t){t=t.baseTexture||t;var e=!!t._glRenderTargets;if(t.hasLoaded){var r=t._glTextures[this.renderer.CONTEXT_UID];if(r)e?t._glRenderTargets[this.renderer.CONTEXT_UID].resize(t.width,t.height):r.upload(t.source);else{if(e){var s=new o(this.gl,t.width,t.height,t.scaleMode,t.resolution);s.resize(t.width,t.height),t._glRenderTargets[this.renderer.CONTEXT_UID]=s,r=s.texture}else r=new i(this.gl),r.premultiplyAlpha=!0,r.upload(t.source);t._glTextures[this.renderer.CONTEXT_UID]=r,t.on("update",this.updateTexture,this),t.on("dispose",this.destroyTexture,this),this._managedTextures.push(t),t.isPowerOfTwo?(t.mipmap&&r.enableMipmap(),t.wrapMode===n.WRAP_MODES.CLAMP?r.enableWrapClamp():t.wrapMode===n.WRAP_MODES.REPEAT?r.enableWrapRepeat():r.enableWrapMirrorRepeat()):r.enableWrapClamp(),t.scaleMode===n.SCALE_MODES.NEAREST?r.enableNearestScaling():r.enableLinearScaling()}return r}},a.prototype.destroyTexture=function(t,e){if(t=t.baseTexture||t,t.hasLoaded&&t._glTextures[this.renderer.CONTEXT_UID]&&(t._glTextures[this.renderer.CONTEXT_UID].destroy(),t.off("update",this.updateTexture,this),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.renderer.CONTEXT_UID],!e)){var r=this._managedTextures.indexOf(t);-1!==r&&s.removeItems(this._managedTextures,r,1)}},a.prototype.removeAll=function(){for(var t=0;t 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")},{"../../../utils":108,"./extractUniformsFromSrc":78}],78:[function(t,e,r){function i(t,e,r){var i=n(t,r),o=n(e,r);return Object.assign(i,o)}function n(t){for(var e,r=new RegExp("^(projectionMatrix|uSampler|filterArea)$"),i={},n=t.replace(/\s+/g," ").split(/\s*;\s*/),a=0;a-1){var u=h.split(" "),l=u[1],c=u[2],p=s(l);c.indexOf("[")>-1&&(e=c.split(/\[|\]/),c=e[0],p*=Number(e[1])),c.match(r)||(i[c]={value:o(l,p),name:c,type:l})}}return i}var o=t("pixi-gl-core/lib/shader/defaultValue"),s=t("pixi-gl-core/lib/shader/mapSize");e.exports=i},{"pixi-gl-core/lib/shader/defaultValue":10,"pixi-gl-core/lib/shader/mapSize":14}],79:[function(t,e,r){var i=t("../../../math"),n=function(t,e,r){var i=t.identity();return i.translate(e.x/r.width,e.y/r.height),i.scale(r.width,r.height),i},o=function(t,e,r){var i={width:800,height:600},n=t.identity(),o=r.height/r.width;n.translate(e.x/r.width,e.y/r.height),n.scale(1,o);var s=r.width/i.width,a=r.height/i.height;return n.scale(1,1/o),n.scale(s,a),n},s=function(t,e,r,n){var o=n.worldTransform.copy(i.Matrix.TEMP_MATRIX),s=n._texture.baseTexture,a=t.identity(),h=r.height/r.width;a.translate(e.x/r.width,e.y/r.height),a.scale(1,h);var u=r.width/s.width,l=r.height/s.height;return o.tx/=s.width*u,o.ty/=s.width*u,o.invert(),a.prepend(o),a.scale(1,1/h),a.scale(u,l),a.translate(n.anchor.x,n.anchor.y),a};e.exports={calculateScreenSpaceMatrix:n,calculateNormalisedScreenSpaceMatrix:o,calculateSpriteMatrix:s}},{"../../../math":61}],80:[function(t,e,r){function i(t){var e=new o.Matrix;n.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","precision lowp float;\n#define GLSLIFY 1\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n"),t.renderable=!1,this.maskSprite=t,this.maskMatrix=e}var n=t("../Filter"),o=t("../../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=this.maskSprite;this.uniforms.mask=i._texture,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,i),this.uniforms.alpha=i.worldAlpha,t.applyFilter(this,e,r)}},{"../../../../math":61,"../Filter":77}],81:[function(t,e,r){function i(t){n.call(this,t),this.gl=this.renderer.gl,this.quad=new s(this.gl,t.state.attribState);var e=new c;e.sourceFrame=e.destinationFrame=this.renderer.rootRenderTarget.size,e.renderTarget=t.rootRenderTarget,this.stack=[e],this.stackIndex=0,this.shaderCache={}}var n=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../utils/Quad"),a=t("../../../math"),h=t("pixi-gl-core").GLShader,u=t("../filters/filterTransforms"),l=t("bit-twiddle"),c=function(){this.renderTarget=null,this.sourceFrame=new a.Rectangle,this.destinationFrame=new a.Rectangle,this.filters=[],this.target=null,this.resolution=1};i.pool={},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.pushFilter=function(t,e){var r=this.renderer,n=this.stack[++this.stackIndex];n||(n=this.stack[this.stackIndex]=new c);var o=e[0].resolution,s=e[0].padding,a=t.filterArea||t.getBounds(),h=n.sourceFrame,u=n.destinationFrame;h.x=((a.x+s)*o|0)/o,h.y=((a.y+s)*o|0)/o,h.width=((a.width+2*s)*o|0)/o,h.height=((a.height+2*s)*o|0)/o,h.fit(this.stack[0].destinationFrame),u.width=h.width,u.height=h.height;var l=i.getPotRenderTarget(r.gl,h.width,h.height,o);n.target=t,n.filters=e,n.resolution=o,n.renderTarget=l,l.setFrame(u,h),r.bindRenderTarget(l),r.clear()},i.prototype.popFilter=function(){var t=this.stack[this.stackIndex-1],e=this.stack[this.stackIndex];this.quad.map(e.renderTarget.size,e.sourceFrame).upload();var r=e.filters;if(1===r.length)r[0].apply(this,e.renderTarget,t.renderTarget,!1),i.freePotRenderTarget(e.renderTarget);else{var n=e.renderTarget,o=i.getPotRenderTarget(this.renderer.gl,e.sourceFrame.width,e.sourceFrame.height,1);o.setFrame(e.destinationFrame,e.sourceFrame);for(var s=0;sr;r++)this.interleaved[4*r]=this.vertices[2*r],this.interleaved[4*r+1]=this.vertices[2*r+1],this.interleaved[4*r+2]=this.uvs[2*r],this.interleaved[4*r+3]=this.uvs[2*r+1];this.indices=o(1),this.vertexBuffer=n.GLBuffer.createVertexBuffer(t,this.interleaved,t.STATIC_DRAW),this.indexBuffer=n.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW),this.vao=new n.VertexArrayObject(t,e)}var n=t("pixi-gl-core"),o=t("../../../utils/createIndicesForQuads");i.prototype.constructor=i,i.prototype.initVao=function(t){this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer,t.attributes.aVertexPosition,this.gl.FLOAT,!1,16,0).addAttribute(this.vertexBuffer,t.attributes.aTextureCoord,this.gl.FLOAT,!1,16,8)},i.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this},i.prototype.draw=function(){return this.vao.bind().draw(this.gl.TRIANGLES,6,0).unbind(),this},i.prototype.upload=function(){for(var t=0;4>t;t++)this.interleaved[4*t]=this.vertices[2*t],this.interleaved[4*t+1]=this.vertices[2*t+1],this.interleaved[4*t+2]=this.uvs[2*t],this.interleaved[4*t+3]=this.uvs[2*t+1];return this.vertexBuffer.upload(this.interleaved),this},i.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},e.exports=i},{"../../../utils/createIndicesForQuads":106,"pixi-gl-core":1}],87:[function(t,e,r){var i=t("../../../math"),n=t("../../../const"),o=t("pixi-gl-core").GLFramebuffer,s=function(t,e,r,s,a,h){this.gl=t,this.frameBuffer=null,this.texture=null,this.clearColor=[0,0,0,0],this.size=new i.Rectangle(0,0,1,1),this.resolution=a||n.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.defaultFrame=new i.Rectangle,this.destinationFrame=null,this.sourceFrame=null,this.stencilBuffer=null,this.stencilMaskStack=[],this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=s||n.SCALE_MODES.DEFAULT,this.root=h,this.root?(this.frameBuffer=new o(t,100,100),this.frameBuffer.framebuffer=null):(this.frameBuffer=o.createRGBA(t,100,100),this.scaleMode===n.SCALE_MODES.NEAREST?this.frameBuffer.texture.enableNearestScaling():this.frameBuffer.texture.enableLinearScaling(),this.texture=this.frameBuffer.texture),this.setFrame(),this.resize(e,r)};s.prototype.constructor=s,e.exports=s,s.prototype.clear=function(t){var e=t||this.clearColor;this.frameBuffer.clear(e[0],e[1],e[2],e[3])},s.prototype.attachStencilBuffer=function(){this.root||this.frameBuffer.enableStencil()},s.prototype.setFrame=function(t,e){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t},s.prototype.activate=function(){var t=this.gl;this.frameBuffer.bind(),this.calculateProjection(this.destinationFrame,this.sourceFrame),this.transform&&this.projectionMatrix.append(this.transform),this.destinationFrame!==this.sourceFrame?(t.enable(t.SCISSOR_TEST),t.scissor(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)):t.disable(t.SCISSOR_TEST),t.viewport(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)},s.prototype.calculateProjection=function(t,e){var r=this.projectionMatrix;e=e||t,r.identity(),this.root?(r.a=1/t.width*2,r.d=-1/t.height*2,r.tx=-1-e.x*r.a,r.ty=1-e.y*r.d):(r.a=1/t.width*2,r.d=1/t.height*2,r.tx=-1-e.x*r.a,r.ty=-1-e.y*r.d)},s.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){this.size.width=t,this.size.height=e,this.defaultFrame.width=t,this.defaultFrame.height=e,this.frameBuffer.resize(t*this.resolution,e*this.resolution);var r=this.frame||this.size;this.calculateProjection(r)}},s.prototype.destroy=function(){this.frameBuffer.destroy(),this.frameBuffer=null,this.texture=null}},{"../../../const":39,"../../../math":61,"pixi-gl-core":1}],88:[function(t,e,r){function i(t){for(var e="",r=0;t>r;r++)r>0&&(e+="\nelse "),t-1>r&&(e+="if(test == "+r+".0){}");return e}var n=t("pixi-gl-core"),o=["precision lowp float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n"),s=function(t,e){var r=!e;if(r){var s=document.createElement("canvas");s.width=1,s.height=1,e=n.createContext(s)}for(var a=e.createShader(e.FRAGMENT_SHADER);;){var h=o.replace(/\%forloop\%/gi,i(t));if(e.shaderSource(a,h),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))break;t=t/2|0}return r&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").loseContext(),t};e.exports=s},{"pixi-gl-core":1}],89:[function(t,e,r){function i(t,e){return e=e||[],e[n.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA],e[n.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR],e[n.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e}var n=t("../../../const");e.exports=i},{"../../../const":39}],90:[function(t,e,r){function i(t,e){e=e||{},e[n.DRAW_MODES.POINTS]=t.POINTS,e[n.DRAW_MODES.LINES]=t.LINES,e[n.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[n.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[n.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[n.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[n.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN}var n=t("../../../const");e.exports=i},{"../../../const":39}],91:[function(t,e,r){function i(t){s.call(this),this.anchor=new n.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=h.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY,this.textureDirty=!0,this.vertexData=new Float32Array(8)}var n=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../utils"),h=t("../const"),u=new n.Point;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture.orig.width},set:function(t){var e=a.sign(this.scale.x)||1;this.scale.x=e*t/this.texture.orig.width,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this.texture.orig.height},set:function(t){var e=a.sign(this.scale.y)||1;this.scale.y=e*t/this.texture.orig.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,this.textureDirty=!0,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),i.prototype._onTextureUpdate=function(){this.textureDirty=!0,this._width&&(this.scale.x=a.sign(this.scale.x)*this._width/this.texture.orig.width),this._height&&(this.scale.y=a.sign(this.scale.y)*this._height/this.texture.orig.height)},i.prototype.caclulateVertices=function(){var t,e,r,i,n=this._texture,o=this.transform.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,p=this.vertexData,d=n.trim,f=n.orig;d?(e=d.x-this.anchor.x*f.width,t=e+d.width,i=d.y-this.anchor.y*f.height,r=i+d.height):(t=f.width*(1-this.anchor.x),e=f.width*-this.anchor.x,r=f.height*(1-this.anchor.y),i=f.height*-this.anchor.y),p[0]=s*e+h*i+l,p[1]=u*i+a*e+c,p[2]=s*t+h*i+l,p[3]=u*i+a*t+c,p[4]=s*t+h*r+l,p[5]=u*r+a*t+c,p[6]=s*e+h*r+l,p[7]=u*r+a*e+c},i.prototype._renderWebGL=function(t){(this.transform.updated||this.textureDirty)&&(this.textureDirty=!1,this.caclulateVertices()),t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},i.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},i.prototype.getBounds=function(){if(!this._currentBounds){this.vertexDirty=!1,this.caclulateVertices();var t,e,r,i,n,o,s,a,h=this.vertexData,u=h[0],l=h[1],c=h[2],p=h[3],d=h[4],f=h[5],v=h[6],g=h[7];if(t=u,t=t>c?c:t,t=t>d?d:t,t=t>v?v:t,r=l,r=r>p?p:r,r=r>f?f:r,r=r>g?g:r,e=u,e=c>e?c:e,e=d>e?d:e,e=v>e?v:e,i=l,i=p>i?p:i,i=f>i?f:i,i=g>i?g:i,this.children.length){var y=this.containerGetBounds();n=y.x,o=y.x+y.width,s=y.y,a=y.y+y.height,t=n>t?t:n,r=s>r?r:s,e=e>o?e:o,i=i>a?i:a}var x=this._bounds;x.x=t,x.width=e-t,x.y=r,x.height=i-r,this._currentBounds=x}return this._currentBounds},i.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture.orig.width*this.anchor.x,this._bounds.y=-this._texture.orig.height*this.anchor.y,this._bounds.width=this._texture.orig.width,this._bounds.height=this._texture.orig.height,this._bounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e,r=this._texture.orig.width,i=this._texture.orig.height,n=-r*this.anchor.x;return u.x>n&&u.xe&&u.y=this.size&&this.flush(),t.texture._uvs&&(this.sprites[this.currentIndex++]=t)},i.prototype.flush=function(){if(0!==this.currentIndex){var t,e,r,i,n,o,s=this.renderer.gl,a=p.nextPow2(this.currentIndex),h=p.log2(a),u=this.buffers[h],l=this.sprites,d=this.groups,f=u.float32View,v=u.uint32View,g=0,y=1,x=0,m=d[0],T=l[0].blendMode;m.textureCount=0,m.start=0,m.blend=T,this.tick++;for(var b=0;b>16)+(65280&_.tint)+((255&_.tint)<<16)+(255*_.worldAlpha<<24),n=_._texture._uvs.uvsUint32,o=t._id,f[g++]=r[0],f[g++]=r[1],v[g++]=n[0],v[g++]=i,f[g++]=o,f[g++]=r[2],f[g++]=r[3],v[g++]=n[1],v[g++]=i,f[g++]=o,f[g++]=r[4],f[g++]=r[5],v[g++]=n[2],v[g++]=i,f[g++]=o,f[g++]=r[6],f[g++]=r[7],v[g++]=n[3],v[g++]=i,f[g++]=o}for(m.size=b-m.start,this.vertexCount++,this.vaoMax<=this.vertexCount&&(this.vaoMax++,this.vertexBuffers[this.vertexCount]=c.GLBuffer.createVertexBuffer(s,null,s.STREAM_DRAW),this.vaos[this.vertexCount]=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aVertexPosition,s.FLOAT,!1,this.vertByteSize,0).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aTextureCoord,s.UNSIGNED_SHORT,!0,this.vertByteSize,8).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aColor,s.UNSIGNED_BYTE,!0,this.vertByteSize,12).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aTextureId,s.FLOAT,!1,this.vertByteSize,16)),this.vertexBuffers[this.vertexCount].upload(u.vertices,0),this.vao=this.vaos[this.vertexCount].bind(),b=0;y>b;b++){for(var w=d[b],E=0;Eu;u++)h[u]=u;return a.bind(),a.uniforms.uSamplers=h,a}function n(t){var e="";e+="\n",e+="\n";for(var r=0;t>r;r++)r>0&&(e+="\nelse "),t-1>r&&(e+="if(vTextureId == "+r+".0)"),e+="\n{",e+="\n color = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"}var o=t("pixi-gl-core").GLShader,s=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n");e.exports=i},{"pixi-gl-core":1}],97:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var i=o.fromCanvas(this.canvas);i.trim=new s.Rectangle,n.call(this,i),this.text=t,this.style=e}var n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fontPropertiesCache={},i.fontPropertiesCanvas=document.createElement("canvas"),i.fontPropertiesContext=i.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(i.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.breakWords=t.breakWords||!1,t.letterSpacing=t.letterSpacing||0,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=void 0!==t.dropShadowAngle?t.dropShadowAngle:Math.PI/6,t.dropShadowDistance=void 0!==t.dropShadowDistance?t.dropShadowDistance:5,t.dropShadowBlur=void 0!==t.dropShadowBlur?t.dropShadowBlur:0,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t||" ",t=t.toString(),this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),i=new Array(r.length),n=0,o=this.determineFontProperties(t.font),s=0;s0?(this.context.shadowColor=t.dropShadowColor,this.context.shadowBlur=t.dropShadowBlur):this.context.fillStyle=t.dropShadowColor;var d=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,f=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(s=0;sh;h++){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d+=p}for(e.ascent=s-h,d=c-p,f=!1,h=a;h>s;h--){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d-=p}e.descent=h-s,e.fontSize=e.ascent+e.descent,i.fontPropertiesCache[t]=e}return e},i.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;ni)for(var u=s[a].split(""),l=0;lo?(e+="\n"+u[l],o=i-c):(0===l&&(e+=" "),e+=u[l],o-=c)}else{var p=h+this.context.measureText(" ").width;0===a||p>o?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=p,e+=" "+s[a])}}n0&&e>0,this.width=t,this.height=e,this.valid&&(this.emit("update",this),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.destroy=function(){n.prototype.destroy.call(this,!0),this.filterManager&&this.filterManager.destroy(),this.renderer=null}},{"../const":39,"./BaseTexture":99}],99:[function(t,e,r){function i(t,e,r){s.call(this),this.uid=n.uid(),this.touched=0,this.resolution=r||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||o.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=o.MIPMAP_TEXTURES,this.wrap=o.MIPMAP_TEXTURES,this._glTextures=[],this._enabled=0,this._id=0,t&&this.loadSource(t)}var n=t("../utils"),o=t("../const"),s=t("eventemitter3"),a=t("../utils/determineCrossOrigin"),h=t("bit-twiddle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=h.isPow2(this.realWidth)&&h.isPow2(this.realHeight),this.emit("update",this)},i.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var r=this;t.onload=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r._sourceLoaded(),r.emit("loaded",r))},t.onerror=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r.emit("error",r))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},i.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},i.prototype.destroy=function(){this.imageUrl?(delete n.BaseTextureCache[this.imageUrl],delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete n.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},i.prototype.dispose=function(){this.emit("dispose",this); +},i.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},i.fromImage=function(t,e,r){var o=n.BaseTextureCache[t];if(!o){var s=new Image;void 0===e&&0!==t.indexOf("data:")&&(s.crossOrigin=a(t)),o=new i(s,r),o.imageUrl=t,s.src=t,n.BaseTextureCache[t]=o,o.resolution=n.getResolutionOfUrl(t)}return o},i.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+n.uid());var r=n.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),n.BaseTextureCache[t._pixiId]=r),r}},{"../const":39,"../utils":108,"../utils/determineCrossOrigin":107,"bit-twiddle":17,eventemitter3:26}],100:[function(t,e,r){function i(t,e){if(this.legacyRenderer=null,!(t instanceof n)){var r=arguments[1],i=arguments[2],s=arguments[3]||0,a=arguments[4]||1;console.warn("v4 RenderTexture now expects a new BaseRenderTexture. Please use RenderTexture.create("+r+", "+i+")"),this.legacyRenderer=arguments[0],e=null,t=new n(r,i,s,a)}o.call(this,t,e),this.valid=!0,this._updateUvs()}var n=t("./BaseRenderTexture"),o=t("./Texture");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.resize=function(t,e,r){this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},i.create=function(t,e,r,o){return new i(new n(t,e,r,o))}},{"./BaseRenderTexture":98,"./Texture":101}],101:[function(t,e,r){function i(t,e,r,n,o){if(a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.orig=r||e,this._rotate=+(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw"attempt to use diamond-shaped UVs. If you are sure, set rotation manually";t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),u=t("../utils");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim||(this.orig=t),this.valid&&this._updateUvs()}},rotate:{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},width:{get:function(){return this.orig?this.orig.width:0}},height:{get:function(){return this.orig?this.orig.height:0}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.orig,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this._frame,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new i(n.fromImage(t,e,r)),u.TextureCache[t]=o),o},i.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(o.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(o.fromUrl(t,e))},i.from=function(t){if("string"==typeof t){var e=u.TextureCache[t];if(!e){var r=null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/);return r?i.fromVideoUrl(t):i.fromImage(t)}return e}return t instanceof HTMLCanvasElement?i.fromCanvas(t):t instanceof HTMLVideoElement?i.fromVideo(t):t instanceof n?new i(n):void 0},i.addTextureToCache=function(t,e){u.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},i.EMPTY=new i(new n)},{"../math":61,"../utils":108,"./BaseTexture":99,"./TextureUvs":102,"./VideoBaseTexture":103,eventemitter3:26}],102:[function(t,e,r){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsUint32=new Uint32Array(4)}e.exports=i;var n=t("../math/GroupD8");i.prototype.set=function(t,e,r){var i=e.width,o=e.height;if(r){var s=t.width/2/i,a=t.height/2/o,h=t.x/i+s,u=t.y/o+a;r=n.add(r,n.NW),this.x0=h+s*n.uX(r),this.y0=u+a*n.uY(r),r=n.add(r,2),this.x1=h+s*n.uX(r),this.y1=u+a*n.uY(r),r=n.add(r,2),this.x2=h+s*n.uX(r),this.y2=u+a*n.uY(r),r=n.add(r,2),this.x3=h+s*n.uX(r),this.y3=u+a*n.uY(r)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o;this.uvsUint32[0]=(65535*this.y0&65535)<<16|65535*this.x0&65535,this.uvsUint32[1]=(65535*this.y1&65535)<<16|65535*this.x1&65535,this.uvsUint32[2]=(65535*this.y2&65535)<<16|65535*this.x2&65535,this.uvsUint32[3]=(65535*this.y3&65535)<<16|65535*this.x3&65535}},{"../math/GroupD8":58}],103:[function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),s.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=i},{"../const":39,eventemitter3:26}],105:[function(t,e,r){var i=t("./Ticker"),n=new i;n.autoStart=!0,e.exports={shared:n,Ticker:i}},{"./Ticker":104}],106:[function(t,e,r){var i=function(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;e>i;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r};e.exports=i},{}],107:[function(t,e,r){var i,n=t("url"),o=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,i||(i=document.createElement("a")),i.href=t,t=n.parse(i.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};e.exports=o},{url:24}],108:[function(t,e,r){var i=t("../const"),n=e.exports={_uid:0,_saidHello:!1,EventEmitter:t("eventemitter3"),pluginTarget:t("./pluginTarget"),uid:function(){return++n._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+t+" - http://www.pixijs.com/");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(i){return!1}},sign:function(t){return t?0>t?-1:1:0},removeItems:function(t,e,r){var i=t.length;if(!(e>=i||0===r)){r=e+r>i?i-e:r;for(var n=e,o=i-r;o>n;++n)t[n]=t[n+r];t.length=o}},TextureCache:{},BaseTextureCache:{}}},{"../const":39,"./pluginTarget":110,eventemitter3:26}],109:[function(t,e,r){var i=t("ismobilejs"),n=function(t){return i.tablet||i.phone?2:t};e.exports=n},{ismobilejs:27}],110:[function(t,e,r){function i(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){i(t)}}},{}],111:[function(t,e,r){var i=t("./core"),n=t("./mesh"),o=t("./particles"),s=t("./extras"),a=t("./filters");i.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},i.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(i,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),i.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),i.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),n.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),n.Rope}},ParticleContainer:{get:function(){return console.warn("The ParticleContainer class has been moved to particles.ParticleContainer, please use particles.ParticleContainer from now on."),o.ParticleContainer}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),s.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),s.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),s.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),i.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),i.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),i.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),i.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),i}},AbstractFilter:{get:function(){return console.warn("AstractFilter has been renamed to Filter, please use PIXI.Filter"),i.Filter}}}),i.DisplayObject.prototype.generateTexture=function(t,e,r){return console.warn("generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)"),t.generateTexture(t,e,r)},i.Graphics.prototype.generateTexture=function(t,e){return console.warn("graphics generate texture has moved to the renderer. Or to render a graphics to a texture using canvas please use generateCanvasTexture"),this.generateCanvasTexture(t,e)},i.RenderTexture.prototype.render=function(t){this.legacyRenderer.render(t,this),console.warn("RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)")},i.RenderTexture.prototype.getImage=function(t){return console.warn("RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)"),this.legacyRenderer.extract.image(t)},i.RenderTexture.prototype.getBase64=function(t){console.warn("RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)"),this.legacyRenderer.extract.base64(t)},i.RenderTexture.prototype.getCanvas=function(t){console.warn("RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)"),this.legacyRenderer.extract.canvas(t)},i.RenderTexture.prototype.getPixels=function(t){console.warn("RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)"),this.legacyRenderer.pixels(t)},i.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},s.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},i.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},i.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},i.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(a,{AbstractFilter:{get:function(){return console.warn("AstractFilter has been renamed to Filter, please use PIXI.Filter"),i.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),i.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),i.SpriteMaskFilter}}}),i.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),i.utils.uid()},i.utils.canUseNewCanvasBlendModes=function(){return console.warn("utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on"),i.CanvasTinter.canUseMultiply}},{"./core":57,"./extras":121,"./filters":133,"./mesh":148,"./particles":151}],112:[function(t,e,r){function i(t){this.renderer=t,t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer;t&&(s=t instanceof n.RenderTexture?t:a.generateTexture(t)),s?(e=s.baseTexture._canvasRenderTarget.context,r=s.baseTexture._canvasRenderTarget.resolution,i=s.frame):(e=a.rootContext,r=a.rootResolution,i=o,i.width=this.renderer.width,i.height=this.renderer.height);var h=i.width*r,u=i.height*r,l=new n.CanvasRenderTarget(h,u),c=e.getImageData(i.x*r,i.y*r,h,u);return l.context.putImageData(c,0,0),l.canvas},i.prototype.pixels=function(t){var e,r,i,n=this.renderer;return t?(e=t.baseTexture._canvasRenderTarget.context,r=t.baseTexture._canvasRenderTarget.resolution,i=t.frame):(e=n.rootContext,r=n.rootResolution,i=o,i.width=n.width,i.height=n.height),e.getImageData(0,0,i.width*r,i.height*r).data},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.CanvasRenderer.registerPlugin("extract",i)},{"../../core":57}],113:[function(t,e,r){e.exports={webGL:t("./webgl/WebGLExtract"),canvas:t("./canvas/CanvasExtract")}},{"./canvas/CanvasExtract":112,"./webgl/WebGLExtract":114}],114:[function(t,e,r){function i(t){this.renderer=t,t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer,h=!1;t&&(s=t instanceof n.RenderTexture?t:this.renderer.generateTexture(t)),s?(e=s.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=s.frame,h=!1):(e=this.renderer.rootRenderTarget,r=e.resolution,h=!0,i=o,i.width=e.size.width,i.height=e.size.height);var u=i.width*r,l=i.height*r,c=new n.CanvasRenderTarget(u,l);if(e){a.bindRenderTarget(e);var p=new Uint8Array(4*u*l),d=a.gl;d.readPixels(i.x*r,i.y*r,u,l,d.RGBA,d.UNSIGNED_BYTE,p);var f=c.context.getImageData(0,0,u,l);f.data.set(p),c.context.putImageData(f,0,0),h&&(c.context.scale(1,-1),c.context.drawImage(c.canvas,0,-l))}return c.canvas},i.prototype.pixels=function(t){var e,r,i,n=this.renderer;t?(e=t.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=t.frame):(e=this.renderer.rootRenderTarget,r=e.resolution,i=o,i.width=e.size.width,i.height=e.size.height);var s=i.width*r,a=i.height*r,h=new Uint8Array(4*s*a);if(e){n.bindRenderTarget(e);var u=n.gl;u.readPixels(i.x*r,i.y*r,s,a,u.RGBA,u.UNSIGNED_BYTE,h)}return h},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.WebGLRenderer.registerPlugin("extract",i)},{"../../core":57}],115:[function(t,e,r){function i(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):i.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){for(var t=i.fonts[this._font.name],e=new n.Point,r=null,o=[],s=0,a=0,h=[],u=0,l=this._font.size/t.size,c=-1,p=0,d=0;d0&&e.x*l>this.maxWidth)n.utils.removeItems(o,c,d-c),d=c,c=-1,h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var v=t.chars[f];v&&(r&&v.kerning[r]&&(e.x+=v.kerning[r]),o.push({texture:v.texture,line:u,charCode:f,position:new n.Point(e.x+v.xOffset,e.y+v.yOffset)}),s=e.x+(v.texture.width+v.xOffset),e.x+=v.xAdvance,p=Math.max(p,v.yOffset+v.texture.height),r=f)}}h.push(s),a=Math.max(a,s);var g=[];for(d=0;u>=d;d++){var y=0;"right"===this._font.align?y=a-h[d]:"center"===this._font.align&&(y=(a-h[d])/2),g.push(y)}var x=o.length,m=this.tint;for(d=0;x>d;d++){var T=this._glyphs[d];T?T.texture=o[d].texture:(T=new n.Sprite(o[d].texture),this._glyphs.push(T)),T.position.x=(o[d].position.x+g[o[d].line])*l,T.position.y=o[d].position.y*l,T.scale.x=T.scale.y=l,T.tint=m,T.parent||this.addChild(T)}for(d=x;dt&&(t+=this._textures.length),t}}}),i.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},i.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this._texture=this._textures[this.currentFrame]},i.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;0>r;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},i.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},i.fromFrames=function(t){for(var e=[],r=0;rm?m:t,t=t>b?b:t,t=t>w?w:t,r=x,r=r>T?T:r,r=r>_?_:r,r=r>E?E:r,e=y,e=m>e?m:e,e=b>e?b:e,e=w>e?w:e,i=x,i=T>i?T:i,i=_>i?_:i,i=E>i?E:i;var S=this._bounds;return S.x=t,S.width=e-t,S.y=r,S.height=i-r,this._currentBounds=S,S},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,i=this._height,n=-r*this.anchor.x;return o.x>n&&o.xe&&o.yu;u++){var l=h.replace("%index%",u);e=u,u>=o&&(e=t-u-1),l=l.replace("%value%",r[e]),a+=l,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=o},{}],127:[function(t,e,r){var i=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform float strength;","uniform mat3 projectionMatrix;","varying vec2 vBlurTexCoords[%size%];","void main(void)","{","gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);","%blur%","}"].join("\n"),n=function(t,e){var r,n,o=Math.ceil(t/2),s=i,a="";r=e?"vBlurTexCoords[%index%] = aTextureCoord + vec2(%samlpeIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %samlpeIndex% * strength);";for(var h=0;t>h;h++){var u=r.replace("%index%",h);n=h,h>=o&&(n=t-h-1),u=u.replace("%samlpeIndex%",h-(o-1)+".0"),a+=u,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=n},{}],128:[function(t,e,r){var i=function(t){for(var e=t.getParameter(t.MAX_VARYING_VECTORS)/2|0,r=15;r>e;)r-=2;return r};e.exports=i},{}],129:[function(t,e,r){function i(){n.Filter.call(this,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\n\nvoid main(void)\n{\n\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor.r = (m[0] * c.r);\n gl_FragColor.r += (m[1] * c.g);\n gl_FragColor.r += (m[2] * c.b);\n gl_FragColor.r += (m[3] * c.a);\n gl_FragColor.r += m[4] * c.a;\n\n gl_FragColor.g = (m[5] * c.r);\n gl_FragColor.g += (m[6] * c.g);\n gl_FragColor.g += (m[7] * c.b);\n gl_FragColor.g += (m[8] * c.a);\n gl_FragColor.g += m[9] * c.a;\n\n gl_FragColor.b = (m[10] * c.r);\n gl_FragColor.b += (m[11] * c.g);\n gl_FragColor.b += (m[12] * c.b);\n gl_FragColor.b += (m[13] * c.a);\n gl_FragColor.b += m[14] * c.a;\n\n gl_FragColor.a = (m[15] * c.r);\n gl_FragColor.a += (m[16] * c.g);\n gl_FragColor.a += (m[17] * c.b);\n gl_FragColor.a += (m[18] * c.a);\n gl_FragColor.a += m[19] * c.a;\n\n// gl_FragColor = vec4(m[0]);\n}\n"),this.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._loadMatrix=function(t,e){e=!!e;var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},i.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19],t},i.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},i.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.grayscale=i.prototype.greyscale,i.prototype.blackAndWhite=function(t){var e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=.213,o=.715,s=.072,a=[n+r*(1-n)+i*-n,o+r*-o+i*-o,s+r*-s+i*(1-s),0,0,n+r*-n+.143*i,o+r*(1-o)+.14*i,s+r*-s+i*-.283,0,0,n+r*-n+i*-(1-n),o+r*-o+i*o,s+r*(1-s)+i*s,0,0,0,0,0,1,0];this._loadMatrix(a,e)},i.prototype.contrast=function(t,e){var r=(t||0)+1,i=-128*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.saturate=function(t,e){var r=2*(t||0)/3+1,i=(r-1)*-.5,n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.desaturate=function(t){this.saturate(-1)},i.prototype.negative=function(t){var e=[0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.sepia=function(t){var e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.technicolor=function(t){var e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.polaroid=function(t){var e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.toBGR=function(t){var e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.kodachrome=function(t){var e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.browni=function(t){var e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.vintage=function(t){var e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.colorTone=function(t,e,r,i,n){t=t||.2,e=e||.15,r=r||16770432,i=i||3375104;var o=(r>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,u,l,e,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},i.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}}})},{"../../core":57}],130:[function(t,e,r){function i(t,e){var r=new n.Matrix;t.renderable=!1,n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n"),this.maskSprite=t,this.maskMatrix=r,this.uniforms.mapSampler=t.texture,this.uniforms.otherMatrix=r.toArray(!0),this.uniforms.scale={x:1,y:1},null!==e&&void 0!==e||(e=20),this.scale=new n.Point(e,e)}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=1/r.destinationFrame.width*(r.size.width/e.size.width);this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x*i,this.uniforms.scale.y=this.scale.y*i,t.applyFilter(this,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t}}})},{"../../core":57}],131:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\nuniform float exposure;\nuniform float decay;\nuniform float density;\nuniform float weight;\nuniform vec2 lightPositionOnScreen;\nuniform sampler2D uSampler;\n\nconst int NUM_SAMPLES = 100;\n\nvoid main()\n{\n vec2 deltaTextCoord = vec2( vTextureCoord - lightPositionOnScreen.xy );\n vec2 textCoo = vTextureCoord;\n deltaTextCoord *= 1.0 / float(NUM_SAMPLES) * density;\n float illuminationDecay = 1.0;\n \n for(int i=0; i < NUM_SAMPLES ; i++)\n {\n textCoo -= deltaTextCoord;\n vec4 sample = texture2D(uSampler, textCoo );\n\n sample *= illuminationDecay * weight;\n\n gl_FragColor += sample;\n\n illuminationDecay *= decay;\n }\n \n gl_FragColor *= exposure;\n}"),this.uniforms.exposure=.0034,this.uniforms.decay=1,this.uniforms.density=.84,this.uniforms.weight=5.65,this.uniforms.lightPositionOnScreen[0]=.5,this.uniforms.lightPositionOnScreen[1]=.5}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":57}],132:[function(t,e,r){function i(){n.Filter.call(this,"precision lowp float;\n#define GLSLIFY 1\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float gray;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);\n}\n"),this.uniforms.gray=1,this.glShaderKey="gray"}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{gray:{get:function(){return this.uniforms.gray},set:function(t){this.uniforms.gray=t}}})},{"../../core":57}],133:[function(t,e,r){e.exports={DisplacementFilter:t("./displacement/DisplacementFilter"),BlurFilter:t("./blur/BlurFilter"),BlurXFilter:t("./blur/BlurXFilter"),BlurYFilter:t("./blur/BlurYFilter"),ColorMatrixFilter:t("./colormatrix/ColorMatrixFilter"),TwistFilter:t("./twist/TwistFilter"),GrayFilter:t("./gray/GrayFilter"),GodrayFilter:t("./godray/GodrayFilter")}},{"./blur/BlurFilter":123,"./blur/BlurXFilter":124,"./blur/BlurYFilter":125,"./colormatrix/ColorMatrixFilter":129,"./displacement/DisplacementFilter":130,"./godray/GodrayFilter":131,"./gray/GrayFilter":132,"./twist/TwistFilter":134}],134:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.uniforms.radius=400,this.uniforms.angle=3,this.uniforms.offset=[400,300],this.transform=new n.math.Matrix,this.padding=200}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":57}],135:[function(t,e,r){(function(r){t("./polyfill");var i=e.exports=t("./core");i.extras=t("./extras"),i.filters=t("./filters"),i.interaction=t("./interaction"),i.loaders=t("./loaders"),i.mesh=t("./mesh"),i.particles=t("./particles"),i.accessibility=t("./accessibility"),i.extract=t("./extract"),i.loader=new i.loaders.Loader,Object.assign(i,t("./deprecation")),r.PIXI=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":38,"./core":57,"./deprecation":111,"./extract":113,"./extras":121,"./filters":133,"./interaction":138,"./loaders":141,"./mesh":148,"./particles":151,"./polyfill":157}],136:[function(t,e,r){function i(){this.global=new n.Point,this.target=null,this.originalEvent=null}var n=t("../core");i.prototype.constructor=i,e.exports=i,i.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}},{"../core":57}],137:[function(t,e,r){function i(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.defaultCursorStyle="inherit",this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var n=t("../core"),o=t("./InteractionData");Object.assign(n.DisplayObject.prototype,t("./interactiveTarget")),i.prototype.constructor=i,e.exports=i,i.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;h--){var u=a[h];if(this.processInteractive(t,u,r,i,s)){if(!u.parent)continue;o=!0,s=!1,i=!1}}return n&&(i&&!o&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),o=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(o=e.containsPoint(t))),e.interactive&&r(e,o)),o},i.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},i.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},i.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},i.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},i.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor=this.defaultCursorStyle,this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},i.prototype.processMouseMove=function(t,e){this.processMouseOverOut(t,e),this.moveWhenInside&&!e||this.dispatchEvent(t,"mousemove",this.eventData)},i.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor=this.defaultCursorStyle,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},i.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},i.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},i.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},i.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},i.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData)); +},i.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,this.moveWhenInside),this.returnTouchData(o)}},i.prototype.processTouchMove=function(t,e){this.moveWhenInside&&!e||this.dispatchEvent(t,"touchmove",this.eventData)},i.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},i.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",i),n.CanvasRenderer.registerPlugin("interaction",i)},{"../core":57,"./InteractionData":136,"./interactiveTarget":139}],138:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":136,"./InteractionManager":137,"./interactiveTarget":139}],139:[function(t,e,r){var i={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=i},{}],140:[function(t,e,r){function i(t,e){var r={},i=t.data.getElementsByTagName("info")[0],n=t.data.getElementsByTagName("common")[0];r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hn-e&&nn;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},i.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;n>o;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},i.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this._texture.baseTexture,a=s.source,h=s.width,u=s.height,l=e[i],c=e[n],p=e[o],d=e[i+1],f=e[n+1],v=e[o+1],g=r[i]*s.width,y=r[n]*s.width,x=r[o]*s.width,m=r[i+1]*s.height,T=r[n+1]*s.height,b=r[o+1]*s.height;if(this.canvasPadding>0){var _=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,E=(l+c+p)/3,S=(d+f+v)/3,C=l-E,M=d-S,R=Math.sqrt(C*C+M*M);l=E+C/R*(R+_),d=S+M/R*(R+w),C=c-E,M=f-S,R=Math.sqrt(C*C+M*M),c=E+C/R*(R+_),f=S+M/R*(R+w),C=p-E,M=v-S,R=Math.sqrt(C*C+M*M),p=E+C/R*(R+_),v=S+M/R*(R+w)}t.save(),t.beginPath(),t.moveTo(l,d),t.lineTo(c,f),t.lineTo(p,v),t.closePath(),t.clip();var A=g*T+m*x+y*b-T*x-m*y-g*b,O=l*T+m*p+c*b-T*p-m*c-l*b,P=g*c+l*x+y*p-c*x-l*y-g*p,D=g*T*p+m*c*x+l*y*b-l*T*x-m*y*p-g*c*b,L=d*T+m*v+f*b-T*v-m*f-d*b,I=g*f+d*x+y*v-f*x-d*y-g*v,B=g*T*v+m*f*x+d*y*b-d*T*x-m*y*v-g*f*b;t.transform(O/A,L/A,P/A,I/A,D/A,B/A),t.drawImage(a,0,0,h*s.resolution,u*s.resolution,0,0,h,u),t.restore()},i.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;i-2>n;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],u=r[o+1],l=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,l),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},i.prototype._onTextureUpdate=function(){this.updateFrame=!0},i.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,u=-(1/0),l=-(1/0),c=1/0,p=1/0,d=this.vertices,f=0,v=d.length;v>f;f+=2){var g=d[f],y=d[f+1],x=r*g+o*y+a,m=s*y+i*g+h;c=c>x?x:c,p=p>m?m:p,u=x>u?x:u,l=m>l?m:l}if(c===-(1/0)||l===1/0)return n.Rectangle.EMPTY;var T=this._bounds;T.x=c,T.width=u-c,T.y=p,T.height=l-p,this._currentBounds=T}return this._currentBounds},i.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,a);var e,r,n=this.vertices,o=h.points;if(this.drawMode===i.DRAW_MODES.TRIANGLES){var s=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*s[e],l=2*s[e+1],c=2*s[e+2];if(o[0]=n[u],o[1]=n[u+1],o[2]=n[l],o[3]=n[l+1],o[4]=n[c],o[5]=n[c+1],h.contains(a.x,a.y))return!0}}else for(r=n.length,e=0;r>e;e+=6)if(o[0]=n[e],o[1]=n[e+1],o[2]=n[e+2],o[3]=n[e+3],o[4]=n[e+4],o[5]=n[e+5],h.contains(a.x,a.y))return!0;return!1},i.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":57,"./webgl/MeshShader":149,"pixi-gl-core":1}],146:[function(t,e,r){function i(t,e,r){n.call(this,t),this._ready=!0,this.segmentsX=e||10,this.segmentsY=r||10,this.drawMode=n.DRAW_MODES.TRIANGLES,this.refresh()}var n=t("./Mesh");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.segmentsX*this.segmentsY,e=[],r=[],i=[],n=[],o=this.texture,s=this.segmentsX-1,a=this.segmentsY-1,h=0,u=o.width/s,l=o.height/a;for(h=0;t>h;h++){var c=h%this.segmentsX,p=h/this.segmentsX|0;e.push(c*u,p*l),i.push(o._uvs.x0+(o._uvs.x1-o._uvs.x0)*(c/(this.segmentsX-1)),o._uvs.y0+(o._uvs.y3-o._uvs.y0)*(p/(this.segmentsY-1)))}var d=s*a;for(h=0;d>h;h++){var f=h%s,v=h/s|0,g=v*this.segmentsX+f,y=v*this.segmentsX+f+1,x=(v+1)*this.segmentsX+f,m=(v+1)*this.segmentsX+f+1;n.push(g,y,x),n.push(y,m,x)}this.vertices=new Float32Array(e),this.uvs=new Float32Array(i),this.colors=new Float32Array(r),this.indices=new Uint16Array(n),this.indexDirty=!0},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()}},{"./Mesh":145}],147:[function(t,e,r){function i(t,e){n.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var n=t("./Mesh"),o=t("../core");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,i=this.colors,n=this._texture._uvs,s=new o.Point(n.x0,n.y0),a=new o.Point(n.x2-n.x0,n.y2-n.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var h,u,l,c=t.length,p=1;c>p;p++)h=t[p],u=4*p,l=p/(c-1),e[u]=l*a.x+s.x,e[u+1]=0+s.y,e[u+2]=l*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*p,i[u]=1,i[u+1]=1,u=2*p,r[u]=u,r[u+1]=u+1;this.dirty=!0,this.indexDirty=!0}},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},i.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,u=0,l=this.vertices,c=t.length,p=0;c>p;p++)r=t[p],i=4*p,e=p1&&(n=1),o=Math.sqrt(h*h+u*u),s=this._texture.height/2,h/=o,u/=o,h*=s,u*=s,l[i]=r.x+h,l[i+1]=r.y+u,l[i+2]=r.x-h,l[i+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":57,"./Mesh":145}],148:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Plane:t("./Plane"),Rope:t("./Rope"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":145,"./Plane":146,"./Rope":147,"./webgl/MeshShader":149}],149:[function(t,e,r){function i(t){n.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],150:[function(t,e,r){function i(t,e,r){n.Container.call(this),r=r||15e3,t=t||15e3;var i=16384;r>i&&(r=i),r>t&&(r=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._glBuffers=[],this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=n.BLEND_MODES.NORMAL,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e)}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.hasLoaded||this.baseTexture.once("update",function(){this.onChildrenChange(0)},this)),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);ei&&(r=i);var o=t._glBuffers[this.renderer.CONTEXT_UID];o||(o=t._glBuffers[this.renderer.CONTEXT_UID]=this.generateBuffers(t)),this.renderer.setBlendMode(t.blendMode);var s=this.renderer.gl,a=t.worldTransform.copy(this.tempMatrix);a.prepend(this.renderer._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=a.toArray(!0),this.shader.uniforms.uAlpha=t.worldAlpha;var h=e[0]._texture.baseTexture;this.renderer.bindTexture(h);for(var u=0,l=0;r>u;u+=n,l+=1){var c=r-u;c>n&&(c=n);var p=o[l];p.uploadDynamic(e,u,c),t._bufferToUpdate===l&&(p.uploadStatic(e,u,c),t._bufferToUpdate=l+1),p.vao.bind().draw(s.TRIANGLES,6*c).unbind()}}},i.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._maxSize,o=t._batchSize,a=t._properties;for(e=0;n>e;e+=o)i.push(new s(r,this.properties,a,o));return i},i.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,u,l,c,p,d,f,v,g=0;r>g;g++)s=t[e+g],a=s._texture,l=s.scale.x,c=s.scale.y,h=a.trim,u=a.orig,h?(d=h.x-s.anchor.x*u.width,p=d+h.width,v=h.y-s.anchor.y*u.height,f=v+h.height):(p=u.width*(1-s.anchor.x),d=u.width*-s.anchor.x,f=u.height*(1-s.anchor.y),v=u.height*-s.anchor.y),i[o]=d*l,i[o+1]=v*c,i[o+n]=p*l,i[o+n+1]=v*c,i[o+2*n]=p*l,i[o+2*n+1]=f*c,i[o+3*n]=d*l,i[o+3*n+1]=f*c,o+=4*n},i.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},i.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},i.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.ObjectRenderer.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../core":57,"./ParticleBuffer":152,"./ParticleShader":154}],154:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],155:[function(t,e,r){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},{}],156:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":28}],157:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":155,"./Object.assign":156,"./requestAnimationFrame":158}],158:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;ni&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[135])(135)}); //# sourceMappingURL=pixi.min.js.map \ No newline at end of file diff --git a/logo.png b/logo.png index a7935b637e891fb5b96c202ac23a636419eee0f6..4921d1f3dd720b4a3c17cc3afc07b877a5ebe1fc 100644 GIT binary patch literal 52364 zcmeGC<9DS`(>@N*#5O0kZBA_4=ETXw-q8dTYljot6WiW9wrz8wUq08pzW>4V@_Ey% z*Ln6@U0q$rQRs?PQIbYR_=fQ1%NJx>840y7UmyXW^IbTY&v8n&9P-N-(l4?Sq8eUV zXY01LmW%F7j~^?(xo#JoP8R{|B0S$nMZN@6Mr|{yVadW{@yg7JApgxzl-D{+POdMa z#MW-T;UiH?;VqLJ%sq>Wh)U#5r5awqlFR2xZ<35kl8MHGM@gTa&D_ie@%dh+pdNNf zVUim`9&Ib0YP(ku9IZZPyIt}%Kd#taHtr=Xc51Q>;hD#L4sK>GA;Mq&H~kzuQ=tL> z??;~wsm*^YK0njM{Qp1yPg(yz*NFn}5hN?kuyVj6H_7vsX1VCjMg!AMk9QFx%D)l* z{<^Ejk9kACvswAdODs~?sfeFXW%Zo6-r!TuCjpYyffHBZBMOK=wq%U}r?8S-CVZjw zU7oIvk?z;=q7Y%u|E@J%yca^$ZFoS-%d0UD!?X>1$u_KfA_h=D>w|-CG-W% z!#GJJ;)1e=VtLqsOWZYebrr_-KJ>Eq4BPFW8u%bxg16{VadwOyN%FR#_`VuvV3rqn z2H zVxfy7CfCQgNW4~YNPLF5PUK^qKWgTrKzd)Ton}S9{kJ!vC=OhPz)5gK$y{!A>FYSjhyeOSqH=}X*ogsT z&p&l&f$6$>EHaUbTHf4JNAYWXbW>ZU=Rwq}>%3;CYnJyXtd9f4XhD~{;cSGc3tG(! zzS*m{&CY&f-%A+OoC<5;)T&#xL+H6f908w2^Xlp1CXQB;`Td}BK$xgW=2n2B-%u1K z!GDq%m*=Bd7IQu6Xa4+N|-{Ll%UnLvD=PZh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1ORp&Kb(AU;U(R+)8TM99FBtwWj`|fL^u~Sy5gNM){IF3mV^gD z*qSJF2MI-ftRiQFg8!}K_h*vWr^P27f)@TBM@BI68iIG0iErw*K^v$B5Gp`m!UEEo s!MrZBo%r0+E!{TF;cz${j)Tnq10%%c3@f|Vp#T5?07*qoM6N<$f<9Jx 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.alphamask;\n\nimport pixi.core.math.Point;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _cells:Sprite;\n\tvar _mask:Sprite;\n\tvar _target:Point;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.RECOMMENDED);\n\n\t\t_bg = Sprite.fromImage(\"assets/alphamask/bkg.jpg\");\n\n\t\tstage.addChild(_bg);\n\n\t\t_cells = Sprite.fromImage(\"assets/alphamask/cells.png\");\n\t\t_cells.scale.set(1.5);\n\n\t\t_mask = Sprite.fromImage(\"assets/alphamask/flowerTop.png\");\n\t\t_mask.anchor.set(0.5);\n\t\t_mask.position.set(310, 190);\n\n\t\t_cells.mask = _mask;\n\n\t\tstage.addChild(_mask);\n\t\tstage.addChild(_cells);\n\n\t\t_target = new Point();\n\t\t_reset();\n\t}\n\n\tfunction _reset() {\n\t\t_target.x = Math.floor(Math.random() * 550);\n\t\t_target.y = Math.floor(Math.random() * 300);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_mask.position.x += (_target.x - _mask.x) * 0.1;\n\t\t_mask.position.y += (_target.y - _mask.y) * 0.1;\n\t\tif (Math.abs(_mask.x - _target.x) < 1) _reset();\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.alphamask;\n\nimport pixi.core.math.Point;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _cells:Sprite;\n\tvar _mask:Sprite;\n\tvar _target:Point;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.RECOMMENDED);\n\n\t\t_bg = Sprite.fromImage(\"assets/alphamask/bkg.jpg\");\n\n\t\tstage.addChild(_bg);\n\n\t\t_cells = Sprite.fromImage(\"assets/alphamask/cells.png\");\n\t\t_cells.scale.set(1.5);\n\n\t\t_mask = Sprite.fromImage(\"assets/alphamask/flowerTop.png\");\n\t\t_mask.anchor.set(0.5);\n\t\t_mask.position.set(310, 190);\n\n\t\t_cells.mask = _mask;\n\n\t\tstage.addChild(_mask);\n\t\tstage.addChild(_cells);\n\n\t\t_target = new Point();\n\t\t_reset();\n\t}\n\n\tfunction _reset() {\n\t\t_target.x = Math.floor(Math.random() * 550);\n\t\t_target.y = Math.floor(Math.random() * 300);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_mask.position.x += (_target.x - _mask.x) * 0.1;\n\t\t_mask.position.y += (_target.y - _mask.y) * 0.1;\n\t\tif (Math.abs(_mask.x - _target.x) < 1) _reset();\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO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,NAA2B;EACjC,AAAI,DAAY,EAA0B;EAC1C,AAAI,EAAqB,HAAM,EAAoB,FAAqC;;iBAG1E,DAAsC;EACpD,CAAQ;EACR,CAAS;EACT,DAAgB,AAAO;EACvB,CAAqB,AAAQ;EAC7B,CAAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;yBC5OtE,dAAe;CACrB;CACA;;8BAsCM,nBACN;;;;;OApCD,IAAiB;EAChB,CAAW;EACX,DAAY;EAEZ,CAAM,FAAiB;EAEvB,DAAe;EAEf,CAAS,FAAiB;EAC1B,DAAiB;EAEjB,CAAQ,FAAiB;EACzB,DAAiB;EACjB,DAAmB,AAAK;EAExB,CAAc;EAEd,DAAe;EACf,DAAe;EAEf,CAAU;EACV;;QAGD,GAAkB;EACjB,CAAY,FAAW,EAAgB;EACvC,CAAY,FAAW,EAAgB;;WAGxC,WAAsC;EACrC,EAAoB,HAAC,EAAY,AAAW;EAC5C,EAAoB,HAAC,EAAY,AAAW;EAC5C,AAAI,DAAS,EAAU,AAAa,FAAG;;;;;4BH5CK;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/audio.js b/samples/_output/audio.js index 1dbe343f..a6819807 100644 --- a/samples/_output/audio.js +++ b/samples/_output/audio.js @@ -617,7 +617,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/audio.js.map b/samples/_output/audio.js.map index 45a46f64..b78aa34c 100644 --- a/samples/_output/audio.js.map +++ b/samples/_output/audio.js.map @@ -3,7 +3,7 @@ "file":"audio.js", "sourceRoot":"file:///", "sources":["/usr/local/lib/haxe/std/js/_std/EReg.hx","/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/samples/core/AssetLoader.hx","/projects/pixi-haxe/samples/core/AudioAsset.hx","/projects/pixi-haxe/samples/core/MultipackParser.hx","/usr/local/lib/haxe/std/js/_std/haxe/ds/StringMap.hx","/usr/local/lib/haxe/std/js/Boot.hx","/projects/pixi-haxe/.haxelib/msignal/1,2,4/msignal/Signal.hx","/projects/pixi-haxe/.haxelib/msignal/1,2,4/msignal/Slot.hx","/projects/pixi-haxe/.haxelib/msignal/1,2,4/msignal/SlotList.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/audio/Button.hx","/projects/pixi-haxe/samples/audio/Main.hx","/usr/local/lib/haxe/std/js/_std/Std.hx"], -"sourcesContent":["/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class EReg {\n\n\tvar r : HaxeRegExp;\n\n\tpublic function new( r : String, opt : String ) : Void {\n\t\topt = opt.split(\"u\").join(\"\"); // 'u' (utf8) depends on page encoding\n\t\tthis.r = new HaxeRegExp(r, opt);\n\t}\n\n\tpublic function match( s : String ) : Bool {\n\t\tif( r.global ) r.lastIndex = 0;\n\t\tr.m = r.exec(s);\n\t\tr.s = s;\n\t\treturn (r.m != null);\n\t}\n\n\tpublic function matched( n : Int ) : String {\n\t\treturn if( r.m != null && n >= 0 && n < r.m.length ) r.m[n] else throw \"EReg::matched\";\n\t}\n\n\tpublic function matchedLeft() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn r.s.substr(0,r.m.index);\n\t}\n\n\tpublic function matchedRight() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\tvar sz = r.m.index+r.m[0].length;\n\t\treturn r.s.substr(sz,r.s.length-sz);\n\t}\n\n\tpublic function matchedPos() : { pos : Int, len : Int } {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn { pos : r.m.index, len : r.m[0].length };\n\t}\n\n\tpublic function matchSub( s : String, pos : Int, len : Int = -1):Bool {\n\t\treturn if (r.global) {\n\t\t\tr.lastIndex = pos;\n\t\t\tr.m = r.exec(len < 0 ? s : s.substr(0, pos + len));\n\t\t\tvar b = r.m != null;\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t}\n\t\t\tb;\n\t\t} else {\n\t\t\t// TODO: check some ^/$ related corner cases\n\t\t\tvar b = match( len < 0 ? s.substr(pos) : s.substr(pos,len) );\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t\tr.m.index += pos;\n\t\t\t}\n\t\t\tb;\n\t\t}\n\t}\n\n\tpublic function split( s : String ) : Array {\n\t\t// we can't use directly s.split because it's ignoring the 'g' flag\n\t\tvar d = \"#__delim__#\";\n\t\treturn untyped s.replace(r,d).split(d);\n\t}\n\n\tpublic function replace( s : String, by : String ) : String {\n\t\treturn untyped s.replace(r,by);\n\t}\n\n\tpublic function map( s : String, f : EReg -> String ) : String {\n\t\tvar offset = 0;\n\t\tvar buf = new StringBuf();\n\t\tdo {\n\t\t\tif (offset >= s.length)\n\t\t\t\tbreak;\n\t\t\telse if (!matchSub(s, offset)) {\n\t\t\t\tbuf.add(s.substr(offset));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar p = matchedPos();\n\t\t\tbuf.add(s.substr(offset, p.pos - offset));\n\t\t\tbuf.add(f(this));\n\t\t\tif (p.len == 0) {\n\t\t\t\tbuf.add(s.substr(p.pos, 1));\n\t\t\t\toffset = p.pos + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\toffset = p.pos + p.len;\n\t\t} while (r.global);\n\t\tif (!r.global && offset > 0 && offset < s.length)\n\t\t\tbuf.add(s.substr(offset));\n\t\treturn buf.toString();\n\t}\n}\n\n@:native(\"RegExp\")\nprivate extern class HaxeRegExp extends js.RegExp {\n\tvar m:js.RegExp.RegExpMatch;\n\tvar s:String;\n}\n","import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package core;\n\nimport pixi.loaders.Resource;\nimport pixi.core.textures.Texture;\nimport pixi.loaders.Loader;\n\nclass AssetLoader extends Loader {\n\n\tpublic var pixelRatio(null, default):Float;\n\tpublic var count(default, null):Int;\n\tpublic var resolution(default, default):String;\n\tpublic var mute(default, set):Bool;\n\n\tvar _audioAssets:Map;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tcount = 0;\n\t\tpixelRatio = 1;\n\t\t_audioAssets = new Map();\n\t\tMultipackParser.loader = this;\n\t\tuse(MultipackParser.parse);\n\t}\n\n\tpublic function start(?onComplete:Void -> Void, ?onProgress:Void -> Void) {\n\t\tload(onComplete);\n\t\tif (progress != null) on(\"progress\", onProgress);\n\t}\n\n\tpublic inline function addAudioAsset(id:String, path:String, ?onAssetLoaded:Resource -> Void) {\n\t\taddAsset(id, path, false, onAssetLoaded);\n\t}\n\n\tpublic function addAsset(id:String, path:String, ?usePixelRatio:Bool = true, ?onAssetLoaded:Resource -> Void) {\n\t\tif (!exists(id)) {\n\t\t\tvar url:String = path;\n\n\t\t\tif (url != \"\") {\n\t\t\t\tadd(id, url, { loadType: _getLoadtype(path) }, onAssetLoaded);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic inline function getUrl(id:String):String {\n\t\treturn Reflect.field(resources, id) != null ? Reflect.field(resources, id).url : null;\n\t}\n\n\t@SuppressWarnings(\"checkstyle:Dynamic\")\n\tpublic function getJson(id:String):Dynamic {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && ~/(json|text|txt)/i.match(resource.xhrType)) return resource.data;\n\t\treturn null;\n\t}\n\n\tpublic function getTexture(id:String):Texture {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && resource.texture != null) return resource.texture;\n\t\treturn null;\n\t}\n\n\tpublic function getTextureFromSpritesheet(id:String, frame:String):Texture {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && resource.isJson && resource.textures != null) {\n\t\t\tvar texture = Reflect.field(resource.textures, frame);\n\t\t\tif (texture != null) return texture;\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic inline function exists(id:String):Bool {\n\t\treturn (Reflect.field(resources, id) != null);\n\t}\n\n\tpublic function getAudio(id:String):AudioAsset {\n\t\tif (_audioAssets.get(id) == null) _audioAssets.set(id, new AudioAsset(Reflect.field(resources, id).data));\n\t\treturn _audioAssets.get(id);\n\t}\n\n\tpublic function getResource(id:String):Resource {\n\t\treturn Reflect.field(resources, id);\n\t}\n\n\toverride public function reset() {\n\t\tremoveAllListeners();\n\t\tcount = 0;\n\t\tresources = {};\n\t\tsuper.reset();\n\t}\n\n\tpublic inline function getResoultionPath():String {\n\t\treturn (resolution != null) ? resolution + \"/\" : \"\";\n\t}\n\n\tpublic inline function getPixelRatioPath(?val:Float):String {\n\t\treturn (val != null) ? \"scale-\" + val + \"/\" : \"scale-\" + pixelRatio + \"/\";\n\t}\n\n\tfunction set_mute(val:Bool):Bool {\n\t\tfor (audioAsset in _audioAssets) audioAsset.mute = val;\n\t\treturn mute = val;\n\t}\n\n\t//type: XHR: 1, IMAGE: 2, AUDIO: 3, VIDEO: 4\n\n\tfunction _getLoadtype(asset:String):Int {\n\t\tif (~/(.png|.gif|.svg|.jpg|.jpeg|.bmp)/i.match(asset)) return 2;\n\t\telse if (~/(.mp3|.wav|.ogg|.aac|.m4a|.oga|.webma)/i.match(asset)) return 3;\n\t\telse if (~/(.mp4|.webm|.m3u8)/i.match(asset)) return 4;\n\t\treturn 1;\n\t}\n}\n","package core;\n\nimport js.html.Audio;\n\nclass AudioAsset {\n\n\tpublic var mute:Bool;\n\tpublic var loop(default, set):Bool;\n\n\tvar _src:Audio;\n\n\tpublic function new(src:Audio) {\n\t\t_src = src;\n\t\tmute = false;\n\t\tloop = false;\n\t}\n\n\tpublic function play() {\n\t\tif (!mute) _src.play();\n\t}\n\n\tpublic function stop() {\n\t\t_src.pause();\n\t}\n\n\tfunction set_loop(val:Bool):Bool {\n\t\t_src.loop = val;\n\t\treturn loop = val;\n\t}\n}","package core;\n\nimport pixi.loaders.Resource;\nimport pixi.core.utils.Utils;\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.textures.Texture;\n\nclass MultipackParser {\n\n\tpublic static var loader:AssetLoader;\n\n\tpublic static function parse(resource:Resource, next:Void -> Void) {\n\t\tvar data:MultipackSpriteSheet = resource.data;\n\t\tif (data != null && data.multipack) {\n\t\t\tvar textures:Array = data.textures;\n\t\t\tvar imgCount:Int = textures.length;\n\t\t\tvar imgLoadedCount:Int = 0;\n\t\t\tvar resolution:Float = Utils.getResolutionOfUrl(resource.url);\n\n\t\t\tvar baseURL:String = resource.url.split(loader.baseUrl)[1];\n\t\t\tbaseURL = baseURL.substring(0, baseURL.lastIndexOf(\"/\") + 1);\n\n\t\t\tfor (texture in textures) {\n\t\t\t\tvar url:String = baseURL + texture.meta.image;\n\t\t\t\tloader.add(texture.meta.image, url, { loadType: 2, crossOrigin:resource.crossOrigin }, function(image:Resource) {\n\n\t\t\t\t\tvar frames:Array = texture.frames;\n\t\t\t\t\tfor (n in Reflect.fields(frames)) {\n\t\t\t\t\t\tvar frameData:FrameData = Reflect.field(frames, n);\n\t\t\t\t\t\tvar rect = frameData.frame;\n\t\t\t\t\t\tif (rect != null) {\n\t\t\t\t\t\t\tvar size:Rectangle = new Rectangle(rect.x, rect.y, rect.w, rect.h);\n\t\t\t\t\t\t\tvar trim:Rectangle = null;\n\n\t\t\t\t\t\t\tif (frameData.trimmed) {\n\t\t\t\t\t\t\t\tvar actualSize = frameData.sourceSize;\n\t\t\t\t\t\t\t\tvar realSize = frameData.spriteSourceSize;\n\t\t\t\t\t\t\t\ttrim = new Rectangle(realSize.x / resolution, realSize.y / resolution, actualSize.w / resolution, actualSize.h / resolution);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsize.x /= resolution;\n\t\t\t\t\t\t\tsize.y /= resolution;\n\t\t\t\t\t\t\tsize.width /= resolution;\n\t\t\t\t\t\t\tsize.height /= resolution;\n\n\t\t\t\t\t\t\tTexture.addTextureToCache(new Texture(image.texture.baseTexture, size, size.clone(), trim), n);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tnext();\n\t\t}\n\t\telse next();\n\t}\n}\n\ntypedef MultipackSpriteSheet = {\n\tvar multipack:Bool;\n\tvar textures:Array;\n}\n\ntypedef MultipackTexture = {\n\tvar frames:Array;\n\tvar meta:MetaData;\n}\n\ntypedef FrameData = {\n\tvar frame:Frame;\n\tvar rotated:Bool;\n\tvar trimmed:Bool;\n\tvar format:String;\n\tvar spriteSourceSize:SpriteSourceSize;\n\tvar sourceSize:SourceSize;\n}\n\ntypedef Frame = {\n\tvar x:Float;\n\tvar y:Float;\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef SpriteSourceSize = {\n\tvar x:Float;\n\tvar y:Float;\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef SourceSize = {\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef MetaData = {\n\tvar app:String;\n\tvar version:String;\n\tvar image:String;\n\tvar format:String;\n\tvar size:String;\n\tvar scale:String;\n\tvar smartupdate:String;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage haxe.ds;\n\nprivate class StringMapIterator {\n\tvar map : StringMap;\n\tvar keys : Array;\n\tvar index : Int;\n\tvar count : Int;\n\tpublic inline function new(map:StringMap, keys:Array) {\n\t\tthis.map = map;\n\t\tthis.keys = keys;\n\t\tthis.index = 0;\n\t\tthis.count = keys.length;\n\t}\n\tpublic inline function hasNext() {\n\t\treturn index < count;\n\t}\n\tpublic inline function next() {\n\t\treturn map.get(keys[index++]);\n\t}\n}\n\n@:coreApi class StringMap implements haxe.Constraints.IMap {\n\n\tprivate var h : Dynamic;\n\tprivate var rh : Dynamic;\n\n\tpublic inline function new() : Void {\n\t\th = {};\n\t}\n\n\tinline function isReserved(key:String) : Bool {\n\t\treturn untyped __js__(\"__map_reserved\")[key] != null;\n\t}\n\n\tpublic inline function set( key : String, value : T ) : Void {\n\t\tif( isReserved(key) )\n\t\t\tsetReserved(key, value);\n\t\telse\n\t\t\th[cast key] = value;\n\t}\n\n\tpublic inline function get( key : String ) : Null {\n\t\tif( isReserved(key) )\n\t\t\treturn getReserved(key);\n\t\treturn h[cast key];\n\t}\n\n\tpublic inline function exists( key : String ) : Bool {\n\t\tif( isReserved(key) )\n\t\t\treturn existsReserved(key);\n\t\treturn h.hasOwnProperty(key);\n\t}\n\n\tfunction setReserved( key : String, value : T ) : Void {\n\t\tif( rh == null ) rh = {};\n\t\trh[cast \"$\"+key] = value;\n\t}\n\n\tfunction getReserved( key : String ) : Null {\n\t\treturn rh == null ? null : rh[cast \"$\"+key];\n\t}\n\n\tfunction existsReserved( key : String ) : Bool {\n\t\tif( rh == null ) return false;\n\t\treturn untyped rh.hasOwnProperty(\"$\"+key);\n\t}\n\n\tpublic function remove( key : String ) : Bool {\n\t\tif( isReserved(key) ) {\n\t\t\tkey = \"$\" + key;\n\t\t\tif( rh == null || !rh.hasOwnProperty(key) ) return false;\n\t\t\tuntyped __js__(\"delete\")(rh[key]);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif( !h.hasOwnProperty(key) )\n\t\t\t\treturn false;\n\t\t\tuntyped __js__(\"delete\")(h[key]);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic function keys() : Iterator {\n\t\treturn arrayKeys().iterator();\n\t}\n\t\n\tfunction arrayKeys() : Array {\n\t\tvar out = [];\n\t\tuntyped {\n\t\t\t__js__(\"for( var key in this.h ) {\");\n\t\t\t\tif( h.hasOwnProperty(key) )\n\t\t\t\t\tout.push(key);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\tif( rh != null ) untyped {\n\t\t\t__js__(\"for( var key in this.rh ) {\");\n\t\t\t\tif( key.charCodeAt(0) == \"$\".code )\n\t\t\t\t\tout.push(key.substr(1));\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn out;\n\t}\n\n\tpublic inline function iterator() : Iterator {\n\t\treturn new StringMapIterator(this, arrayKeys());\n\t}\n\n\tpublic function toString() : String {\n\t\tvar s = new StringBuf();\n\t\ts.add(\"{\");\n\t\tvar keys = arrayKeys();\n\t\tfor( i in 0...keys.length ) {\n\t\t\tvar k = keys[i];\n\t\t\ts.add(k);\n\t\t\ts.add(\" => \");\n\t\t\ts.add(Std.string(get(k)));\n\t\t\tif( i < keys.length )\n\t\t\t\ts.add(\", \");\n\t\t}\n\t\ts.add(\"}\");\n\t\treturn s.toString();\n\t}\n\n\tstatic function __init__() : Void {\n\t\tuntyped __js__(\"var __map_reserved = {}\");\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nimport msignal.Slot;\n\n/**\n\tA convenience type describing any kind of signal.\n**/\ntypedef AnySignal = Signal;\n\n/**\n\tA Signal manages a list of listeners, which are executed when the signal is \n\tdispatched.\n**/\n@:keepSub\nclass Signal, TListener>\n{\n\tpublic var valueClasses:Array;\n\n\t/**\n\t\tThe current number of listeners for the signal.\n\t**/\n\tpublic var numListeners(get, null):Int;\n\t\n\tvar slots:SlotList;\n\tvar priorityBased:Bool;\n\n\tfunction new(?valueClasses:Array)\n\t{\n\t\tif (valueClasses == null) valueClasses = [];\n\t\tthis.valueClasses = valueClasses;\n\t\tslots = cast SlotList.NIL;\n\t\tpriorityBased = false;\n\t}\n\n\t/**\n\t\tSubscribes a listener for the signal.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function add(listener:TListener):TSlot\n\t{\n\t\treturn registerListener(listener);\n\t}\n\n\t/**\n\t\tSubscribes a one-time listener for this signal.\n\t\tThe signal will remove the listener automatically the first time it is called,\n\t\tafter the dispatch to all listeners is complete.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addOnce(listener:TListener):TSlot\n\t{\n\t\treturn registerListener(listener, true);\n\t}\n\n\t/**\n\t\tSubscribes a listener for the signal.\n\t\tAfter you successfully register an event listener,\n\t\tyou cannot change its priority through additional calls to add().\n\t\tTo change a listener's priority, you must first call remove().\n\t\tThen you can register the listener again with the new priority level.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addWithPriority(listener:TListener, ?priority:Int=0):TSlot\n\t{\n\t\treturn registerListener(listener, false, priority);\n\t}\n\n\t/**\n\t\tSubscribes a one-time listener for this signal.\n\t\tThe signal will remove the listener automatically the first time it is \n\t\tcalled, after the dispatch to all listeners is complete.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addOnceWithPriority(listener:TListener, ?priority:Int=0):TSlot\n\t{\n\t\treturn registerListener(listener, true, priority);\n\t}\n\n\t/**\n\t\tUnsubscribes a listener from the signal.\n\t\t\n\t\t@param listener The listener to remove\n\t\t@return The removed listener slot\n\t**/\n\tpublic function remove(listener:TListener):TSlot\n\t{\n\t\tvar slot = slots.find(listener);\n\t\tif (slot == null) return null;\n\t\t\n\t\tslots = slots.filterNot(listener);\n\t\treturn slot;\n\t}\n\n\t/**\n\t\tUnsubscribes all listeners from the signal.\n\t**/\n\tpublic function removeAll():Void\n\t{\n\t\tslots = cast SlotList.NIL;\n\t}\n\n\tfunction registerListener(listener:TListener, ?once:Bool=false, ?priority:Int=0):TSlot\n\t{\n\t\tif (registrationPossible(listener, once))\n\t\t{\n\t\t\tvar newSlot = createSlot(listener, once, priority);\n\t\t\t\n\t\t\tif (!priorityBased && priority != 0) priorityBased = true;\n\t\t\tif (!priorityBased && priority == 0) slots = slots.prepend(newSlot);\n\t\t\telse slots = slots.insertWithPriority(newSlot);\n\n\t\t\treturn newSlot;\n\t\t}\n\t\t\n\t\treturn slots.find(listener);\n\t}\n\n\tfunction registrationPossible(listener, once)\n\t{\n\t\tif (!slots.nonEmpty) return true;\n\t\t\n\t\tvar existingSlot = slots.find(listener);\n\t\tif (existingSlot == null) return true;\n\n\t\t#if debug\n\t\tif (existingSlot.once != once)\n\t\t{\n\t\t\t// If the listener was previously added, definitely don't add it again.\n\t\t\t// But throw an exception if their once values differ.\n\t\t\tthrow \"You cannot addOnce() then add() the same listener without removing the relationship first.\";\n\t\t}\n\t\t#end\n\t\t\n\t\treturn false; // Listener was already registered.\n\t}\n\n\tfunction createSlot(listener:TListener, ?once:Bool=false, ?priority:Int=0):TSlot\n\t{\n\t\treturn null;\n\t}\n\n\tfunction get_numListeners()\n\t{\n\t\treturn slots.length;\n\t}\n}\n\n/**\n\tSignal that executes listeners with no arguments.\n**/\nclass Signal0 extends Signal Void>\n{\n\tpublic function new()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with no arguements.\n\t**/\n\tpublic function dispatch()\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute();\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:Void -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot0(this, listener, once, priority);\n\t}\n}\n\n/**\n\tSignal that executes listeners with one arguments.\n**/\nclass Signal1 extends Signal, TValue -> Void>\n{\n\tpublic function new(?type:Dynamic=null)\n\t{\n\t\tsuper([type]);\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with one arguement.\n\t**/\n\tpublic function dispatch(value:TValue)\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute(value);\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:TValue -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot1(this, listener, once, priority);\n\t}\n}\n\n/**\n\tSignal that executes listeners with two arguments.\n**/\nclass Signal2 extends Signal, TValue1 -> TValue2 -> Void>\n{\n\tpublic function new(?type1:Dynamic=null, ?type2:Dynamic=null)\n\t{\n\t\tsuper([type1, type2]);\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with two arguements.\n\t**/\n\tpublic function dispatch(value1:TValue1, value2:TValue2)\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute(value1, value2);\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:TValue1 -> TValue2 -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot2(this, listener, once, priority);\n\t}\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nimport msignal.Signal;\n\n/**\n\tA convenience type describing any kind of slot.\n**/\ntypedef AnySlot = Slot;\n\n/**\n\tDefines the basic properties of a listener associated with a Signal.\n**/\n#if haxe3\nclass Slot\n#else\nclass Slot, TListener>\n#end\n{\n\t/**\n\t\tThe listener associated with this slot.\n\t\tNote: for hxcpp 2.10 this requires a getter method to compile\n\t**/\n\t#if cpp\n\t#if haxe3 @:isVar #end\n\tpublic var listener(get_listener, set_listener):TListener;\n\t#else\n\t#if haxe3 @:isVar #end\n\tpublic var listener(default, set_listener):TListener;\n\t#end\n\t\n\n\t/**\n\t\tWhether this slot is automatically removed after it has been used once.\n\t**/\n\tpublic var once(default, null):Bool;\n\n\t/**\n\t\tThe priority of this slot should be given in the execution order.\n\t\tAn Signal will call higher numbers before lower ones.\n\t\tDefaults to 0.\n\t**/\n\tpublic var priority(default, null):Int;\n\n\t/**\n\t\tWhether the listener is called on execution. Defaults to true.\n\t**/\n\tpublic var enabled:Bool;\n\n\tvar signal:TSignal;\n\t\n\tfunction new(signal:TSignal, listener:TListener, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tthis.signal = signal;\n\t\tthis.listener = listener;\n\t\tthis.once = once;\n\t\tthis.priority = priority;\n\t\tthis.enabled = true;\n\t}\n\n\t/**\n\t\tRemoves the slot from its signal.\n\t**/\n\tpublic function remove()\n\t{\n\t\tsignal.remove(listener);\n\t}\n\n\t#if cpp\n\t/**\n\t\tHxcpp 2.10 requires a getter method for a typed function property in \n\t\torder to compile\n\t**/\n\tfunction get_listener():TListener\n\t{\n\t\treturn listener;\n\t}\n\t#end\n\n\tfunction set_listener(value:TListener):TListener\n\t{\n\t\t#if debug\n\t\tif (value == null) throw \"listener cannot be null\";\n\t\t#end\n\t\treturn listener = value;\n\t}\n}\n\n/**\n\tA slot that executes a listener with no arguments.\n**/\nclass Slot0 extends Slot Void>\n{\n\tpublic function new(signal:Signal0, listener:Void -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with no arguments.\n\t**/\n\tpublic function execute()\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\tlistener();\n\t}\n}\n\n/**\n\tA slot that executes a listener with one argument.\n**/\nclass Slot1 extends Slot, TValue -> Void>\n{\n\t/**\n\t\tAllows the slot to inject the argument to dispatch.\n\t**/\n\tpublic var param:TValue;\n\n\tpublic function new(signal:Signal1, listener:TValue -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with one argument.\n\t\tIf param is not null, it overrides the value provided.\n\t**/\n\tpublic function execute(value1:TValue)\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\tif (param != null) value1 = param;\n\t\tlistener(value1);\n\t}\n}\n\n/**\n\tA slot that executes a listener with two arguments.\n**/\nclass Slot2 extends Slot, TValue1 -> TValue2 -> Void>\n{\n\t/**\n\t\tAllows the slot to inject the first argument to dispatch.\n\t**/\n\tpublic var param1:TValue1;\n\n\t/**\n\t\tAllows the slot to inject the second argument to dispatch.\n\t**/\n\tpublic var param2:TValue2;\n\n\tpublic function new(signal:Signal2, listener:TValue1 -> TValue2 -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with two arguments.\n\t\tIf param1 or param2 is set, \n\t\tthey override the values provided.\n\t**/\n\tpublic function execute(value1:TValue1, value2:TValue2)\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\t\n\t\tif (param1 != null) value1 = param1;\n\t\tif (param2 != null) value2 = param2;\n\t\t\n\t\tlistener(value1, value2);\n\t}\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nclass SlotList, TListener>\n{\n\t@:IgnoreCover\n\tstatic function __init__() { NIL = new SlotList(null, null); }\n\t\n\t/**\n\t\tRepresents an empty list. Used as the list terminator.\n\t**/\n\tpublic static var NIL:SlotList;\n\t\n\tpublic var head:TSlot;\n\tpublic var tail:SlotList;\n\tpublic var nonEmpty:Bool;\n\t\n\t/**\n\t\tCreates and returns a new SlotList object.\n\n\t\t

A user never has to create a SlotList manually. \n\t\tUse the NIL element to represent an empty list. \n\t\tNIL.prepend(value) would create a list containing \n\t\tvalue

.\n\n\t\t@param head The first slot in the list.\n\t\t@param tail A list containing all slots except head.\n\t**/\n\tpublic function new(head:TSlot, ?tail:SlotList=null)\n\t{\n\t\tnonEmpty = false;\n\t\t\n\t\tif (head == null && tail == null)\n\t\t{\n\t\t\t#if debug\n\t\t\tif (NIL != null) throw \"Parameters head and tail are null. Use the NIL element instead.\";\n\t\t\t#end\n\n\t\t\t// this is the NIL element as per definition\n\t\t\tnonEmpty = false;\n\t\t}\n\t\telse if (head == null)\n\t\t{\n\t\t\t#if debug\n\t\t\tthrow \"Parameter head cannot be null.\";\n\t\t\t#end\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.head = head;\n\t\t\tthis.tail = (tail == null ? cast NIL : tail);\n\t\t\tnonEmpty = true;\n\t\t}\n\t}\n\t\n\t/**\n\t\tThe number of slots in the list.\n\t**/\n\tpublic var length(get_length, null):Int;\n\tfunction get_length():Int\n\t{\n\t\tif (!nonEmpty) return 0;\n\t\tif (tail == NIL) return 1;\n\t\t\n\t\t// We could cache the length, but it would make methods like filterNot unnecessarily complicated.\n\t\t// Instead we assume that O(n) is okay since the length property is used in rare cases.\n\t\t// We could also cache the length lazy, but that is a waste of another 8b per list node (at least).\n\t\t\n\t\tvar result = 0;\n\t\tvar p = this;\n\t\t\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\t++result;\n\t\t\tp = p.tail;\n\t\t}\n\t\t\n\t\treturn result;\n\t}\n\t\n\t/**\n\t\tPrepends a slot to this list.\n\t\t@param\tslot The item to be prepended.\n\t\t@return\tA list consisting of slot followed by all elements of this list.\n\t**/\n\tpublic function prepend(slot:TSlot)\n\t{\n\t\treturn new SlotList(slot, this);\n\t}\n\t\n\t/**\n\t\tAppends a slot to this list.\n\t\tNote: appending is O(n). Where possible, prepend which is O(1).\n\t\tIn some cases, many list items must be cloned to \n\t\tavoid changing existing lists.\n\t\t@param\tslot The item to be appended.\n\t\t@return\tA list consisting of all elements of this list followed by slot.\n\t**/\n\tpublic function append(slot:TSlot)\n\t{\n\t\tif (slot == null) return this;\n\t\tif (!nonEmpty) return new SlotList(slot);\n\t\t\n\t\t// Special case: just one slot currently in the list.\n\t\tif (tail == NIL) \n\t\t{\n\t\t\treturn new SlotList(slot).prepend(head);\n\t\t}\n\t\t\n\t\t// The list already has two or more slots.\n\t\t// We have to build a new list with cloned items because they are immutable.\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\t\t\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// Append the new slot last.\n\t\tsubClone.tail = new SlotList(slot);\n\t\treturn wholeClone;\n\t}\t\t\n\t\n\t/**\n\t\tInsert a slot into the list in a position according to its priority.\n\t\tThe higher the priority, the closer the item will be inserted to the \n\t\tlist head.\n\t\t@param slot The item to be inserted.\n\t**/\n\tpublic function insertWithPriority(slot:TSlot)\n\t{\n\t\tif (!nonEmpty) return new SlotList(slot);\n\t\t\n\t\tvar priority:Int = slot.priority;\n\t\t\n\t\t// Special case: new slot has the highest priority.\n\t\tif (priority >= this.head.priority) return prepend(slot);\n\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\n\t\t// Find a slot with lower priority and go in front of it.\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tif (priority > current.head.priority)\n\t\t\t{\n\t\t\t\tsubClone.tail = current.prepend(slot);\n\t\t\t\treturn wholeClone;\n\t\t\t}\n\t\t\t\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// Slot has lowest priority.\n\t\tsubClone.tail = new SlotList(slot);\n\t\treturn wholeClone;\n\t}\n\t\n\t/**\n\t\tReturns the slots in this list that do not contain the supplied \n\t\tlistener. Note: assumes the listener is not repeated within the list.\n\t\t@param\tlistener The function to remove.\n\t\t@return A list consisting of all elements of this list that do not \n\t\t\t\thave listener.\n\t**/\n\tpublic function filterNot(listener:TListener)\n\t{\n\t\tif (!nonEmpty || listener == null) return this;\n\t\t\n\t\tif (Reflect.compareMethods(head.listener, listener)) return tail;\n\t\t\n\t\t// The first item wasn't a match so the filtered list will contain it.\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\t\t\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(current.head.listener, listener))\n\t\t\t{\n\t\t\t\t// Splice out the current head.\n\t\t\t\tsubClone.tail = current.tail;\n\t\t\t\treturn wholeClone;\n\t\t\t}\n\t\t\t\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// The listener was not found so this list is unchanged.\n\t\treturn this;\n\t}\n\t\n\t/**\n\t\tDetermines whether the supplied listener Function is contained \n\t\twithin this list\n\t**/\n\tpublic function contains(listener:TListener):Bool\n\t{\n\t\tif (!nonEmpty) return false;\n\n\t\tvar p = this;\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(p.head.listener, listener)) return true;\n\t\t\tp = p.tail;\n\t\t}\n\n\t\treturn false;\n\t}\n\t\n\t/**\n\t\tRetrieves the Slot associated with a supplied listener within the SlotList.\n\t\t@param listener The Function being searched for\n\t\t@return The ISlot in this list associated with the listener parameter \n\t\t\t\t through the ISlot.listener property. Returns null if no such \n\t\t\t\t ISlot instance exists or the list is empty. \n\t**/\n\tpublic function find(listener:TListener):TSlot\n\t{\n\t\tif (!nonEmpty) return null;\n\t\t\n\t\tvar p = this;\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(p.head.listener, listener)) return p.head;\n\t\t\tp = p.tail;\n\t\t}\n\t\t\n\t\treturn null;\n\t}\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.audio;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.graphics.Graphics;\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.text.Text;\nimport pixi.core.display.Container;\nimport msignal.Signal;\n\nclass Button extends Container {\n\n\tpublic static inline var OVER_COLOUR:Int = 0xDF7401;\n\tpublic static inline var OUT_COLOUR:Int = 0x2E64FE;\n\tpublic static inline var TEXT_COLOUR:String = \"#FFFFFF\";\n\tpublic static inline var FONT_SIZE:Int = 12;\n\n\tvar _data:Dynamic;\n\n\tvar _label:Text;\n\tvar _rect:Rectangle;\n\tvar _background:Graphics;\n\n\tvar _enabled:Bool;\n\n\tpublic var action:Signal1;\n\n\tpublic function new(label:String, width:Float, height:Float, ?data:Dynamic, ?fontSize:Int) {\n\t\tsuper();\n\t\taction = new Signal1(Dynamic);\n\t\t_data = data;\n\t\t_setupBackground(width, height);\n\t\t_setupLabel(width, height, fontSize);\n\t\tsetText(label);\n\t}\n\n\tfunction _setupBackground(width:Float, height:Float) {\n\t\t_rect = new Rectangle(0, 0, width, height);\n\t\t_background = new Graphics();\n\t\t_background.interactive = true;\n\t\t_redraw(Button.OUT_COLOUR);\n\t\taddChild(_background);\n\n\t\t_background.interactive = true;\n\t\t_background.on(\"mouseover\", _onMouseOver);\n\t\t_background.on(\"mouseout\", _onMouseOut);\n\t\t_background.on(\"mousedown\", _onMouseDown);\n\t\t_background.on(\"mouseup\", _onMouseUp);\n\t\t_background.on(\"mouseupoutside\", _onMouseUpOutside);\n\t\t_background.on(\"touchstart\", _onTouchStart);\n\t\t_background.on(\"touchend\", _onTouchEnd);\n\t\t_background.on(\"touchendoutside\", _onTouchEndOutside);\n\t}\n\n\tfunction _setupLabel(width:Float, height:Float, fontSize:Int) {\n\t\tvar size:Int = (fontSize != null) ? fontSize : Button.FONT_SIZE;\n\t\tvar style:TextStyle = {};\n\t\tstyle.font = (size) + \"px Arial\";\n\t\tstyle.fill = Button.TEXT_COLOUR;\n\t\t_label = new Text(\"\", style);\n\t\t_label.anchor.set(0.5);\n\t\t_label.x = width / 2;\n\t\t_label.y = height / 2;\n\t\taddChild(_label);\n\t}\n\n\tfunction _redraw(colour:Int) {\n\t\tvar border:Float = 1;\n\t\t_background.clear();\n\t\t_background.beginFill(0x003366);\n\t\t_background.drawRect(_rect.x, _rect.y, _rect.width, _rect.height);\n\t\t_background.endFill();\n\t\t_background.beginFill(colour);\n\t\t_background.drawRect(_rect.x + border / 2, _rect.y + border / 2, _rect.width - border, _rect.height - border);\n\t\t_background.endFill();\n\t}\n\n\tpublic inline function setText(label:String) {\n\t\t_label.text = label;\n\t}\n\n\tfunction _onMouseDown(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tfunction _onMouseUp(target:EventTarget) {\n\t\tif (_enabled) {\n\t\t\taction.dispatch(_data);\n\t\t\t_redraw(Button.OUT_COLOUR);\n\t\t}\n\t}\n\n\tfunction _onMouseUpOutside(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onMouseOver(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tfunction _onMouseOut(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onTouchEndOutside(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onTouchEnd(target:EventTarget) {\n\t\tif (_enabled) {\n\t\t\t_redraw(Button.OUT_COLOUR);\n\t\t\taction.dispatch(_data);\n\t\t}\n\t}\n\n\tfunction _onTouchStart(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tpublic inline function enable() {\n\t\t_enabled = true;\n\t}\n\n\tpublic function disable() {\n\t\t_redraw(Button.OUT_COLOUR);\n\t\t_enabled = false;\n\t}\n}","package samples.audio;\n\nimport core.AudioAsset;\nimport core.AssetLoader;\nimport pixi.loaders.Loader;\nimport pixi.core.display.Container;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:AssetLoader;\n\tvar _img:Sprite;\n\tvar _baseURL:String;\n\n\tvar _btnContainer:Container;\n\n\tvar _bgSound:AudioAsset;\n\tvar _sound1:AudioAsset;\n\tvar _sound2:AudioAsset;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tpixelRatio = Math.floor(Browser.window.devicePixelRatio);\n\t\tbackgroundColor = 0x5F04B4;\n\t\tsuper.start();\n\n\t\t_baseURL = \"assets/audio/\";\n\n\t\t_loader = new AssetLoader();\n\t\t_loader.baseUrl = _baseURL;\n\n\t\t_loader.addAudioAsset(\"loop\", \"loop.mp3\");\n\t\t_loader.addAudioAsset(\"sound1\", \"sound1.wav\");\n\t\t_loader.addAudioAsset(\"sound2\", \"sound2.wav\");\n\t\t_loader.start(_onLoaded, _onLoadProgress);\n\n\t\t_btnContainer = new Container();\n\t\tstage.addChild(_btnContainer);\n\t}\n\n\tfunction _onLoadProgress() {\n\t\ttrace(\"Loaded: \" + Math.round(_loader.progress));\n\t}\n\n\tfunction _onLoaded() {\n\t\t_bgSound = _loader.getAudio(\"loop\");\n\t\t_bgSound.loop = true;\n\t\t_bgSound.play();\n\n\t\t_sound1 = _loader.getAudio(\"sound1\");\n\t\t_sound2 = _loader.getAudio(\"sound2\");\n\n\t\t_addButton(\"SOUND 1\", 0, 0, 100, 30, _playSound1);\n\t\t_addButton(\"SOUND 2\", 100, 0, 100, 30, _playSound2);\n\t\t_addButton(\"STOP ALL\", 220, 0, 100, 30, _stopAll);\n\t\t_btnContainer.position.set((Browser.window.innerWidth - 320) / 2, (Browser.window.innerHeight - 30) / 2);\n\t}\n\n\tinline function _playSound1() {\n\t\t_sound1.play();\n\t}\n\n\tinline function _playSound2() {\n\t\t_sound2.play();\n\t}\n\n\tfunction _stopAll() {\n\t\t_bgSound.stop();\n\t\t_sound1.stop();\n\t\t_sound2.stop();\n\t}\n\n\tfunction _addButton(label:String, x:Float, y:Float, width:Float, height:Float, callback:Dynamic) {\n\t\tvar button = new Button(label, width, height);\n\t\tbutton.position.set(x, y);\n\t\tbutton.action.add(callback);\n\t\tbutton.enable();\n\t\t_btnContainer.addChild(button);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n"], +"sourcesContent":["/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class EReg {\n\n\tvar r : HaxeRegExp;\n\n\tpublic function new( r : String, opt : String ) : Void {\n\t\topt = opt.split(\"u\").join(\"\"); // 'u' (utf8) depends on page encoding\n\t\tthis.r = new HaxeRegExp(r, opt);\n\t}\n\n\tpublic function match( s : String ) : Bool {\n\t\tif( r.global ) r.lastIndex = 0;\n\t\tr.m = r.exec(s);\n\t\tr.s = s;\n\t\treturn (r.m != null);\n\t}\n\n\tpublic function matched( n : Int ) : String {\n\t\treturn if( r.m != null && n >= 0 && n < r.m.length ) r.m[n] else throw \"EReg::matched\";\n\t}\n\n\tpublic function matchedLeft() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn r.s.substr(0,r.m.index);\n\t}\n\n\tpublic function matchedRight() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\tvar sz = r.m.index+r.m[0].length;\n\t\treturn r.s.substr(sz,r.s.length-sz);\n\t}\n\n\tpublic function matchedPos() : { pos : Int, len : Int } {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn { pos : r.m.index, len : r.m[0].length };\n\t}\n\n\tpublic function matchSub( s : String, pos : Int, len : Int = -1):Bool {\n\t\treturn if (r.global) {\n\t\t\tr.lastIndex = pos;\n\t\t\tr.m = r.exec(len < 0 ? s : s.substr(0, pos + len));\n\t\t\tvar b = r.m != null;\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t}\n\t\t\tb;\n\t\t} else {\n\t\t\t// TODO: check some ^/$ related corner cases\n\t\t\tvar b = match( len < 0 ? s.substr(pos) : s.substr(pos,len) );\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t\tr.m.index += pos;\n\t\t\t}\n\t\t\tb;\n\t\t}\n\t}\n\n\tpublic function split( s : String ) : Array {\n\t\t// we can't use directly s.split because it's ignoring the 'g' flag\n\t\tvar d = \"#__delim__#\";\n\t\treturn untyped s.replace(r,d).split(d);\n\t}\n\n\tpublic function replace( s : String, by : String ) : String {\n\t\treturn untyped s.replace(r,by);\n\t}\n\n\tpublic function map( s : String, f : EReg -> String ) : String {\n\t\tvar offset = 0;\n\t\tvar buf = new StringBuf();\n\t\tdo {\n\t\t\tif (offset >= s.length)\n\t\t\t\tbreak;\n\t\t\telse if (!matchSub(s, offset)) {\n\t\t\t\tbuf.add(s.substr(offset));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar p = matchedPos();\n\t\t\tbuf.add(s.substr(offset, p.pos - offset));\n\t\t\tbuf.add(f(this));\n\t\t\tif (p.len == 0) {\n\t\t\t\tbuf.add(s.substr(p.pos, 1));\n\t\t\t\toffset = p.pos + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\toffset = p.pos + p.len;\n\t\t} while (r.global);\n\t\tif (!r.global && offset > 0 && offset < s.length)\n\t\t\tbuf.add(s.substr(offset));\n\t\treturn buf.toString();\n\t}\n}\n\n@:native(\"RegExp\")\nprivate extern class HaxeRegExp extends js.RegExp {\n\tvar m:js.RegExp.RegExpMatch;\n\tvar s:String;\n}\n","import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package core;\n\nimport pixi.loaders.Resource;\nimport pixi.core.textures.Texture;\nimport pixi.loaders.Loader;\n\nclass AssetLoader extends Loader {\n\n\tpublic var pixelRatio(null, default):Float;\n\tpublic var count(default, null):Int;\n\tpublic var resolution(default, default):String;\n\tpublic var mute(default, set):Bool;\n\n\tvar _audioAssets:Map;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tcount = 0;\n\t\tpixelRatio = 1;\n\t\t_audioAssets = new Map();\n\t\tMultipackParser.loader = this;\n\t\tuse(MultipackParser.parse);\n\t}\n\n\tpublic function start(?onComplete:Void -> Void, ?onProgress:Void -> Void) {\n\t\tload(onComplete);\n\t\tif (progress != null) on(\"progress\", onProgress);\n\t}\n\n\tpublic inline function addAudioAsset(id:String, path:String, ?onAssetLoaded:Resource -> Void) {\n\t\taddAsset(id, path, false, onAssetLoaded);\n\t}\n\n\tpublic function addAsset(id:String, path:String, ?usePixelRatio:Bool = true, ?onAssetLoaded:Resource -> Void) {\n\t\tif (!exists(id)) {\n\t\t\tvar url:String = path;\n\n\t\t\tif (url != \"\") {\n\t\t\t\tadd(id, url, { loadType: _getLoadtype(path) }, onAssetLoaded);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic inline function getUrl(id:String):String {\n\t\treturn Reflect.field(resources, id) != null ? Reflect.field(resources, id).url : null;\n\t}\n\n\t@SuppressWarnings(\"checkstyle:Dynamic\")\n\tpublic function getJson(id:String):Dynamic {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && ~/(json|text|txt)/i.match(resource.xhrType)) return resource.data;\n\t\treturn null;\n\t}\n\n\tpublic function getTexture(id:String):Texture {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && resource.texture != null) return resource.texture;\n\t\treturn null;\n\t}\n\n\tpublic function getTextureFromSpritesheet(id:String, frame:String):Texture {\n\t\tvar resource:Resource = Reflect.field(resources, id);\n\t\tif (resource != null && resource.isJson && resource.textures != null) {\n\t\t\tvar texture = Reflect.field(resource.textures, frame);\n\t\t\tif (texture != null) return texture;\n\t\t}\n\t\treturn null;\n\t}\n\n\tpublic inline function exists(id:String):Bool {\n\t\treturn (Reflect.field(resources, id) != null);\n\t}\n\n\tpublic function getAudio(id:String):AudioAsset {\n\t\tif (_audioAssets.get(id) == null) _audioAssets.set(id, new AudioAsset(Reflect.field(resources, id).data));\n\t\treturn _audioAssets.get(id);\n\t}\n\n\tpublic function getResource(id:String):Resource {\n\t\treturn Reflect.field(resources, id);\n\t}\n\n\toverride public function reset() {\n\t\tremoveAllListeners();\n\t\tcount = 0;\n\t\tresources = {};\n\t\tsuper.reset();\n\t}\n\n\tpublic inline function getResoultionPath():String {\n\t\treturn (resolution != null) ? resolution + \"/\" : \"\";\n\t}\n\n\tpublic inline function getPixelRatioPath(?val:Float):String {\n\t\treturn (val != null) ? \"scale-\" + val + \"/\" : \"scale-\" + pixelRatio + \"/\";\n\t}\n\n\tfunction set_mute(val:Bool):Bool {\n\t\tfor (audioAsset in _audioAssets) audioAsset.mute = val;\n\t\treturn mute = val;\n\t}\n\n\t//type: XHR: 1, IMAGE: 2, AUDIO: 3, VIDEO: 4\n\n\tfunction _getLoadtype(asset:String):Int {\n\t\tif (~/(.png|.gif|.svg|.jpg|.jpeg|.bmp)/i.match(asset)) return 2;\n\t\telse if (~/(.mp3|.wav|.ogg|.aac|.m4a|.oga|.webma)/i.match(asset)) return 3;\n\t\telse if (~/(.mp4|.webm|.m3u8)/i.match(asset)) return 4;\n\t\treturn 1;\n\t}\n}\n","package core;\n\nimport js.html.Audio;\n\nclass AudioAsset {\n\n\tpublic var mute:Bool;\n\tpublic var loop(default, set):Bool;\n\n\tvar _src:Audio;\n\n\tpublic function new(src:Audio) {\n\t\t_src = src;\n\t\tmute = false;\n\t\tloop = false;\n\t}\n\n\tpublic function play() {\n\t\tif (!mute) _src.play();\n\t}\n\n\tpublic function stop() {\n\t\t_src.pause();\n\t}\n\n\tfunction set_loop(val:Bool):Bool {\n\t\t_src.loop = val;\n\t\treturn loop = val;\n\t}\n}","package core;\n\nimport pixi.loaders.Resource;\nimport pixi.core.utils.Utils;\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.textures.Texture;\n\nclass MultipackParser {\n\n\tpublic static var loader:AssetLoader;\n\n\tpublic static function parse(resource:Resource, next:Void -> Void) {\n\t\tvar data:MultipackSpriteSheet = resource.data;\n\t\tif (data != null && data.multipack) {\n\t\t\tvar textures:Array = data.textures;\n\t\t\tvar imgCount:Int = textures.length;\n\t\t\tvar imgLoadedCount:Int = 0;\n\t\t\tvar resolution:Float = Utils.getResolutionOfUrl(resource.url);\n\n\t\t\tvar baseURL:String = resource.url.split(loader.baseUrl)[1];\n\t\t\tbaseURL = baseURL.substring(0, baseURL.lastIndexOf(\"/\") + 1);\n\n\t\t\tfor (texture in textures) {\n\t\t\t\tvar url:String = baseURL + texture.meta.image;\n\t\t\t\tloader.add(texture.meta.image, url, { loadType: 2, crossOrigin:resource.crossOrigin }, function(image:Resource) {\n\n\t\t\t\t\tvar frames:Array = texture.frames;\n\t\t\t\t\tfor (n in Reflect.fields(frames)) {\n\t\t\t\t\t\tvar frameData:FrameData = Reflect.field(frames, n);\n\t\t\t\t\t\tvar rect = frameData.frame;\n\t\t\t\t\t\tif (rect != null) {\n\t\t\t\t\t\t\tvar size:Rectangle = new Rectangle(rect.x, rect.y, rect.w, rect.h);\n\t\t\t\t\t\t\tvar trim:Rectangle = null;\n\n\t\t\t\t\t\t\tif (frameData.trimmed) {\n\t\t\t\t\t\t\t\tvar actualSize = frameData.sourceSize;\n\t\t\t\t\t\t\t\tvar realSize = frameData.spriteSourceSize;\n\t\t\t\t\t\t\t\ttrim = new Rectangle(realSize.x / resolution, realSize.y / resolution, actualSize.w / resolution, actualSize.h / resolution);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsize.x /= resolution;\n\t\t\t\t\t\t\tsize.y /= resolution;\n\t\t\t\t\t\t\tsize.width /= resolution;\n\t\t\t\t\t\t\tsize.height /= resolution;\n\n\t\t\t\t\t\t\tTexture.addTextureToCache(new Texture(image.texture.baseTexture, size, size.clone(), trim), n);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tnext();\n\t\t}\n\t\telse next();\n\t}\n}\n\ntypedef MultipackSpriteSheet = {\n\tvar multipack:Bool;\n\tvar textures:Array;\n}\n\ntypedef MultipackTexture = {\n\tvar frames:Array;\n\tvar meta:MetaData;\n}\n\ntypedef FrameData = {\n\tvar frame:Frame;\n\tvar rotated:Bool;\n\tvar trimmed:Bool;\n\tvar format:String;\n\tvar spriteSourceSize:SpriteSourceSize;\n\tvar sourceSize:SourceSize;\n}\n\ntypedef Frame = {\n\tvar x:Float;\n\tvar y:Float;\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef SpriteSourceSize = {\n\tvar x:Float;\n\tvar y:Float;\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef SourceSize = {\n\tvar w:Float;\n\tvar h:Float;\n}\n\ntypedef MetaData = {\n\tvar app:String;\n\tvar version:String;\n\tvar image:String;\n\tvar format:String;\n\tvar size:String;\n\tvar scale:String;\n\tvar smartupdate:String;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage haxe.ds;\n\nprivate class StringMapIterator {\n\tvar map : StringMap;\n\tvar keys : Array;\n\tvar index : Int;\n\tvar count : Int;\n\tpublic inline function new(map:StringMap, keys:Array) {\n\t\tthis.map = map;\n\t\tthis.keys = keys;\n\t\tthis.index = 0;\n\t\tthis.count = keys.length;\n\t}\n\tpublic inline function hasNext() {\n\t\treturn index < count;\n\t}\n\tpublic inline function next() {\n\t\treturn map.get(keys[index++]);\n\t}\n}\n\n@:coreApi class StringMap implements haxe.Constraints.IMap {\n\n\tprivate var h : Dynamic;\n\tprivate var rh : Dynamic;\n\n\tpublic inline function new() : Void {\n\t\th = {};\n\t}\n\n\tinline function isReserved(key:String) : Bool {\n\t\treturn untyped __js__(\"__map_reserved\")[key] != null;\n\t}\n\n\tpublic inline function set( key : String, value : T ) : Void {\n\t\tif( isReserved(key) )\n\t\t\tsetReserved(key, value);\n\t\telse\n\t\t\th[cast key] = value;\n\t}\n\n\tpublic inline function get( key : String ) : Null {\n\t\tif( isReserved(key) )\n\t\t\treturn getReserved(key);\n\t\treturn h[cast key];\n\t}\n\n\tpublic inline function exists( key : String ) : Bool {\n\t\tif( isReserved(key) )\n\t\t\treturn existsReserved(key);\n\t\treturn h.hasOwnProperty(key);\n\t}\n\n\tfunction setReserved( key : String, value : T ) : Void {\n\t\tif( rh == null ) rh = {};\n\t\trh[cast \"$\"+key] = value;\n\t}\n\n\tfunction getReserved( key : String ) : Null {\n\t\treturn rh == null ? null : rh[cast \"$\"+key];\n\t}\n\n\tfunction existsReserved( key : String ) : Bool {\n\t\tif( rh == null ) return false;\n\t\treturn untyped rh.hasOwnProperty(\"$\"+key);\n\t}\n\n\tpublic function remove( key : String ) : Bool {\n\t\tif( isReserved(key) ) {\n\t\t\tkey = \"$\" + key;\n\t\t\tif( rh == null || !rh.hasOwnProperty(key) ) return false;\n\t\t\tuntyped __js__(\"delete\")(rh[key]);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tif( !h.hasOwnProperty(key) )\n\t\t\t\treturn false;\n\t\t\tuntyped __js__(\"delete\")(h[key]);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tpublic function keys() : Iterator {\n\t\treturn arrayKeys().iterator();\n\t}\n\t\n\tfunction arrayKeys() : Array {\n\t\tvar out = [];\n\t\tuntyped {\n\t\t\t__js__(\"for( var key in this.h ) {\");\n\t\t\t\tif( h.hasOwnProperty(key) )\n\t\t\t\t\tout.push(key);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\tif( rh != null ) untyped {\n\t\t\t__js__(\"for( var key in this.rh ) {\");\n\t\t\t\tif( key.charCodeAt(0) == \"$\".code )\n\t\t\t\t\tout.push(key.substr(1));\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn out;\n\t}\n\n\tpublic inline function iterator() : Iterator {\n\t\treturn new StringMapIterator(this, arrayKeys());\n\t}\n\n\tpublic function toString() : String {\n\t\tvar s = new StringBuf();\n\t\ts.add(\"{\");\n\t\tvar keys = arrayKeys();\n\t\tfor( i in 0...keys.length ) {\n\t\t\tvar k = keys[i];\n\t\t\ts.add(k);\n\t\t\ts.add(\" => \");\n\t\t\ts.add(Std.string(get(k)));\n\t\t\tif( i < keys.length )\n\t\t\t\ts.add(\", \");\n\t\t}\n\t\ts.add(\"}\");\n\t\treturn s.toString();\n\t}\n\n\tstatic function __init__() : Void {\n\t\tuntyped __js__(\"var __map_reserved = {}\");\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nimport msignal.Slot;\n\n/**\n\tA convenience type describing any kind of signal.\n**/\ntypedef AnySignal = Signal;\n\n/**\n\tA Signal manages a list of listeners, which are executed when the signal is \n\tdispatched.\n**/\n@:keepSub\nclass Signal, TListener>\n{\n\tpublic var valueClasses:Array;\n\n\t/**\n\t\tThe current number of listeners for the signal.\n\t**/\n\tpublic var numListeners(get, null):Int;\n\t\n\tvar slots:SlotList;\n\tvar priorityBased:Bool;\n\n\tfunction new(?valueClasses:Array)\n\t{\n\t\tif (valueClasses == null) valueClasses = [];\n\t\tthis.valueClasses = valueClasses;\n\t\tslots = cast SlotList.NIL;\n\t\tpriorityBased = false;\n\t}\n\n\t/**\n\t\tSubscribes a listener for the signal.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function add(listener:TListener):TSlot\n\t{\n\t\treturn registerListener(listener);\n\t}\n\n\t/**\n\t\tSubscribes a one-time listener for this signal.\n\t\tThe signal will remove the listener automatically the first time it is called,\n\t\tafter the dispatch to all listeners is complete.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addOnce(listener:TListener):TSlot\n\t{\n\t\treturn registerListener(listener, true);\n\t}\n\n\t/**\n\t\tSubscribes a listener for the signal.\n\t\tAfter you successfully register an event listener,\n\t\tyou cannot change its priority through additional calls to add().\n\t\tTo change a listener's priority, you must first call remove().\n\t\tThen you can register the listener again with the new priority level.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addWithPriority(listener:TListener, ?priority:Int=0):TSlot\n\t{\n\t\treturn registerListener(listener, false, priority);\n\t}\n\n\t/**\n\t\tSubscribes a one-time listener for this signal.\n\t\tThe signal will remove the listener automatically the first time it is \n\t\tcalled, after the dispatch to all listeners is complete.\n\t\t\n\t\t@param listener A function matching the signature of TListener\n\t\t@return The added listener slot\n\t**/\n\tpublic function addOnceWithPriority(listener:TListener, ?priority:Int=0):TSlot\n\t{\n\t\treturn registerListener(listener, true, priority);\n\t}\n\n\t/**\n\t\tUnsubscribes a listener from the signal.\n\t\t\n\t\t@param listener The listener to remove\n\t\t@return The removed listener slot\n\t**/\n\tpublic function remove(listener:TListener):TSlot\n\t{\n\t\tvar slot = slots.find(listener);\n\t\tif (slot == null) return null;\n\t\t\n\t\tslots = slots.filterNot(listener);\n\t\treturn slot;\n\t}\n\n\t/**\n\t\tUnsubscribes all listeners from the signal.\n\t**/\n\tpublic function removeAll():Void\n\t{\n\t\tslots = cast SlotList.NIL;\n\t}\n\n\tfunction registerListener(listener:TListener, ?once:Bool=false, ?priority:Int=0):TSlot\n\t{\n\t\tif (registrationPossible(listener, once))\n\t\t{\n\t\t\tvar newSlot = createSlot(listener, once, priority);\n\t\t\t\n\t\t\tif (!priorityBased && priority != 0) priorityBased = true;\n\t\t\tif (!priorityBased && priority == 0) slots = slots.prepend(newSlot);\n\t\t\telse slots = slots.insertWithPriority(newSlot);\n\n\t\t\treturn newSlot;\n\t\t}\n\t\t\n\t\treturn slots.find(listener);\n\t}\n\n\tfunction registrationPossible(listener, once)\n\t{\n\t\tif (!slots.nonEmpty) return true;\n\t\t\n\t\tvar existingSlot = slots.find(listener);\n\t\tif (existingSlot == null) return true;\n\n\t\t#if debug\n\t\tif (existingSlot.once != once)\n\t\t{\n\t\t\t// If the listener was previously added, definitely don't add it again.\n\t\t\t// But throw an exception if their once values differ.\n\t\t\tthrow \"You cannot addOnce() then add() the same listener without removing the relationship first.\";\n\t\t}\n\t\t#end\n\t\t\n\t\treturn false; // Listener was already registered.\n\t}\n\n\tfunction createSlot(listener:TListener, ?once:Bool=false, ?priority:Int=0):TSlot\n\t{\n\t\treturn null;\n\t}\n\n\tfunction get_numListeners()\n\t{\n\t\treturn slots.length;\n\t}\n}\n\n/**\n\tSignal that executes listeners with no arguments.\n**/\nclass Signal0 extends Signal Void>\n{\n\tpublic function new()\n\t{\n\t\tsuper();\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with no arguements.\n\t**/\n\tpublic function dispatch()\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute();\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:Void -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot0(this, listener, once, priority);\n\t}\n}\n\n/**\n\tSignal that executes listeners with one arguments.\n**/\nclass Signal1 extends Signal, TValue -> Void>\n{\n\tpublic function new(?type:Dynamic=null)\n\t{\n\t\tsuper([type]);\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with one arguement.\n\t**/\n\tpublic function dispatch(value:TValue)\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute(value);\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:TValue -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot1(this, listener, once, priority);\n\t}\n}\n\n/**\n\tSignal that executes listeners with two arguments.\n**/\nclass Signal2 extends Signal, TValue1 -> TValue2 -> Void>\n{\n\tpublic function new(?type1:Dynamic=null, ?type2:Dynamic=null)\n\t{\n\t\tsuper([type1, type2]);\n\t}\n\n\t/**\n\t\tExecutes the signals listeners with two arguements.\n\t**/\n\tpublic function dispatch(value1:TValue1, value2:TValue2)\n\t{\n\t\tvar slotsToProcess = slots;\n\t\t\n\t\twhile (slotsToProcess.nonEmpty)\n\t\t{\n\t\t\tslotsToProcess.head.execute(value1, value2);\n\t\t\tslotsToProcess = slotsToProcess.tail;\n\t\t}\n\t}\n\n\toverride function createSlot(listener:TValue1 -> TValue2 -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\treturn new Slot2(this, listener, once, priority);\n\t}\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nimport msignal.Signal;\n\n/**\n\tA convenience type describing any kind of slot.\n**/\ntypedef AnySlot = Slot;\n\n/**\n\tDefines the basic properties of a listener associated with a Signal.\n**/\n#if haxe3\nclass Slot\n#else\nclass Slot, TListener>\n#end\n{\n\t/**\n\t\tThe listener associated with this slot.\n\t\tNote: for hxcpp 2.10 this requires a getter method to compile\n\t**/\n\t#if cpp\n\t#if haxe3 @:isVar #end\n\tpublic var listener(get_listener, set_listener):TListener;\n\t#else\n\t#if haxe3 @:isVar #end\n\tpublic var listener(default, set_listener):TListener;\n\t#end\n\t\n\n\t/**\n\t\tWhether this slot is automatically removed after it has been used once.\n\t**/\n\tpublic var once(default, null):Bool;\n\n\t/**\n\t\tThe priority of this slot should be given in the execution order.\n\t\tAn Signal will call higher numbers before lower ones.\n\t\tDefaults to 0.\n\t**/\n\tpublic var priority(default, null):Int;\n\n\t/**\n\t\tWhether the listener is called on execution. Defaults to true.\n\t**/\n\tpublic var enabled:Bool;\n\n\tvar signal:TSignal;\n\t\n\tfunction new(signal:TSignal, listener:TListener, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tthis.signal = signal;\n\t\tthis.listener = listener;\n\t\tthis.once = once;\n\t\tthis.priority = priority;\n\t\tthis.enabled = true;\n\t}\n\n\t/**\n\t\tRemoves the slot from its signal.\n\t**/\n\tpublic function remove()\n\t{\n\t\tsignal.remove(listener);\n\t}\n\n\t#if cpp\n\t/**\n\t\tHxcpp 2.10 requires a getter method for a typed function property in \n\t\torder to compile\n\t**/\n\tfunction get_listener():TListener\n\t{\n\t\treturn listener;\n\t}\n\t#end\n\n\tfunction set_listener(value:TListener):TListener\n\t{\n\t\t#if debug\n\t\tif (value == null) throw \"listener cannot be null\";\n\t\t#end\n\t\treturn listener = value;\n\t}\n}\n\n/**\n\tA slot that executes a listener with no arguments.\n**/\nclass Slot0 extends Slot Void>\n{\n\tpublic function new(signal:Signal0, listener:Void -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with no arguments.\n\t**/\n\tpublic function execute()\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\tlistener();\n\t}\n}\n\n/**\n\tA slot that executes a listener with one argument.\n**/\nclass Slot1 extends Slot, TValue -> Void>\n{\n\t/**\n\t\tAllows the slot to inject the argument to dispatch.\n\t**/\n\tpublic var param:TValue;\n\n\tpublic function new(signal:Signal1, listener:TValue -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with one argument.\n\t\tIf param is not null, it overrides the value provided.\n\t**/\n\tpublic function execute(value1:TValue)\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\tif (param != null) value1 = param;\n\t\tlistener(value1);\n\t}\n}\n\n/**\n\tA slot that executes a listener with two arguments.\n**/\nclass Slot2 extends Slot, TValue1 -> TValue2 -> Void>\n{\n\t/**\n\t\tAllows the slot to inject the first argument to dispatch.\n\t**/\n\tpublic var param1:TValue1;\n\n\t/**\n\t\tAllows the slot to inject the second argument to dispatch.\n\t**/\n\tpublic var param2:TValue2;\n\n\tpublic function new(signal:Signal2, listener:TValue1 -> TValue2 -> Void, ?once:Bool=false, ?priority:Int=0)\n\t{\n\t\tsuper(signal, listener, once, priority);\n\t}\n\n\t/**\n\t\tExecutes a listener with two arguments.\n\t\tIf param1 or param2 is set, \n\t\tthey override the values provided.\n\t**/\n\tpublic function execute(value1:TValue1, value2:TValue2)\n\t{\n\t\tif (!enabled) return;\n\t\tif (once) remove();\n\t\t\n\t\tif (param1 != null) value1 = param1;\n\t\tif (param2 != null) value2 = param2;\n\t\t\n\t\tlistener(value1, value2);\n\t}\n}\n","/*\nCopyright (c) 2012 Massive Interactive\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of \nthis software and associated documentation files (the \"Software\"), to deal in \nthe Software without restriction, including without limitation the rights to \nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies \nof the Software, and to permit persons to whom the Software is furnished to do \nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all \ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE \nSOFTWARE.\n*/\n\npackage msignal;\n\nclass SlotList, TListener>\n{\n\t@:IgnoreCover\n\tstatic function __init__() { NIL = new SlotList(null, null); }\n\t\n\t/**\n\t\tRepresents an empty list. Used as the list terminator.\n\t**/\n\tpublic static var NIL:SlotList;\n\t\n\tpublic var head:TSlot;\n\tpublic var tail:SlotList;\n\tpublic var nonEmpty:Bool;\n\t\n\t/**\n\t\tCreates and returns a new SlotList object.\n\n\t\t

A user never has to create a SlotList manually. \n\t\tUse the NIL element to represent an empty list. \n\t\tNIL.prepend(value) would create a list containing \n\t\tvalue

.\n\n\t\t@param head The first slot in the list.\n\t\t@param tail A list containing all slots except head.\n\t**/\n\tpublic function new(head:TSlot, ?tail:SlotList=null)\n\t{\n\t\tnonEmpty = false;\n\t\t\n\t\tif (head == null && tail == null)\n\t\t{\n\t\t\t#if debug\n\t\t\tif (NIL != null) throw \"Parameters head and tail are null. Use the NIL element instead.\";\n\t\t\t#end\n\n\t\t\t// this is the NIL element as per definition\n\t\t\tnonEmpty = false;\n\t\t}\n\t\telse if (head == null)\n\t\t{\n\t\t\t#if debug\n\t\t\tthrow \"Parameter head cannot be null.\";\n\t\t\t#end\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthis.head = head;\n\t\t\tthis.tail = (tail == null ? cast NIL : tail);\n\t\t\tnonEmpty = true;\n\t\t}\n\t}\n\t\n\t/**\n\t\tThe number of slots in the list.\n\t**/\n\tpublic var length(get_length, null):Int;\n\tfunction get_length():Int\n\t{\n\t\tif (!nonEmpty) return 0;\n\t\tif (tail == NIL) return 1;\n\t\t\n\t\t// We could cache the length, but it would make methods like filterNot unnecessarily complicated.\n\t\t// Instead we assume that O(n) is okay since the length property is used in rare cases.\n\t\t// We could also cache the length lazy, but that is a waste of another 8b per list node (at least).\n\t\t\n\t\tvar result = 0;\n\t\tvar p = this;\n\t\t\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\t++result;\n\t\t\tp = p.tail;\n\t\t}\n\t\t\n\t\treturn result;\n\t}\n\t\n\t/**\n\t\tPrepends a slot to this list.\n\t\t@param\tslot The item to be prepended.\n\t\t@return\tA list consisting of slot followed by all elements of this list.\n\t**/\n\tpublic function prepend(slot:TSlot)\n\t{\n\t\treturn new SlotList(slot, this);\n\t}\n\t\n\t/**\n\t\tAppends a slot to this list.\n\t\tNote: appending is O(n). Where possible, prepend which is O(1).\n\t\tIn some cases, many list items must be cloned to \n\t\tavoid changing existing lists.\n\t\t@param\tslot The item to be appended.\n\t\t@return\tA list consisting of all elements of this list followed by slot.\n\t**/\n\tpublic function append(slot:TSlot)\n\t{\n\t\tif (slot == null) return this;\n\t\tif (!nonEmpty) return new SlotList(slot);\n\t\t\n\t\t// Special case: just one slot currently in the list.\n\t\tif (tail == NIL) \n\t\t{\n\t\t\treturn new SlotList(slot).prepend(head);\n\t\t}\n\t\t\n\t\t// The list already has two or more slots.\n\t\t// We have to build a new list with cloned items because they are immutable.\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\t\t\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// Append the new slot last.\n\t\tsubClone.tail = new SlotList(slot);\n\t\treturn wholeClone;\n\t}\t\t\n\t\n\t/**\n\t\tInsert a slot into the list in a position according to its priority.\n\t\tThe higher the priority, the closer the item will be inserted to the \n\t\tlist head.\n\t\t@param slot The item to be inserted.\n\t**/\n\tpublic function insertWithPriority(slot:TSlot)\n\t{\n\t\tif (!nonEmpty) return new SlotList(slot);\n\t\t\n\t\tvar priority:Int = slot.priority;\n\t\t\n\t\t// Special case: new slot has the highest priority.\n\t\tif (priority >= this.head.priority) return prepend(slot);\n\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\n\t\t// Find a slot with lower priority and go in front of it.\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tif (priority > current.head.priority)\n\t\t\t{\n\t\t\t\tsubClone.tail = current.prepend(slot);\n\t\t\t\treturn wholeClone;\n\t\t\t}\n\t\t\t\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// Slot has lowest priority.\n\t\tsubClone.tail = new SlotList(slot);\n\t\treturn wholeClone;\n\t}\n\t\n\t/**\n\t\tReturns the slots in this list that do not contain the supplied \n\t\tlistener. Note: assumes the listener is not repeated within the list.\n\t\t@param\tlistener The function to remove.\n\t\t@return A list consisting of all elements of this list that do not \n\t\t\t\thave listener.\n\t**/\n\tpublic function filterNot(listener:TListener)\n\t{\n\t\tif (!nonEmpty || listener == null) return this;\n\t\t\n\t\tif (Reflect.compareMethods(head.listener, listener)) return tail;\n\t\t\n\t\t// The first item wasn't a match so the filtered list will contain it.\n\t\tvar wholeClone = new SlotList(head);\n\t\tvar subClone = wholeClone;\n\t\tvar current = tail;\n\t\t\n\t\twhile (current.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(current.head.listener, listener))\n\t\t\t{\n\t\t\t\t// Splice out the current head.\n\t\t\t\tsubClone.tail = current.tail;\n\t\t\t\treturn wholeClone;\n\t\t\t}\n\t\t\t\n\t\t\tsubClone = subClone.tail = new SlotList(current.head);\n\t\t\tcurrent = current.tail;\n\t\t}\n\t\t\n\t\t// The listener was not found so this list is unchanged.\n\t\treturn this;\n\t}\n\t\n\t/**\n\t\tDetermines whether the supplied listener Function is contained \n\t\twithin this list\n\t**/\n\tpublic function contains(listener:TListener):Bool\n\t{\n\t\tif (!nonEmpty) return false;\n\n\t\tvar p = this;\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(p.head.listener, listener)) return true;\n\t\t\tp = p.tail;\n\t\t}\n\n\t\treturn false;\n\t}\n\t\n\t/**\n\t\tRetrieves the Slot associated with a supplied listener within the SlotList.\n\t\t@param listener The Function being searched for\n\t\t@return The ISlot in this list associated with the listener parameter \n\t\t\t\t through the ISlot.listener property. Returns null if no such \n\t\t\t\t ISlot instance exists or the list is empty. \n\t**/\n\tpublic function find(listener:TListener):TSlot\n\t{\n\t\tif (!nonEmpty) return null;\n\t\t\n\t\tvar p = this;\n\t\twhile (p.nonEmpty)\n\t\t{\n\t\t\tif (Reflect.compareMethods(p.head.listener, listener)) return p.head;\n\t\t\tp = p.tail;\n\t\t}\n\t\t\n\t\treturn null;\n\t}\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.audio;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.graphics.Graphics;\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.text.Text;\nimport pixi.core.display.Container;\nimport msignal.Signal;\n\nclass Button extends Container {\n\n\tpublic static inline var OVER_COLOUR:Int = 0xDF7401;\n\tpublic static inline var OUT_COLOUR:Int = 0x2E64FE;\n\tpublic static inline var TEXT_COLOUR:String = \"#FFFFFF\";\n\tpublic static inline var FONT_SIZE:Int = 12;\n\n\tvar _data:Dynamic;\n\n\tvar _label:Text;\n\tvar _rect:Rectangle;\n\tvar _background:Graphics;\n\n\tvar _enabled:Bool;\n\n\tpublic var action:Signal1;\n\n\tpublic function new(label:String, width:Float, height:Float, ?data:Dynamic, ?fontSize:Int) {\n\t\tsuper();\n\t\taction = new Signal1(Dynamic);\n\t\t_data = data;\n\t\t_setupBackground(width, height);\n\t\t_setupLabel(width, height, fontSize);\n\t\tsetText(label);\n\t}\n\n\tfunction _setupBackground(width:Float, height:Float) {\n\t\t_rect = new Rectangle(0, 0, width, height);\n\t\t_background = new Graphics();\n\t\t_background.interactive = true;\n\t\t_redraw(Button.OUT_COLOUR);\n\t\taddChild(_background);\n\n\t\t_background.interactive = true;\n\t\t_background.on(\"mouseover\", _onMouseOver);\n\t\t_background.on(\"mouseout\", _onMouseOut);\n\t\t_background.on(\"mousedown\", _onMouseDown);\n\t\t_background.on(\"mouseup\", _onMouseUp);\n\t\t_background.on(\"mouseupoutside\", _onMouseUpOutside);\n\t\t_background.on(\"touchstart\", _onTouchStart);\n\t\t_background.on(\"touchend\", _onTouchEnd);\n\t\t_background.on(\"touchendoutside\", _onTouchEndOutside);\n\t}\n\n\tfunction _setupLabel(width:Float, height:Float, fontSize:Int) {\n\t\tvar size:Int = (fontSize != null) ? fontSize : Button.FONT_SIZE;\n\t\tvar style:TextStyle = {};\n\t\tstyle.font = (size) + \"px Arial\";\n\t\tstyle.fill = Button.TEXT_COLOUR;\n\t\t_label = new Text(\"\", style);\n\t\t_label.anchor.set(0.5);\n\t\t_label.x = width / 2;\n\t\t_label.y = height / 2;\n\t\taddChild(_label);\n\t}\n\n\tfunction _redraw(colour:Int) {\n\t\tvar border:Float = 1;\n\t\t_background.clear();\n\t\t_background.beginFill(0x003366);\n\t\t_background.drawRect(_rect.x, _rect.y, _rect.width, _rect.height);\n\t\t_background.endFill();\n\t\t_background.beginFill(colour);\n\t\t_background.drawRect(_rect.x + border / 2, _rect.y + border / 2, _rect.width - border, _rect.height - border);\n\t\t_background.endFill();\n\t}\n\n\tpublic inline function setText(label:String) {\n\t\t_label.text = label;\n\t}\n\n\tfunction _onMouseDown(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tfunction _onMouseUp(target:EventTarget) {\n\t\tif (_enabled) {\n\t\t\taction.dispatch(_data);\n\t\t\t_redraw(Button.OUT_COLOUR);\n\t\t}\n\t}\n\n\tfunction _onMouseUpOutside(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onMouseOver(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tfunction _onMouseOut(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onTouchEndOutside(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OUT_COLOUR);\n\t}\n\n\tfunction _onTouchEnd(target:EventTarget) {\n\t\tif (_enabled) {\n\t\t\t_redraw(Button.OUT_COLOUR);\n\t\t\taction.dispatch(_data);\n\t\t}\n\t}\n\n\tfunction _onTouchStart(target:EventTarget) {\n\t\tif (_enabled) _redraw(Button.OVER_COLOUR);\n\t}\n\n\tpublic inline function enable() {\n\t\t_enabled = true;\n\t}\n\n\tpublic function disable() {\n\t\t_redraw(Button.OUT_COLOUR);\n\t\t_enabled = false;\n\t}\n}","package samples.audio;\n\nimport core.AudioAsset;\nimport core.AssetLoader;\nimport pixi.loaders.Loader;\nimport pixi.core.display.Container;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:AssetLoader;\n\tvar _img:Sprite;\n\tvar _baseURL:String;\n\n\tvar _btnContainer:Container;\n\n\tvar _bgSound:AudioAsset;\n\tvar _sound1:AudioAsset;\n\tvar _sound2:AudioAsset;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tpixelRatio = Math.floor(Browser.window.devicePixelRatio);\n\t\tbackgroundColor = 0x5F04B4;\n\t\tsuper.start();\n\n\t\t_baseURL = \"assets/audio/\";\n\n\t\t_loader = new AssetLoader();\n\t\t_loader.baseUrl = _baseURL;\n\n\t\t_loader.addAudioAsset(\"loop\", \"loop.mp3\");\n\t\t_loader.addAudioAsset(\"sound1\", \"sound1.wav\");\n\t\t_loader.addAudioAsset(\"sound2\", \"sound2.wav\");\n\t\t_loader.start(_onLoaded, _onLoadProgress);\n\n\t\t_btnContainer = new Container();\n\t\tstage.addChild(_btnContainer);\n\t}\n\n\tfunction _onLoadProgress() {\n\t\ttrace(\"Loaded: \" + Math.round(_loader.progress));\n\t}\n\n\tfunction _onLoaded() {\n\t\t_bgSound = _loader.getAudio(\"loop\");\n\t\t_bgSound.loop = true;\n\t\t_bgSound.play();\n\n\t\t_sound1 = _loader.getAudio(\"sound1\");\n\t\t_sound2 = _loader.getAudio(\"sound2\");\n\n\t\t_addButton(\"SOUND 1\", 0, 0, 100, 30, _playSound1);\n\t\t_addButton(\"SOUND 2\", 100, 0, 100, 30, _playSound2);\n\t\t_addButton(\"STOP ALL\", 220, 0, 100, 30, _stopAll);\n\t\t_btnContainer.position.set((Browser.window.innerWidth - 320) / 2, (Browser.window.innerHeight - 30) / 2);\n\t}\n\n\tinline function _playSound1() {\n\t\t_sound1.play();\n\t}\n\n\tinline function _playSound2() {\n\t\t_sound2.play();\n\t}\n\n\tfunction _stopAll() {\n\t\t_bgSound.stop();\n\t\t_sound1.stop();\n\t\t_sound2.stop();\n\t}\n\n\tfunction _addButton(label:String, x:Float, y:Float, width:Float, height:Float, callback:Dynamic) {\n\t\tvar button = new Button(label, width, height);\n\t\tbutton.position.set(x, y);\n\t\tbutton.action.add(callback);\n\t\tbutton.enable();\n\t\t_btnContainer.addChild(button);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n"], "names":[], -"mappings":";;;;;;;OAyBO,SAAgD;CACtD,EAAM,FAAU,AAAU;CAC1B,EAAS,IAAe,NAAG;;;;OAGrB,KAAoC;EAC1C,AAAI,DAAW,EAAc;EAC7B,CAAM,FAAO;EACb,CAAM;EACN,KAAO,AAAC,HAAO;;;;mBCyBT;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GACl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BAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/bitmapfont.js b/samples/_output/bitmapfont.js index e3331b03..4b0bb2c3 100644 --- a/samples/_output/bitmapfont.js +++ b/samples/_output/bitmapfont.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } @@ -235,25 +235,17 @@ samples_bitmapfont_Main.main = function() { samples_bitmapfont_Main.__super__ = pixi_plugins_app_Application; samples_bitmapfont_Main.prototype = $extend(pixi_plugins_app_Application.prototype,{ _init: function() { - this.backgroundColor = 16777215; + this.backgroundColor = 13158; pixi_plugins_app_Application.prototype.start.call(this); var fontloader = new PIXI.loaders.Loader(); fontloader.add("font","assets/fonts/desyrel.xml"); - fontloader.add("bg","assets/basics/bg.json"); fontloader.load($bind(this,this._onLoaded)); } ,_onLoaded: function() { var bitmapFontText = new PIXI.extras.BitmapText("bitmap fonts are\n now supported!",{ font : "60px Desyrel"}); bitmapFontText.position.x = (window.innerWidth - bitmapFontText.width) / 2; bitmapFontText.position.y = (window.innerHeight - bitmapFontText.height) / 2; - var left = new PIXI.Sprite(PIXI.Texture.fromFrame("left.jpg")); - this.stage.addChild(left); - var center = new PIXI.Sprite(PIXI.Texture.fromFrame("center.jpg")); - center.position.x = left.width; - this.stage.addChild(center); - var right = new PIXI.Sprite(PIXI.Texture.fromFrame("right.jpg")); - right.position.x = center.position.x + center.width; - this.stage.addChild(right); + this.stage.addChild(bitmapFontText); } }); var $_, $fid = 0; diff --git a/samples/_output/bitmapfont.js.map b/samples/_output/bitmapfont.js.map index 0a081570..67ccdd4e 100644 --- a/samples/_output/bitmapfont.js.map +++ b/samples/_output/bitmapfont.js.map @@ -3,7 +3,7 @@ "file":"bitmapfont.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/bitmapfont/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.bitmapfont;\n\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport pixi.loaders.Loader;\nimport pixi.extras.BitmapText;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\tvar fontloader:Loader = new Loader();\n\t\tfontloader.add(\"font\", \"assets/fonts/desyrel.xml\");\n\t\tfontloader.add(\"bg\", \"assets/basics/bg.json\");\n\t\tfontloader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar bitmapFontText = new BitmapText(\"bitmap fonts are\\n now supported!\", {font: \"60px Desyrel\"});\n\t\tbitmapFontText.position.x = (Browser.window.innerWidth - bitmapFontText.width) / 2;\n\t\tbitmapFontText.position.y = (Browser.window.innerHeight - bitmapFontText.height) / 2;\n\t\t//stage.addChild(bitmapFontText);\n\n\t\tvar left = new Sprite(Texture.fromFrame(\"left.jpg\"));\n\t\tstage.addChild(left);\n\n\t\tvar center = new Sprite(Texture.fromFrame(\"center.jpg\"));\n\t\tcenter.position.x = left.width;\n\t\tstage.addChild(center);\n\n\t\tvar right = new Sprite(Texture.fromFrame(\"right.jpg\"));\n\t\tright.position.x = center.position.x + center.width;\n\t\tstage.addChild(right);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.bitmapfont;\n\nimport pixi.loaders.Loader;\nimport pixi.extras.BitmapText;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tsuper.start();\n\n\t\tvar fontloader:Loader = new Loader();\n\t\tfontloader.add(\"font\", \"assets/fonts/desyrel.xml\");\n\t\tfontloader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar bitmapFontText = new BitmapText(\"bitmap fonts are\\n now supported!\", {font: \"60px Desyrel\"});\n\t\tbitmapFontText.position.x = (Browser.window.innerWidth - bitmapFontText.width) / 2;\n\t\tbitmapFontText.position.y = (Browser.window.innerHeight - bitmapFontText.height) / 2;\n\t\tstage.addChild(bitmapFontText);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,A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B,AAAO;EACvB,CAAqB,AAAQ;EAC7B,CAAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;0BChPtE,fAAe;CACrB;CACA;;+BAmBM,pBACN;;;;;OAjBD,IAAiB;EAChB,CAAkB;EAClB;EAEwB;EACxB,DAAe,AAAQ;EACvB,DAAgB;;WAGjB,AAAqB;EACC,qBAAe,tBAAqC,MAAO;EAChF,CAA4B,FAAC,EAA4B,AAAwB;EACjF,CAA4B,FAAC,EAA6B,AAAyB;EACnF,DAAe;;;;;4BHrB6B;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/blur.js b/samples/_output/blur.js index 1f3677fc..c976ace3 100644 --- a/samples/_output/blur.js +++ b/samples/_output/blur.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/blur.js.map b/samples/_output/blur.js.map index 14bc55b0..6e4c14ed 100644 --- a/samples/_output/blur.js.map +++ b/samples/_output/blur.js.map @@ -3,7 +3,7 @@ "file":"blur.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/filters/blur/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.filters.blur;\n\nimport js.Browser;\nimport pixi.core.display.Container;\nimport pixi.filters.blur.BlurFilter;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _container:Container;\n\tvar _littleDudes:Sprite;\n\tvar _littleRobot:Sprite;\n\n\tvar _blurFilter1:BlurFilter;\n\tvar _blurFilter2:BlurFilter;\n\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\t_container = new Container();\n\t\tstage.addChild(_container);\n\t\t_container.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\n\t\t_bg = Sprite.fromImage(\"assets/filters/depth_blur_BG.jpg\");\n\t\t_bg.anchor.set(0.5);\n\t\t_container.addChild(_bg);\n\n\t\t_littleDudes = Sprite.fromImage(\"assets/filters/depth_blur_dudes.jpg\");\n\t\t_littleDudes.anchor.set(0.5);\n\t\t_littleDudes.y = 100;\n\t\t_container.addChild(_littleDudes);\n\n\t\t_littleRobot = Sprite.fromImage(\"assets/filters/depth_blur_moby.jpg\");\n\t\t_littleRobot.anchor.set(0.5);\n\t\t_littleRobot.x = 120;\n\t\t_container.addChild(_littleRobot);\n\n\t\t_blurFilter1 = new BlurFilter();\n\t\t_blurFilter2 = new BlurFilter();\n\n\t\t_littleDudes.filters = [_blurFilter1];\n\t\t_littleRobot.filters = [_blurFilter2];\n\n\t\t_count = 0;\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.01;\n\n\t\tvar blurAmount1 = Math.cos(_count);\n\t\tvar blurAmount2 = Math.sin(_count);\n\n\t\t_blurFilter1.blur = 20 * (blurAmount1);\n\t\t_blurFilter2.blur = 20 * (blurAmount2);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.filters.blur;\n\nimport js.Browser;\nimport pixi.core.display.Container;\nimport pixi.filters.blur.BlurFilter;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _container:Container;\n\tvar _littleDudes:Sprite;\n\tvar _littleRobot:Sprite;\n\n\tvar _blurFilter1:BlurFilter;\n\tvar _blurFilter2:BlurFilter;\n\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\t_container = new Container();\n\t\tstage.addChild(_container);\n\t\t_container.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\n\t\t_bg = Sprite.fromImage(\"assets/filters/depth_blur_BG.jpg\");\n\t\t_bg.anchor.set(0.5);\n\t\t_container.addChild(_bg);\n\n\t\t_littleDudes = Sprite.fromImage(\"assets/filters/depth_blur_dudes.jpg\");\n\t\t_littleDudes.anchor.set(0.5);\n\t\t_littleDudes.y = 100;\n\t\t_container.addChild(_littleDudes);\n\n\t\t_littleRobot = Sprite.fromImage(\"assets/filters/depth_blur_moby.jpg\");\n\t\t_littleRobot.anchor.set(0.5);\n\t\t_littleRobot.x = 120;\n\t\t_container.addChild(_littleRobot);\n\n\t\t_blurFilter1 = new BlurFilter();\n\t\t_blurFilter2 = new BlurFilter();\n\n\t\t_littleDudes.filters = [_blurFilter1];\n\t\t_littleRobot.filters = [_blurFilter2];\n\n\t\t_count = 0;\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.01;\n\n\t\tvar blurAmount1 = Math.cos(_count);\n\t\tvar blurAmount2 = Math.sin(_count);\n\n\t\t_blurFilter1.blur = 20 * (blurAmount1);\n\t\t_blurF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;4BCrOtE,jBAAe;CACrB;CACA;CAEA,EAAa;CACb,AAAe;CACf,AAAwB,EAA4B,FAAG,EAA6B;CAEpF,EAAM,FAAiB;CACvB,AAAe;CACf,AAAoB;CAEpB,EAAe,FAAiB;CAChC,AAAwB;CACxB,EAAiB;CACjB,AAAoB;CAEpB,EAAe,FAAiB;CAChC,AAAwB;CACxB,EAAiB;CACjB,AAAoB;CAEpB,EAAe;CACf,EAAe;CAEf,EAAuB,FAAC;CACxB,EAAuB,FAAC;CAExB,EAAS;;iCAmBH,tBACN;;;;;OAjBD,IAAiB;EAChB,CAAkB;EAClB,CAAW;EACX;;WAGD,WAAsC;EACrC,EAAU;EAEQ,DAAS;EACT,DAAS;EAE3B,CAAoB,AAAK;EACzB,CAAoB,AAAK;;;;;4BH1DmB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/bunnymark.js b/samples/_output/bunnymark.js index 4b9deb7f..098a1c54 100644 --- a/samples/_output/bunnymark.js +++ b/samples/_output/bunnymark.js @@ -200,7 +200,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } @@ -282,7 +282,7 @@ samples_bunnymark_Main.prototype = $extend(pixi_plugins_app_Application.prototyp window.document.body.appendChild(this.counter); this.count = this.startBunnyCount; this.counter.innerHTML = this.count + " BUNNIES"; - this.container = new PIXI.ParticleContainer(200000,[false,true,false,false,false]); + this.container = new PIXI.particles.ParticleContainer(200000,[false,true,false,false,false]); this.stage.addChild(this.container); this.wabbitTexture = PIXI.Texture.fromImage("assets/bunnymark/bunnys.png"); var bunny1 = new PIXI.Texture(this.wabbitTexture.baseTexture,new PIXI.Rectangle(2,47,26,37)); diff --git a/samples/_output/bunnymark.js.map b/samples/_output/bunnymark.js.map index 8ed5623f..8c5bc473 100644 --- a/samples/_output/bunnymark.js.map +++ b/samples/_output/bunnymark.js.map @@ -3,7 +3,7 @@ "file":"bunnymark.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/bunnymark/Bunny.hx","/projects/pixi-haxe/samples/bunnymark/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.bunnymark;\n\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Bunny extends Sprite {\n\n\tpublic var speedX(default, default):Float;\n\tpublic var speedY(default, default):Float;\n\tpublic var scaleSpeed(default, default):Float;\n\tpublic var rotationSpeed(default, default):Float;\n\n\tpublic function new(texture:Texture) {\n\t\tsuper(texture);\n\t}\n}","package samples.bunnymark;\n\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.particles.ParticleContainer;\nimport js.html.DivElement;\nimport js.Browser;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar wabbitTexture:Texture;\n\n\tvar bunnys:Array = [];\n\tvar bunnyTextures:Array = [];\n\tvar gravity:Float = 0.5;\n\n\tvar maxX:Float;\n\tvar minX:Float = 0;\n\tvar maxY:Float;\n\tvar minY:Float = 0;\n\n\tvar startBunnyCount:Int = 2;\n\tvar isAdding:Bool = false;\n\tvar count:Int = 0;\n\tvar container:ParticleContainer;\n\n\tvar amount:Int = 100;\n\tvar bunnyType:Int;\n\tvar currentTexture:Texture;\n\tvar counter:DivElement;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tonResize = _onResize;\n\t\tfps = 50;\n\t\tsuper.start();\n\t\t_setup();\n\t}\n\n\tfunction _setup() {\n\t\trenderer.view.style.transform = \"translatez(0)\";\n\t\tmaxX = Browser.window.innerWidth;\n\t\tmaxY = Browser.window.innerHeight;\n\n\t\tcounter = Browser.document.createDivElement();\n\t\tcounter.style.position = \"absolute\";\n\t\tcounter.style.top = \"0px\";\n\t\tcounter.style.width = \"76px\";\n\t\tcounter.style.background = \"#CCCCC\";\n\t\tcounter.style.backgroundColor = \"#105CB6\";\n\t\tcounter.style.fontFamily = \"Helvetica,Arial\";\n\t\tcounter.style.padding = \"2px\";\n\t\tcounter.style.color = \"#0FF\";\n\t\tcounter.style.fontSize = \"9px\";\n\t\tcounter.style.fontWeight = \"bold\";\n\t\tcounter.style.textAlign = \"center\";\n\t\tcounter.className = \"counter\";\n\t\tBrowser.document.body.appendChild(counter);\n\n\t\tcount = startBunnyCount;\n\t\tcounter.innerHTML = count + \" BUNNIES\";\n\n\t\tcontainer = new ParticleContainer(200000, [false, true, false, false, false]);\n\t\tstage.addChild(container);\n\n\t\twabbitTexture = Texture.fromImage(\"assets/bunnymark/bunnys.png\");\n\n\t\tvar bunny1 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 47, 26, 37));\n\t\tvar bunny2 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 86, 26, 37));\n\t\tvar bunny3 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 125, 26, 37));\n\t\tvar bunny4 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 164, 26, 37));\n\t\tvar bunny5 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 2, 26, 37));\n\n\t\tbunnyTextures = [bunny1, bunny2, bunny3, bunny4, bunny5];\n\t\tbunnyType = 1;\n\t\tcurrentTexture = bunnyTextures[bunnyType];\n\n\t\tfor (i in 0 ... startBunnyCount) {\n\t\t\tvar bunny = new Bunny(currentTexture);\n\t\t\tbunny.speedX = Math.random() * 5;\n\t\t\tbunny.speedY = (Math.random() * 5) - 3;\n\n\t\t\tbunny.anchor.x = 0.5;\n\t\t\tbunny.anchor.y = 1;\n\n\t\t\tbunnys.push(bunny);\n\t\t\tcontainer.addChild(bunny);\n\t\t}\n\n\t\trenderer.view.onmousedown = onTouchStart;\n\t\trenderer.view.onmouseup = onTouchEnd;\n\n\t\tBrowser.document.addEventListener(\"touchstart\", onTouchStart, true);\n\t\tBrowser.document.addEventListener(\"touchend\", onTouchEnd, true);\n\t}\n\n\tfunction onTouchStart(event) {\n\t\tisAdding = true;\n\t}\n\n\tfunction onTouchEnd(event) {\n\t\tbunnyType++;\n\t\tbunnyType %= 5;\n\t\tcurrentTexture = bunnyTextures[bunnyType];\n\t\tisAdding = false;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\tif (isAdding) {\n\t\t\tif (count < 200000) {\n\t\t\t\tfor (i in 0 ... amount) {\n\t\t\t\t\tvar bunny = new Bunny(currentTexture);\n\t\t\t\t\tbunny.speedX = Math.random() * 5;\n\t\t\t\t\tbunny.speedY = (Math.random() * 5) - 3;\n\t\t\t\t\tbunny.anchor.y = 1;\n\t\t\t\t\tbunnys.push(bunny);\n\t\t\t\t\tbunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);\n\t\t\t\t\tbunny.rotation = (Math.random() - 0.5);\n\t\t\t\t\tvar random = Std.random(container.children.length - 2);\n\t\t\t\t\tcontainer.addChild(bunny);\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcounter.innerHTML = count + \" BUNNIES\";\n\t\t}\n\n\t\tfor (i in 0 ... bunnys.length) {\n\t\t\tvar bunny = bunnys[i];\n\n\t\t\tbunny.position.x += bunny.speedX;\n\t\t\tbunny.position.y += bunny.speedY;\n\t\t\tbunny.speedY += gravity;\n\n\t\t\tif (bunny.position.x > maxX) {\n\t\t\t\tbunny.speedX *= -1;\n\t\t\t\tbunny.position.x = maxX;\n\t\t\t}\n\t\t\telse if (bunny.position.x < minX) {\n\t\t\t\tbunny.speedX *= -1;\n\t\t\t\tbunny.position.x = minX;\n\t\t\t}\n\n\t\t\tif (bunny.position.y > maxY) {\n\t\t\t\tbunny.speedY *= -0.85;\n\t\t\t\tbunny.position.y = maxY;\n\t\t\t\tif (Math.random() > 0.5) bunny.speedY -= Math.random() * 6;\n\t\t\t}\n\t\t\telse if (bunny.position.y < minY) {\n\t\t\t\tbunny.speedY = 0;\n\t\t\t\tbunny.position.y = minY;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _onResize() {\n\t\tmaxX = Browser.window.innerWidth;\n\t\tmaxY = Browser.window.innerHeight;\n\n\t\tcounter.style.top = \"1px\";\n\t\tcounter.style.left = \"1px\";\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.bunnymark;\n\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Bunny extends Sprite {\n\n\tpublic var speedX(default, default):Float;\n\tpublic var speedY(default, default):Float;\n\tpublic var scaleSpeed(default, default):Float;\n\tpublic var rotationSpeed(default, default):Float;\n\n\tpublic function new(texture:Texture) {\n\t\tsuper(texture);\n\t}\n}","package samples.bunnymark;\n\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.core.particles.ParticleContainer;\nimport js.html.DivElement;\nimport js.Browser;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar wabbitTexture:Texture;\n\n\tvar bunnys:Array = [];\n\tvar bunnyTextures:Array = [];\n\tvar gravity:Float = 0.5;\n\n\tvar maxX:Float;\n\tvar minX:Float = 0;\n\tvar maxY:Float;\n\tvar minY:Float = 0;\n\n\tvar startBunnyCount:Int = 2;\n\tvar isAdding:Bool = false;\n\tvar count:Int = 0;\n\tvar container:ParticleContainer;\n\n\tvar amount:Int = 100;\n\tvar bunnyType:Int;\n\tvar currentTexture:Texture;\n\tvar counter:DivElement;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tonResize = _onResize;\n\t\tfps = 50;\n\t\tsuper.start();\n\t\t_setup();\n\t}\n\n\tfunction _setup() {\n\t\trenderer.view.style.transform = \"translatez(0)\";\n\t\tmaxX = Browser.window.innerWidth;\n\t\tmaxY = Browser.window.innerHeight;\n\n\t\tcounter = Browser.document.createDivElement();\n\t\tcounter.style.position = \"absolute\";\n\t\tcounter.style.top = \"0px\";\n\t\tcounter.style.width = \"76px\";\n\t\tcounter.style.background = \"#CCCCC\";\n\t\tcounter.style.backgroundColor = \"#105CB6\";\n\t\tcounter.style.fontFamily = \"Helvetica,Arial\";\n\t\tcounter.style.padding = \"2px\";\n\t\tcounter.style.color = \"#0FF\";\n\t\tcounter.style.fontSize = \"9px\";\n\t\tcounter.style.fontWeight = \"bold\";\n\t\tcounter.style.textAlign = \"center\";\n\t\tcounter.className = \"counter\";\n\t\tBrowser.document.body.appendChild(counter);\n\n\t\tcount = startBunnyCount;\n\t\tcounter.innerHTML = count + \" BUNNIES\";\n\n\t\tcontainer = new ParticleContainer(200000, [false, true, false, false, false]);\n\t\tstage.addChild(container);\n\n\t\twabbitTexture = Texture.fromImage(\"assets/bunnymark/bunnys.png\");\n\n\t\tvar bunny1 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 47, 26, 37));\n\t\tvar bunny2 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 86, 26, 37));\n\t\tvar bunny3 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 125, 26, 37));\n\t\tvar bunny4 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 164, 26, 37));\n\t\tvar bunny5 = new Texture(wabbitTexture.baseTexture, new Rectangle(2, 2, 26, 37));\n\n\t\tbunnyTextures = [bunny1, bunny2, bunny3, bunny4, bunny5];\n\t\tbunnyType = 1;\n\t\tcurrentTexture = bunnyTextures[bunnyType];\n\n\t\tfor (i in 0 ... startBunnyCount) {\n\t\t\tvar bunny = new Bunny(currentTexture);\n\t\t\tbunny.speedX = Math.random() * 5;\n\t\t\tbunny.speedY = (Math.random() * 5) - 3;\n\n\t\t\tbunny.anchor.x = 0.5;\n\t\t\tbunny.anchor.y = 1;\n\n\t\t\tbunnys.push(bunny);\n\t\t\tcontainer.addChild(bunny);\n\t\t}\n\n\t\trenderer.view.onmousedown = onTouchStart;\n\t\trenderer.view.onmouseup = onTouchEnd;\n\n\t\tBrowser.document.addEventListener(\"touchstart\", onTouchStart, true);\n\t\tBrowser.document.addEventListener(\"touchend\", onTouchEnd, true);\n\t}\n\n\tfunction onTouchStart(event) {\n\t\tisAdding = true;\n\t}\n\n\tfunction onTouchEnd(event) {\n\t\tbunnyType++;\n\t\tbunnyType %= 5;\n\t\tcurrentTexture = bunnyTextures[bunnyType];\n\t\tisAdding = false;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\tif (isAdding) {\n\t\t\tif (count < 200000) {\n\t\t\t\tfor (i in 0 ... amount) {\n\t\t\t\t\tvar bunny = new Bunny(currentTexture);\n\t\t\t\t\tbunny.speedX = Math.random() * 5;\n\t\t\t\t\tbunny.speedY = (Math.random() * 5) - 3;\n\t\t\t\t\tbunny.anchor.y = 1;\n\t\t\t\t\tbunnys.push(bunny);\n\t\t\t\t\tbunny.scale.set(0.5 + Math.random() * 0.5, 0.5 + Math.random() * 0.5);\n\t\t\t\t\tbunny.rotation = (Math.random() - 0.5);\n\t\t\t\t\tvar random = Std.random(container.children.length - 2);\n\t\t\t\t\tcontainer.addChild(bunny);\n\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcounter.innerHTML = count + \" BUNNIES\";\n\t\t}\n\n\t\tfor (i in 0 ... bunnys.length) {\n\t\t\tvar bunny = bunnys[i];\n\n\t\t\tbunny.position.x += bunny.speedX;\n\t\t\tbunny.position.y += bunny.speedY;\n\t\t\tbunny.speedY += gravity;\n\n\t\t\tif (bunny.position.x > maxX) {\n\t\t\t\tbunny.speedX *= -1;\n\t\t\t\tbunny.position.x = maxX;\n\t\t\t}\n\t\t\telse if (bunny.position.x < minX) {\n\t\t\t\tbunny.speedX *= -1;\n\t\t\t\tbunny.position.x = minX;\n\t\t\t}\n\n\t\t\tif (bunny.position.y > maxY) {\n\t\t\t\tbunny.speedY *= -0.85;\n\t\t\t\tbunny.position.y = maxY;\n\t\t\t\tif (Math.random() > 0.5) bunny.speedY -= Math.random() * 6;\n\t\t\t}\n\t\t\telse if (bunny.position.y < minY) {\n\t\t\t\tbunny.speedY = 0;\n\t\t\t\tbunny.position.y = minY;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction _onResize() {\n\t\tmaxX = Browser.window.innerWidth;\n\t\tmaxY = Browser.window.innerHeight;\n\n\t\tcounter.style.top = \"1px\";\n\t\tcounter.style.left = \"1px\";\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CAC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AAe,AAAgB;GAC/B,AAAe,AAAC,AAAgB,AAAK;GAErC,AAAiB;GACjB,AAAiB;GAEjB,FAAY;GACZ,FAAmB;;EAGpB,CAA4B;EAC5B,CAA0B;EAE1B,DAAkC,AAAc,AAAc;EAC9D,DAAkC,AAAY,AAAY;;cAG3D,EACC;GAAW;;YAGZ,IAA2B;EAC1B;EACA,EAAa;EACb,CAAiB,FAAc;EAC/B,CAAW;;WAGZ,WAAsC;EACrC,AAAI,DAAU;GACb,DAAI,CAAQ,FACX;IAAU;IAAM;IAAhB,HAAwB;KAAxB;KACa,mBAAU;KACtB,FAAe,AAAgB;KAC/B,FAAe,AAAC,AAAgB,AAAK;KACrC,FAAiB;KACjB,JAAY;KACZ,JAAgB,EAAM,AAAgB,FAAK,EAAM,AAAgB;KACjE,FAAiB,AAAC,AAAgB;KACrB,JAAW,EAA4B;KACpD,JAAmB;KAEnB;;;GAGF,AAAoB,AAAQ;;EAGnB;EAAM;EAAhB,DAA+B;GAA/B;GACa,FAAO;GAEnB,CAAoB;GACpB,CAAoB;GACpB,CAAgB;GAEhB,DAAI,CAAmB,FAAM;IAC5B,AAAgB;IAChB,DAAmB;MAEf,JAAI,CAAmB,FAAM;IACjC,AAAgB;IAChB,DAAmB;;GAGpB,DAAI,CAAmB,FAAM;IAC5B,AAAgB;IAChB,DAAmB;IACnB,FAAI,CAAgB,FAAK,GAAgB,DAAgB;MAErD,JAAI,CAAmB,FAAM;IACjC,DAAe;IACf,DAAmB;;;;WAKtB,AAAqB;EACpB,CAAO;EACP,CAAO;EAEP,CAAoB;EACpB,CAAqB;;;;;4BLlKuB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/colormatrix.js b/samples/_output/colormatrix.js index 2ec8dcc1..8142f6e4 100644 --- a/samples/_output/colormatrix.js +++ b/samples/_output/colormatrix.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/colormatrix.js.map b/samples/_output/colormatrix.js.map index 72135766..c3017036 100644 --- a/samples/_output/colormatrix.js.map +++ b/samples/_output/colormatrix.js.map @@ -3,7 +3,7 @@ "file":"colormatrix.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/filters/colormatrix/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.filters.colormatrix;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.display.Container;\nimport pixi.filters.color.ColorMatrixFilter;\nimport pixi.core.text.Text;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _container:Container;\n\tvar _colorMatrix:Array;\n\tvar _filter:ColorMatrixFilter;\n\n\tvar _bgFront:Sprite;\n\tvar _light1:Sprite;\n\tvar _light2:Sprite;\n\tvar _panda:Sprite;\n\n\tvar _count:Float;\n\tvar _switchy:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\tstage.interactive = true;\n\t\t_container = new Container();\n\t\t_container.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\tstage.addChild(_container);\n\n\t\t_bg = Sprite.fromImage(\"assets/filters/BGrotate.jpg\");\n\t\t_bg.anchor.set(0.5);\n\n\t\t_colorMatrix = [1, 0, 0, 0,\n\t\t\t\t\t\t0, 1, 0, 0,\n\t\t\t\t\t\t0, 0, 1, 0,\n\t\t\t\t\t\t0, 0, 0, 1];\n\n\t\t_filter = new ColorMatrixFilter();\n\n\t\t_bgFront = Sprite.fromImage(\"assets/filters/SceneRotate.jpg\");\n\t\t_bgFront.anchor.set(0.5);\n\t\t_container.addChild(_bgFront);\n\n\t\t_light2 = Sprite.fromImage(\"assets/filters/LightRotate2.png\");\n\t\t_light2.anchor.set(0.5);\n\t\t_container.addChild(_light2);\n\n\t\t_light1 = Sprite.fromImage(\"assets/filters/LightRotate1.png\");\n\t\t_light1.anchor.set(0.5);\n\t\t_container.addChild(_light1);\n\n\t\t_panda = Sprite.fromImage(\"assets/filters/panda.png\");\n\t\t_panda.anchor.set(0.5);\n\t\t_container.addChild(_panda);\n\n\t\t_count = 0;\n\t\t_switchy = false;\n\t\t_container.filters = [_filter];\n\n\t\tstage.on(\"click\", _onClick);\n\t\tstage.on(\"tap\", _onClick);\n\n\t\tvar style:TextStyle = {font: \"bold 12pt Arial\", fill: \"#FFFFFF\"};\n\t\tvar help = new Text(\"Click to turn filters on / off.\", style);\n\t\tstage.addChild(help);\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x00FF66;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.01;\n\n\t\t_bg.rotation += 0.01;\n\t\t_bgFront.rotation -= 0.01;\n\n\t\t_light1.rotation += 0.02;\n\t\t_light2.rotation += 0.01;\n\n\t\t_panda.scale.x = 1 + Math.sin(_count) * 0.04;\n\t\t_panda.scale.y = 1 + Math.cos(_count) * 0.04;\n\n\t\t_count += 0.1;\n\n\t\t_colorMatrix[1] = Math.sin(_count) * 3;\n\t\t_colorMatrix[2] = Math.cos(_count);\n\t\t_colorMatrix[3] = Math.cos(_count) * 1.5;\n\t\t_colorMatrix[4] = Math.sin(_count / 3) * 2;\n\t\t_colorMatrix[5] = Math.sin(_count / 2);\n\t\t_colorMatrix[6] = Math.sin(_count / 4);\n\t\t_filter.matrix = _colorMatrix;\n\t}\n\n\tfunction _onClick(data:EventTarget) {\n\t\t_switchy = !_switchy;\n\t\tif (!_switchy) _container.filters = [_filter];\n\t\telse _container.filters = null;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.filters.colormatrix;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.display.Container;\nimport pixi.filters.color.ColorMatrixFilter;\nimport pixi.core.text.Text;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _container:Container;\n\tvar _colorMatrix:Array;\n\tvar _filter:ColorMatrixFilter;\n\n\tvar _bgFront:Sprite;\n\tvar _light1:Sprite;\n\tvar _light2:Sprite;\n\tvar _panda:Sprite;\n\n\tvar _count:Float;\n\tvar _switchy:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\tstage.interactive = true;\n\t\t_container = new Container();\n\t\t_container.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\tstage.addChild(_container);\n\n\t\t_bg = Sprite.fromImage(\"assets/filters/BGrotate.jpg\");\n\t\t_bg.anchor.set(0.5);\n\n\t\t_colorMatrix = [1, 0, 0, 0,\n\t\t\t\t\t\t0, 1, 0, 0,\n\t\t\t\t\t\t0, 0, 1, 0,\n\t\t\t\t\t\t0, 0, 0, 1];\n\n\t\t_filter = new ColorMatrixFilter();\n\n\t\t_bgFront = Sprite.fromImage(\"assets/filters/SceneRotate.jpg\");\n\t\t_bgFront.anchor.set(0.5);\n\t\t_container.addChild(_bgFront);\n\n\t\t_light2 = Sprite.fromImage(\"assets/filters/LightRotate2.png\");\n\t\t_light2.anchor.set(0.5);\n\t\t_container.addChild(_light2);\n\n\t\t_light1 = Sprite.fromImage(\"assets/filters/LightRotate1.png\");\n\t\t_light1.anchor.set(0.5);\n\t\t_container.addChild(_light1);\n\n\t\t_panda = Sprite.fromImage(\"assets/filters/panda.png\");\n\t\t_panda.anchor.set(0.5);\n\t\t_container.addChild(_panda);\n\n\t\t_count = 0;\n\t\t_switchy = false;\n\t\t_container.filters = [_filter];\n\n\t\tstage.on(\"click\", _onClick);\n\t\tstage.on(\"tap\", _onClick);\n\n\t\tvar style:TextStyle = {font: \"bold 12pt Arial\", fill: \"#FFFFFF\"};\n\t\tvar help = new Text(\"Click to turn filters on / off.\", style);\n\t\tstage.addChild(help);\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x00FF66;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.01;\n\n\t\t_bg.rotation += 0.01;\n\t\t_bgFront.rotation -= 0.01;\n\n\t\t_light1.rotation += 0.02;\n\t\t_light2.rotation += 0.01;\n\n\t\t_panda.scale.x = 1 + Math.sin(_count) * 0.04;\n\t\t_panda.scale.y = 1 + Math.cos(_count) * 0.04;\n\n\t\t_count += 0.1;\n\n\t\t_colorMatrix[1] = Math.sin(_count) * 3;\n\t\t_colorMatrix[2] = Math.cos(_count);\n\t\t_colorMatrix[3] = Math.cos(_count) * 1.5;\n\t\t_colorMatrix[4] = Math.sin(_count / 3) * 2;\n\t\t_colorMatrix[5] = Math.sin(_count / 2);\n\t\t_colorMatrix[6] = Math.sin(_count / 4);\n\t\t_filter.matrix = _colorMatrix;\n\t}\n\n\tfunction _onClick(data:EventTarget) {\n\t\t_switchy = !_switchy;\n\t\tif (!_switchy) _container.filters = [_filter];\n\t\telse _container.filters = null;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,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K,FAAS,EAAS;EACpC,DAAa,EAAK,FAAS,EAAS;EACpC,CAAiB;;UAGlB,KAAoC;EACnC,CAAW,FAAC;EACZ,AAAI,DAAC,AAAU,EAAqB,FAAC,KAChC,HAAqB;;;;;4BHlGkB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/devicedetection.js b/samples/_output/devicedetection.js index a3a1c1cc..03c25357 100644 --- a/samples/_output/devicedetection.js +++ b/samples/_output/devicedetection.js @@ -287,7 +287,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/devicedetection.js.map b/samples/_output/devicedetection.js.map index 42c121dd..af470d27 100644 --- a/samples/_output/devicedetection.js.map +++ b/samples/_output/devicedetection.js.map @@ -3,7 +3,7 @@ "file":"devicedetection.js", "sourceRoot":"file:///", "sources":["/usr/local/lib/haxe/std/js/_std/EReg.hx","/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/usr/local/lib/haxe/std/js/Boot.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/devicedetection/Main.hx"], -"sourcesContent":["/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class EReg {\n\n\tvar r : HaxeRegExp;\n\n\tpublic function new( r : String, opt : String ) : Void {\n\t\topt = opt.split(\"u\").join(\"\"); // 'u' (utf8) depends on page encoding\n\t\tthis.r = new HaxeRegExp(r, opt);\n\t}\n\n\tpublic function match( s : String ) : Bool {\n\t\tif( r.global ) r.lastIndex = 0;\n\t\tr.m = r.exec(s);\n\t\tr.s = s;\n\t\treturn (r.m != null);\n\t}\n\n\tpublic function matched( n : Int ) : String {\n\t\treturn if( r.m != null && n >= 0 && n < r.m.length ) r.m[n] else throw \"EReg::matched\";\n\t}\n\n\tpublic function matchedLeft() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn r.s.substr(0,r.m.index);\n\t}\n\n\tpublic function matchedRight() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\tvar sz = r.m.index+r.m[0].length;\n\t\treturn r.s.substr(sz,r.s.length-sz);\n\t}\n\n\tpublic function matchedPos() : { pos : Int, len : Int } {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn { pos : r.m.index, len : r.m[0].length };\n\t}\n\n\tpublic function matchSub( s : String, pos : Int, len : Int = -1):Bool {\n\t\treturn if (r.global) {\n\t\t\tr.lastIndex = pos;\n\t\t\tr.m = r.exec(len < 0 ? s : s.substr(0, pos + len));\n\t\t\tvar b = r.m != null;\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t}\n\t\t\tb;\n\t\t} else {\n\t\t\t// TODO: check some ^/$ related corner cases\n\t\t\tvar b = match( len < 0 ? s.substr(pos) : s.substr(pos,len) );\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t\tr.m.index += pos;\n\t\t\t}\n\t\t\tb;\n\t\t}\n\t}\n\n\tpublic function split( s : String ) : Array {\n\t\t// we can't use directly s.split because it's ignoring the 'g' flag\n\t\tvar d = \"#__delim__#\";\n\t\treturn untyped s.replace(r,d).split(d);\n\t}\n\n\tpublic function replace( s : String, by : String ) : String {\n\t\treturn untyped s.replace(r,by);\n\t}\n\n\tpublic function map( s : String, f : EReg -> String ) : String {\n\t\tvar offset = 0;\n\t\tvar buf = new StringBuf();\n\t\tdo {\n\t\t\tif (offset >= s.length)\n\t\t\t\tbreak;\n\t\t\telse if (!matchSub(s, offset)) {\n\t\t\t\tbuf.add(s.substr(offset));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar p = matchedPos();\n\t\t\tbuf.add(s.substr(offset, p.pos - offset));\n\t\t\tbuf.add(f(this));\n\t\t\tif (p.len == 0) {\n\t\t\t\tbuf.add(s.substr(p.pos, 1));\n\t\t\t\toffset = p.pos + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\toffset = p.pos + p.len;\n\t\t} while (r.global);\n\t\tif (!r.global && offset > 0 && offset < s.length)\n\t\t\tbuf.add(s.substr(offset));\n\t\treturn buf.toString();\n\t}\n}\n\n@:native(\"RegExp\")\nprivate extern class HaxeRegExp extends js.RegExp {\n\tvar m:js.RegExp.RegExpMatch;\n\tvar s:String;\n}\n","import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.devicedetection;\n\nimport pixi.core.display.Container;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _info:Container;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tsuper.start();\n\n\t\t_info = new Container();\n\t\tstage.addChild(_info);\n\n\t\tvar txt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Android:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isAndroid();\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Android Phone:\\t\\t\\t\\t\\t\" + _isAndroidPhone();\n\t\ttxt.y = 40;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"iOS:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isiOS();\n\t\ttxt.y = 80;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"iOS Phone:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isiOSPhone();\n\t\ttxt.y = 120;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Windows:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isWindows();\n\t\ttxt.y = 160;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Windows Phone:\\t\\t\\t\" + _isWindowsPhone();\n\t\ttxt.y = 200;\n\t\t_info.addChild(txt);\n\n\t\t_info.position.x = (Browser.window.innerWidth - _info.width) / 2;\n\t\t_info.position.y = (Browser.window.innerHeight - _info.height) / 2;\n\t}\n\n\tfunction _isAndroid():Bool {\n\t\treturn ~/Android/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isAndroidPhone():Bool {\n\t\treturn ~/Android/i.match(Browser.navigator.userAgent) && ~/Mobile/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isiOS():Bool {\n\t\treturn ~/(iPad|iPhone|iPod)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isiOSPhone():Bool {\n\t\treturn ~/(iPhone|iPod)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isWindows():Bool {\n\t\treturn ~/(Windows|iemobile)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isWindowsPhone():Bool {\n\t\treturn ~/Windows Phone/i.match(Browser.navigator.userAgent) || ~/iemobile/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _getiOSVersion():Array {\n\t\tvar v:EReg = ~/[0-9_]+?[0-9_]+?[0-9_]+/i;\n\t\tvar matched:Array = [];\n\t\tif (v.match(Browser.navigator.userAgent)) {\n\t\t\tvar match:Array = v.matched(0).split(\"_\");\n\t\t\tmatched = [for (i in match) Std.parseInt(i)];\n\t\t}\n\t\treturn matched;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class EReg {\n\n\tvar r : HaxeRegExp;\n\n\tpublic function new( r : String, opt : String ) : Void {\n\t\topt = opt.split(\"u\").join(\"\"); // 'u' (utf8) depends on page encoding\n\t\tthis.r = new HaxeRegExp(r, opt);\n\t}\n\n\tpublic function match( s : String ) : Bool {\n\t\tif( r.global ) r.lastIndex = 0;\n\t\tr.m = r.exec(s);\n\t\tr.s = s;\n\t\treturn (r.m != null);\n\t}\n\n\tpublic function matched( n : Int ) : String {\n\t\treturn if( r.m != null && n >= 0 && n < r.m.length ) r.m[n] else throw \"EReg::matched\";\n\t}\n\n\tpublic function matchedLeft() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn r.s.substr(0,r.m.index);\n\t}\n\n\tpublic function matchedRight() : String {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\tvar sz = r.m.index+r.m[0].length;\n\t\treturn r.s.substr(sz,r.s.length-sz);\n\t}\n\n\tpublic function matchedPos() : { pos : Int, len : Int } {\n\t\tif( r.m == null ) throw \"No string matched\";\n\t\treturn { pos : r.m.index, len : r.m[0].length };\n\t}\n\n\tpublic function matchSub( s : String, pos : Int, len : Int = -1):Bool {\n\t\treturn if (r.global) {\n\t\t\tr.lastIndex = pos;\n\t\t\tr.m = r.exec(len < 0 ? s : s.substr(0, pos + len));\n\t\t\tvar b = r.m != null;\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t}\n\t\t\tb;\n\t\t} else {\n\t\t\t// TODO: check some ^/$ related corner cases\n\t\t\tvar b = match( len < 0 ? s.substr(pos) : s.substr(pos,len) );\n\t\t\tif (b) {\n\t\t\t\tr.s = s;\n\t\t\t\tr.m.index += pos;\n\t\t\t}\n\t\t\tb;\n\t\t}\n\t}\n\n\tpublic function split( s : String ) : Array {\n\t\t// we can't use directly s.split because it's ignoring the 'g' flag\n\t\tvar d = \"#__delim__#\";\n\t\treturn untyped s.replace(r,d).split(d);\n\t}\n\n\tpublic function replace( s : String, by : String ) : String {\n\t\treturn untyped s.replace(r,by);\n\t}\n\n\tpublic function map( s : String, f : EReg -> String ) : String {\n\t\tvar offset = 0;\n\t\tvar buf = new StringBuf();\n\t\tdo {\n\t\t\tif (offset >= s.length)\n\t\t\t\tbreak;\n\t\t\telse if (!matchSub(s, offset)) {\n\t\t\t\tbuf.add(s.substr(offset));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvar p = matchedPos();\n\t\t\tbuf.add(s.substr(offset, p.pos - offset));\n\t\t\tbuf.add(f(this));\n\t\t\tif (p.len == 0) {\n\t\t\t\tbuf.add(s.substr(p.pos, 1));\n\t\t\t\toffset = p.pos + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t\toffset = p.pos + p.len;\n\t\t} while (r.global);\n\t\tif (!r.global && offset > 0 && offset < s.length)\n\t\t\tbuf.add(s.substr(offset));\n\t\treturn buf.toString();\n\t}\n}\n\n@:native(\"RegExp\")\nprivate extern class HaxeRegExp extends js.RegExp {\n\tvar m:js.RegExp.RegExpMatch;\n\tvar s:String;\n}\n","import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.devicedetection;\n\nimport pixi.core.display.Container;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _info:Container;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tsuper.start();\n\n\t\t_info = new Container();\n\t\tstage.addChild(_info);\n\n\t\tvar txt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Android:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isAndroid();\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Android Phone:\\t\\t\\t\\t\\t\" + _isAndroidPhone();\n\t\ttxt.y = 40;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"iOS:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isiOS();\n\t\ttxt.y = 80;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"iOS Phone:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isiOSPhone();\n\t\ttxt.y = 120;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Windows:\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\" + _isWindows();\n\t\ttxt.y = 160;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Windows Phone:\\t\\t\\t\" + _isWindowsPhone();\n\t\ttxt.y = 200;\n\t\t_info.addChild(txt);\n\n\t\t_info.position.x = (Browser.window.innerWidth - _info.width) / 2;\n\t\t_info.position.y = (Browser.window.innerHeight - _info.height) / 2;\n\t}\n\n\tfunction _isAndroid():Bool {\n\t\treturn ~/Android/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isAndroidPhone():Bool {\n\t\treturn ~/Android/i.match(Browser.navigator.userAgent) && ~/Mobile/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isiOS():Bool {\n\t\treturn ~/(iPad|iPhone|iPod)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isiOSPhone():Bool {\n\t\treturn ~/(iPhone|iPod)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isWindows():Bool {\n\t\treturn ~/(Windows|iemobile)/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _isWindowsPhone():Bool {\n\t\treturn ~/Windows Phone/i.match(Browser.navigator.userAgent) || ~/iemobile/i.match(Browser.navigator.userAgent);\n\t}\n\n\tfunction _getiOSVersion():Array {\n\t\tvar v:EReg = ~/[0-9_]+?[0-9_]+?[0-9_]+/i;\n\t\tvar matched:Array = [];\n\t\tif (v.match(Browser.navigator.userAgent)) {\n\t\t\tvar match:Array = v.matched(0).split(\"_\");\n\t\t\tmatched = [for (i in match) Std.parseInt(i)];\n\t\t}\n\t\treturn matched;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;OAyBO,SAAgD;CACtD,EAAM,FAAU,AAAU;CAC1B,EAAS,IAAe,NAAG;;;;OAGrB,KAAoC;EAC1C,AAAI,DAAW,EAAc;EAC7B,CAAM,FAAO;EACb,CAAM;EACN,KAAO,AAAC,HAAO;;;;mBCyBT;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,A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C,CAAQ;EACR,DAAe;EAEf,CAAmB,FAAC,EAA4B,AAAe;EAC/D,CAAmB,FAAC,EAA6B,AAAgB;;YAGlE,DACC;OAAO,NAAkB;;iBAG1B,NACC;OAAO,NAAkB,GAAgC,HAAiB;;QAG3E,GACC;OAAO,NAA6B;;aAGrC,FACC;OAAO,NAAwB;;YAGhC,DACC;OAAO,NAA6B;;iBAGrC,NACC;OAAO,NAAwB,GAAgC,HAAmB;;;;;AHfpD,GAAkB,AAA2C;AAE7D,GAAiB,AAA0C;AAG1D,GAA0B,FAAC;4BF7Dd;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/deviceinfo.js b/samples/_output/deviceinfo.js index d54599b8..3528a762 100644 --- a/samples/_output/deviceinfo.js +++ b/samples/_output/deviceinfo.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/deviceinfo.js.map b/samples/_output/deviceinfo.js.map index e412de8a..fdf04bfe 100644 --- a/samples/_output/deviceinfo.js.map +++ b/samples/_output/deviceinfo.js.map @@ -3,7 +3,7 @@ "file":"deviceinfo.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/deviceinfo/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.deviceinfo;\n\nimport pixi.core.display.Container;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _info:Container;\n\n\tvar _rendererType:Array;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tsuper.start();\n\n\t\t_rendererType = [\"Unknown\", \"WebGL\", \"Canvas\"];\n\n\t\t_info = new Container();\n\t\tstage.addChild(_info);\n\n\t\tvar txt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Resolution: \\t\\t\" + Browser.window.innerWidth + \" x \" + Browser.window.innerHeight;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Pixel Ratio: \\t\\t\" + Browser.window.devicePixelRatio;\n\t\ttxt.y = 40;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Renderer: \\t\\t\\t\\t\\t\" + _rendererType[renderer.type];\n\t\ttxt.y = 80;\n\t\t_info.addChild(txt);\n\n\t\t_info.position.x = (Browser.window.innerWidth - _info.width) / 2;\n\t\t_info.position.y = (Browser.window.innerHeight - _info.height) / 2;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.deviceinfo;\n\nimport pixi.core.display.Container;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _info:Container;\n\n\tvar _rendererType:Array;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tsuper.start();\n\n\t\t_rendererType = [\"Unknown\", \"WebGL\", \"Canvas\"];\n\n\t\t_info = new Container();\n\t\tstage.addChild(_info);\n\n\t\tvar txt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Resolution: \\t\\t\" + Browser.window.innerWidth + \" x \" + Browser.window.innerHeight;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Pixel Ratio: \\t\\t\" + Browser.window.devicePixelRatio;\n\t\ttxt.y = 40;\n\t\t_info.addChild(txt);\n\n\t\ttxt = new Text(\"\", {fill: \"#FFFFFF\"});\n\t\ttxt.text = \"Renderer: \\t\\t\\t\\t\\t\" + _rendererType[renderer.type];\n\t\ttxt.y = 80;\n\t\t_info.addChild(txt);\n\n\t\t_info.position.x = (Browser.window.innerWidth - _info.width) / 2;\n\t\t_info.position.y = (Browser.window.innerHeight - _info.height) / 2;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,AAAU,FAAS,AAAS;IACrC,DAAU,FAAS,AAAS;IA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ACT,DAAgB,AAAO;EACvB,CAAqB,AAAQ;EAC7B,CAAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;0BC5OtE,fAAe;CACrB;CACA;;+BA8BM,pBACN;;;;;OA5BD,IAAiB;EAChB,CAAkB;EAClB;EAEA,CAAgB,FAAC,AAAW,AAAS;EAErC,CAAQ;EACR,DAAe;EAEL,QAAS,TAAI,MAAO;EAC9B,CAAW,AAAqB,AAA4B,AAAQ;EACpE,DAAe;EAEf,CAAM,OAAS,TAAI,MAAO;EAC1B,CAAW,AAAsB;EACjC,CAAQ;EACR,DAAe;EAEf,CAAM,OAAS,TAAI,MAAO;EAC1B,CAAW,AAAyB,FAAc;EAClD,CAAQ;EACR,DAAe;EAEf,CAAmB,FAAC,EAA4B,AAAe;EAC/D,CAAmB,FAAC,EAA6B,AAAgB;;;;;4BHpCrB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/dragging.js b/samples/_output/dragging.js index 4794e1fc..589291a1 100644 --- a/samples/_output/dragging.js +++ b/samples/_output/dragging.js @@ -355,7 +355,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/dragging.js.map b/samples/_output/dragging.js.map index ee5b6a19..da3a7d54 100644 --- a/samples/_output/dragging.js.map +++ b/samples/_output/dragging.js.map @@ -3,7 +3,7 @@ "file":"dragging.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/usr/local/lib/haxe/std/js/Boot.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/dragging/Bunny.hx","/projects/pixi-haxe/samples/dragging/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.dragging;\n\nimport pixi.interaction.InteractionData;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Bunny extends Sprite {\n\n\tpublic var data:InteractionData;\n\tpublic var dragging:Bool;\n\n\tpublic function new(texture:Texture) {\n\t\tsuper(texture);\n\t}\n}","package samples.dragging;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.math.Point;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _texture:Texture;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_texture = Texture.fromImage(\"assets/basics/bunny.png\");\n\t\tfor (i in 0 ... 10) _createBunny(Math.floor(Math.random() * Browser.window.innerWidth), Math.floor(Math.random() * Browser.window.innerHeight));\n\t}\n\n\tfunction _createBunny(x:Float, y:Float) {\n\t\t// create our little bunny friend..\n\t\tvar bunny:Bunny = new Bunny(_texture);\n\n\t\t// enable the bunny to be interactive... this will allow it to respond to mouse and touch events\n\t\tbunny.interactive = true;\n\n\t\t// this button mode will mean the hand cursor appears when you roll over the bunny with your mouse\n\t\tbunny.buttonMode = true;\n\n\t\t// center the bunny's anchor point\n\t\tbunny.anchor.set(0.5);\n\n\t\t// make it a bit bigger, so it's easier to grab\n\t\tbunny.scale.set(3);\n\n\t\t// setup events\n\t\tbunny.on(\"mousedown\", _onDragStart);\n\t\tbunny.on(\"touchstart\", _onDragStart);\n\t\t// events for drag end\n\t\tbunny.on(\"mouseup\", _onDragEnd);\n\t\tbunny.on(\"mouseupoutside\", _onDragEnd);\n\t\tbunny.on(\"touchend\", _onDragEnd);\n\t\tbunny.on(\"touchendoutside\", _onDragEnd);\n\t\t// events for drag move\n\t\tbunny.on(\"mousemove\", _onDragMove);\n\t\tbunny.on(\"touchmove\", _onDragMove);\n\n\t\t// move the sprite to its designated position\n\t\tbunny.position.set(x, y);\n\n\t\t// add it to the stage\n\t\tstage.addChild(bunny);\n\t}\n\n\tfunction _onDragStart(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\t// store a reference to the data\n\t\t// the reason for this is because of multitouch\n\t\t// we want to track the movement of this particular touch\n\t\tbunny.data = event.data;\n\t\tbunny.alpha = 0.5;\n\t\tbunny.dragging = true;\n\t}\n\n\tfunction _onDragEnd(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\tbunny.alpha = 1;\n\t\tbunny.dragging = false;\n\n\t\t// set the interaction data to null\n\t\tbunny.data = null;\n\t}\n\n\tfunction _onDragMove(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\tif (bunny.dragging) {\n\t\t\tvar newPosition:Point = bunny.data.getLocalPosition(bunny.parent);\n\t\t\tbunny.position.set(newPosition.x, newPosition.y);\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.dragging;\n\nimport pixi.interaction.InteractionData;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Bunny extends Sprite {\n\n\tpublic var data:InteractionData;\n\tpublic var dragging:Bool;\n\n\tpublic function new(texture:Texture) {\n\t\tsuper(texture);\n\t}\n}","package samples.dragging;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.math.Point;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _texture:Texture;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_texture = Texture.fromImage(\"assets/basics/bunny.png\");\n\t\tfor (i in 0 ... 10) _createBunny(Math.floor(Math.random() * Browser.window.innerWidth), Math.floor(Math.random() * Browser.window.innerHeight));\n\t}\n\n\tfunction _createBunny(x:Float, y:Float) {\n\t\t// create our little bunny friend..\n\t\tvar bunny:Bunny = new Bunny(_texture);\n\n\t\t// enable the bunny to be interactive... this will allow it to respond to mouse and touch events\n\t\tbunny.interactive = true;\n\n\t\t// this button mode will mean the hand cursor appears when you roll over the bunny with your mouse\n\t\tbunny.buttonMode = true;\n\n\t\t// center the bunny's anchor point\n\t\tbunny.anchor.set(0.5);\n\n\t\t// make it a bit bigger, so it's easier to grab\n\t\tbunny.scale.set(3);\n\n\t\t// setup events\n\t\tbunny.on(\"mousedown\", _onDragStart);\n\t\tbunny.on(\"touchstart\", _onDragStart);\n\t\t// events for drag end\n\t\tbunny.on(\"mouseup\", _onDragEnd);\n\t\tbunny.on(\"mouseupoutside\", _onDragEnd);\n\t\tbunny.on(\"touchend\", _onDragEnd);\n\t\tbunny.on(\"touchendoutside\", _onDragEnd);\n\t\t// events for drag move\n\t\tbunny.on(\"mousemove\", _onDragMove);\n\t\tbunny.on(\"touchmove\", _onDragMove);\n\n\t\t// move the sprite to its designated position\n\t\tbunny.position.set(x, y);\n\n\t\t// add it to the stage\n\t\tstage.addChild(bunny);\n\t}\n\n\tfunction _onDragStart(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\t// store a reference to the data\n\t\t// the reason for this is because of multitouch\n\t\t// we want to track the movement of this particular touch\n\t\tbunny.data = event.data;\n\t\tbunny.alpha = 0.5;\n\t\tbunny.dragging = true;\n\t}\n\n\tfunction _onDragEnd(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\tbunny.alpha = 1;\n\t\tbunny.dragging = false;\n\n\t\t// set the interaction data to null\n\t\tbunny.data = null;\n\t}\n\n\tfunction _onDragMove(event:EventTarget) {\n\t\tvar bunny:Bunny = cast(event.target, Bunny);\n\t\tif (bunny.dragging) {\n\t\t\tvar newPosition:Point = bunny.data.getLocalPosition(bunny.parent);\n\t\t\tbunny.position.set(newPosition.x, newPosition.y);\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,AAAU,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GAAwC;EACrB;eAAK;EACvB,AAAI,DAAgB;GACK,FAA4B;GACpD,FAAmB,AAAe;;;;;;;AJxBJ,GAA6B,AAA8D;AAC5F,GAAkB,AAA2C;AAE7D,GAAiB,AAA0C;AAEzD,GAAqC,AAAoE;AAC1G,GAA0B,FAAC;AAGzD,GAAU,AAA6E,QAAa,VAAC;AAGrG,GAAc,AAAqF,QAAa,VAAC;AAGrG,GAAyE;AACrF,GAAiB,FAAC;AAGP,GAAuE;AAClF,GAAiB,FAAC;AAGlB,GAAY,AAAiF,QAAa,VAAC;AAG3G,GAAW;4BFjFgC;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;kBGyMC;;;;" } \ No newline at end of file diff --git a/samples/_output/events.js b/samples/_output/events.js index 5c71a29d..38dadf8f 100644 --- a/samples/_output/events.js +++ b/samples/_output/events.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/events.js.map b/samples/_output/events.js.map index 3cb47733..1983b9be 100644 --- a/samples/_output/events.js.map +++ b/samples/_output/events.js.map @@ -3,7 +3,7 @@ "file":"events.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/events/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.events;\n\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.interaction.EventTarget;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_img = new Sprite(Texture.fromImage(\"assets/basics/bunny.png\"));\n\t\t_img.position.set(400, 300);\n\t\t_img.interactive = true;\n\t\t_img.scale.set(4);\n\t\t_img.on(\"mouseover\", _onEvent);\n\t\t_img.on(\"touchstart\", _onEvent);\n\t\t_img.tap = _onEvent;\n\t\t_img.click = _onEvent;\n\n\t\tstage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#000000\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(\"EVENTS\", style);\n\t\t_label.position.set(0, 0);\n\t\tstage.addChild(_label);\n\t}\n\n\tfunction _onEvent(target:EventTarget) {\n\t\t_label.text = target.type;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.events;\n\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.interaction.EventTarget;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_img = new Sprite(Texture.fromImage(\"assets/basics/bunny.png\"));\n\t\t_img.position.set(400, 300);\n\t\t_img.interactive = true;\n\t\t_img.scale.set(4);\n\t\t_img.on(\"mouseover\", _onEvent);\n\t\t_img.on(\"touchstart\", _onEvent);\n\t\t_img.tap = _onEvent;\n\t\t_img.click = _onEvent;\n\n\t\tstage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#000000\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(\"EVENTS\", style);\n\t\t_label.position.set(0, 0);\n\t\tstage.addChild(_label);\n\t}\n\n\tfunction _onEvent(target:EventTarget) {\n\t\t_label.text = target.type;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,AAAU,FAAS,AAAS;IACrC,DAAU,FAAS,AAAS;IAC5B,DAAS,FAAW,EAAY;;GAGjC,AAAiB,AAAU,AAAa,AAAO,AAAU,AAAM,AAAU;GAEzE,DAAI,EAAc,HAAI,EAA4B,GAC7C,JAAI,EAAc,HAAI,EAA4B,GAClD,HAA4B;GAEjC,AAAY;GACZ,AAAS;GAET,DAAI,DAAW;IACd,DAAa,FAAkB,AAA2B;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CACrB;CACA;;2BA+BM,hBACN;;;;;OA7BD,IAAiB;EAChB,CAAkB;EAClB;EAEA,CAAO,SAAW,XAAkB;EACpC,DAAkB,AAAK;EACvB,CAAmB;EACnB,DAAe;EACf,DAAQ,AAAa;EACrB,DAAQ,AAAc;EACtB,CAAW;EACX,CAAa;EAEb,DAAe;EAEO;EACtB,CAAa;EACb,CAAa;EAEb,CAAS,OAAS,TAAU;EAC5B,DAAoB,AAAG;EACvB,DAAe;;UAGhB,OACC;GAAc;;;;;4BHtC8B;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/graphics.js b/samples/_output/graphics.js index 88c1bfa5..0a84565f 100644 --- a/samples/_output/graphics.js +++ b/samples/_output/graphics.js @@ -200,7 +200,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/graphics.js.map b/samples/_output/graphics.js.map index 0ab65796..19a044ca 100644 --- a/samples/_output/graphics.js.map +++ b/samples/_output/graphics.js.map @@ -3,7 +3,7 @@ "file":"graphics.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/graphics/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.graphics;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.graphics.Graphics;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _graphics:Graphics;\n\tvar _thing:Graphics;\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tantialias = true;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\t_graphics = new Graphics();\n\t\t_graphics.beginFill(0xFF3300);\n\t\t_graphics.lineStyle(10, 0xffd900, 1);\n\n\t\t_graphics.moveTo(50, 50);\n\t\t_graphics.lineTo(250, 50);\n\t\t_graphics.lineTo(100, 100);\n\t\t_graphics.lineTo(250, 220);\n\t\t_graphics.lineTo(50, 220);\n\t\t_graphics.lineTo(50, 50);\n\t\t_graphics.endFill();\n\n\t\t_graphics.lineStyle(10, 0xFF0000, 0.8);\n\t\t_graphics.beginFill(0xFF700B, 1);\n\n\t\t_graphics.moveTo(210, 300);\n\t\t_graphics.lineTo(450, 320);\n\t\t_graphics.lineTo(570, 350);\n\t\t_graphics.lineTo(580, 20);\n\t\t_graphics.lineTo(330, 120);\n\t\t_graphics.lineTo(410, 200);\n\t\t_graphics.lineTo(210, 300);\n\t\t_graphics.endFill();\n\n\t\t_graphics.lineStyle(2, 0x0000FF, 1);\n\t\t_graphics.drawRect(50, 250, 100, 100);\n\n\t\t_graphics.lineStyle(0);\n\t\t_graphics.beginFill(0xFFFF0B, 0.5);\n\t\t_graphics.drawCircle(470, 200, 100);\n\n\t\t_graphics.lineStyle(20, 0x33FF00);\n\t\t_graphics.moveTo(30, 30);\n\t\t_graphics.lineTo(600, 300);\n\n\t\tstage.addChild(_graphics);\n\n\t\t_thing = new Graphics();\n\t\tstage.addChild(_thing);\n\t\t_thing.position.x = Browser.window.innerWidth / 2;\n\t\t_thing.position.y = Browser.window.innerHeight / 2;\n\n\t\t_count = 0;\n\n\t\tstage.interactive = true;\n\t\tstage.on(\"click\", _onStageClick);\n\t\tstage.on(\"tap\", _onStageClick);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.1;\n\n\t\t_thing.clear();\n\t\t_thing.lineStyle(30, 0xFF0000, 1);\n\t\t_thing.beginFill(0xFF0000, 0.5);\n\n\t\t_thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);\n\t\t_thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);\n\t\t_thing.lineTo(120 + Math.sin(_count) * 20, 100 + Math.cos(_count) * 20);\n\t\t_thing.lineTo(-120 + Math.cos(_count) * 20, 100 + Math.sin(_count) * 20);\n\t\t_thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);\n\n\t\t_thing.rotation = _count * 0.1;\n\t}\n\n\tfunction _onStageClick(target:EventTarget) {\n\t\t_graphics.lineStyle(Math.random() * 30, Std.int(Math.random() * 0xFFFFFF), 1);\n\t\t_graphics.moveTo(Math.random() * 620, Math.random() * 380);\n\t\t_graphics.lineTo(Math.random() * 620, Math.random() * 380);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.graphics;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.graphics.Graphics;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _graphics:Graphics;\n\tvar _thing:Graphics;\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x003366;\n\t\tantialias = true;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\t_graphics = new Graphics();\n\t\t_graphics.beginFill(0xFF3300);\n\t\t_graphics.lineStyle(10, 0xffd900, 1);\n\n\t\t_graphics.moveTo(50, 50);\n\t\t_graphics.lineTo(250, 50);\n\t\t_graphics.lineTo(100, 100);\n\t\t_graphics.lineTo(250, 220);\n\t\t_graphics.lineTo(50, 220);\n\t\t_graphics.lineTo(50, 50);\n\t\t_graphics.endFill();\n\n\t\t_graphics.lineStyle(10, 0xFF0000, 0.8);\n\t\t_graphics.beginFill(0xFF700B, 1);\n\n\t\t_graphics.moveTo(210, 300);\n\t\t_graphics.lineTo(450, 320);\n\t\t_graphics.lineTo(570, 350);\n\t\t_graphics.lineTo(580, 20);\n\t\t_graphics.lineTo(330, 120);\n\t\t_graphics.lineTo(410, 200);\n\t\t_graphics.lineTo(210, 300);\n\t\t_graphics.endFill();\n\n\t\t_graphics.lineStyle(2, 0x0000FF, 1);\n\t\t_graphics.drawRect(50, 250, 100, 100);\n\n\t\t_graphics.lineStyle(0);\n\t\t_graphics.beginFill(0xFFFF0B, 0.5);\n\t\t_graphics.drawCircle(470, 200, 100);\n\n\t\t_graphics.lineStyle(20, 0x33FF00);\n\t\t_graphics.moveTo(30, 30);\n\t\t_graphics.lineTo(600, 300);\n\n\t\tstage.addChild(_graphics);\n\n\t\t_thing = new Graphics();\n\t\tstage.addChild(_thing);\n\t\t_thing.position.x = Browser.window.innerWidth / 2;\n\t\t_thing.position.y = Browser.window.innerHeight / 2;\n\n\t\t_count = 0;\n\n\t\tstage.interactive = true;\n\t\tstage.on(\"click\", _onStageClick);\n\t\tstage.on(\"tap\", _onStageClick);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.1;\n\n\t\t_thing.clear();\n\t\t_thing.lineStyle(30, 0xFF0000, 1);\n\t\t_thing.beginFill(0xFF0000, 0.5);\n\n\t\t_thing.moveTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);\n\t\t_thing.lineTo(120 + Math.cos(_count) * 20, -100 + Math.sin(_count) * 20);\n\t\t_thing.lineTo(120 + Math.sin(_count) * 20, 100 + Math.cos(_count) * 20);\n\t\t_thing.lineTo(-120 + Math.cos(_count) * 20, 100 + Math.sin(_count) * 20);\n\t\t_thing.lineTo(-120 + Math.sin(_count) * 20, -100 + Math.cos(_count) * 20);\n\n\t\t_thing.rotation = _count * 0.1;\n\t}\n\n\tfunction _onStageClick(target:EventTarget) {\n\t\t_graphics.lineStyle(Math.random() * 30, Std.int(Math.random() * 0xFFFFFF), 1);\n\t\t_graphics.moveTo(Math.random() * 620, Math.random() * 380);\n\t\t_graphics.lineTo(Math.random() * 620, Math.random() * 380);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAA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eAG5B,EAA2C;EAC1C,DAAoB,EAAgB,FAAI,AAAQ,EAAgB,FAAW;EAC3E,DAAiB,EAAgB,FAAK,EAAgB;EACtD,DAAiB,EAAgB,FAAK,EAAgB;;;;;4BJtFV;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/libs/pixi.min.js b/samples/_output/libs/pixi.min.js index a04c9a06..fa1048b3 100644 --- a/samples/_output/libs/pixi.min.js +++ b/samples/_output/libs/pixi.min.js @@ -1,11 +1,10 @@ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=0&&t.length%1===0}function c(t,e){for(var r=-1,i=t.length;++ri?i:null}):(r=Y(t),e=r.length,function(){return i++,e>i?r[i]:null})}function y(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;r>n;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function x(t){return function(e,r,i){return t(e,i)}}function b(t){return function(e,r,i){i=u(i||n),e=e||[];var o=m(e);if(0>=t)return i(null);var s=!1,a=0,l=!1;!function c(){if(s&&0>=a)return i(null);for(;t>a&&!l;){var n=o();if(null===n)return s=!0,void(0>=a&&i(null));a+=1,r(e[n],n,h(function(t){a-=1,t?(i(t),l=!0):c()}))}}()}}function _(t){return function(e,r,i){return t(N.eachOf,e,r,i)}}function T(t){return function(e,r,i,n){return t(b(r),e,i,n)}}function E(t){return function(e,r,i){return t(N.eachOfSeries,e,r,i)}}function S(t,e,r,i){i=u(i||n),e=e||[];var o=l(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){o[e]=r,i(t)})},function(t){i(t,o)})}function w(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(p(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function A(t,e,r,i){w(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function C(t,e,r){return function(i,n,o,s){function a(){s&&s(r(!1,void 0))}function h(t,i,n){return s?void o(t,function(i){s&&e(i)&&(s(r(!0,t)),s=o=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(s=o,o=n,t(i,h,a))}}function M(t,e){return e}function R(t,e,r){r=r||n;var i=l(e)?[]:{};t(e,function(t,e,r){t(y(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function O(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function P(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length&&t.idle()?N.setImmediate(function(){t.drain()}):(c(e,function(e){var o={data:e,callback:i||n};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated()}),void N.setImmediate(t.process))}function o(t,e){return function(){s-=1;var r=!1,i=arguments;c(e,function(t){c(a,function(e,i){e!==t||r||(a.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a=[],u={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(t,e){i(u,t,!1,e)},kill:function(){u.drain=n,u.tasks=[]},unshift:function(t,e){i(u,t,!0,e)},process:function(){for(;!u.paused&&s=e;e++)N.setImmediate(u.process)}}};return u}function F(t){return y(function(e,r){e.apply(null,r.concat([y(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,function(e){console[t](e)}))})]))})}function D(t){return function(e,r,i){t(d(e),r,i)}}function B(t){return y(function(e,r){var i=y(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function L(t){return y(function(e){var r=e.pop();e.push(function(){var t=arguments;i?N.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var I,N={},U="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i||this;null!=U&&(I=U.async),N.noConflict=function(){return U.async=I,N};var k=Object.prototype.toString,j=Array.isArray||function(t){return"[object Array]"===k.call(t)},X=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},Y=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},G="function"==typeof setImmediate&&setImmediate,z=G?function(t){G(t)}:function(t){setTimeout(t,0)};"object"==typeof e&&"function"==typeof e.nextTick?N.nextTick=e.nextTick:N.nextTick=z,N.setImmediate=G?z:N.nextTick,N.forEach=N.each=function(t,e,r){return N.eachOf(t,x(e),r)},N.forEachSeries=N.eachSeries=function(t,e,r){return N.eachOfSeries(t,x(e),r)},N.forEachLimit=N.eachLimit=function(t,e,r,i){return b(e)(t,x(r),i)},N.forEachOf=N.eachOf=function(t,e,r){function i(t){a--,t?r(t):null===o&&0>=a&&r(null)}r=u(r||n),t=t||[];for(var o,s=m(t),a=0;null!=(o=s());)a+=1,e(t[o],o,h(i));0===a&&r(null)},N.forEachOfSeries=N.eachOfSeries=function(t,e,r){function i(){var n=!0;return null===s?r(null):(e(t[s],s,h(function(t){if(t)r(t);else{if(s=o(),null===s)return r(null);n?N.setImmediate(i):i()}})),void(n=!1))}r=u(r||n),t=t||[];var o=m(t),s=o();i()},N.forEachOfLimit=N.eachOfLimit=function(t,e,r,i){b(e)(t,r,i)},N.map=_(S),N.mapSeries=E(S),N.mapLimit=T(S),N.inject=N.foldl=N.reduce=function(t,e,r,i){N.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},N.foldr=N.reduceRight=function(t,e,r,i){var n=p(t,o).reverse();N.reduce(n,e,r,i)},N.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=j(t)?[]:{}),N.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},N.select=N.filter=_(w),N.selectLimit=N.filterLimit=T(w),N.selectSeries=N.filterSeries=E(w),N.reject=_(A),N.rejectLimit=T(A),N.rejectSeries=E(A),N.any=N.some=C(N.eachOf,s,o),N.someLimit=C(N.eachOfLimit,s,o),N.all=N.every=C(N.eachOf,a,a),N.everyLimit=C(N.eachOfLimit,a,a),N.detect=C(N.eachOf,o,M),N.detectSeries=C(N.eachOfSeries,o,M),N.detectLimit=C(N.eachOfLimit,o,M),N.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0}N.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,p(e.sort(i),function(t){return t.value}))})},N.auto=function(t,e,r){function i(t){m.unshift(t)}function o(t){var e=g(m,t);e>=0&&m.splice(e,1)}function s(){h--,c(m.slice(0),function(t){t()})}"function"==typeof arguments[1]&&(r=e,e=null),r=u(r||n);var a=Y(t),h=a.length;if(!h)return r(null);e||(e=h);var l={},p=0,d=!1,m=[];i(function(){h||r(null,l)}),c(a,function(n){function a(){return e>p&&f(x,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(n)}function h(){a()&&(p++,o(h),c[c.length-1](m,l))}if(!d){for(var u,c=j(t[n])?t[n]:[t[n]],m=y(function(t,e){if(p--,e.length<=1&&(e=e[0]),t){var i={};v(l,function(t,e){i[e]=t}),i[n]=e,d=!0,r(t,i)}else l[n]=e,N.setImmediate(s)}),x=c.slice(0,c.length-1),b=x.length;b--;){if(!(u=t[x[b]]))throw new Error("Has nonexistent dependency in "+x.join(", "));if(j(u)&&g(u,n)>=0)throw new Error("Has cyclic dependencies")}a()?(p++,c[c.length-1](m,l)):i(h)}})},N.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}N.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var o=5,s=0,a=[],h={times:o,interval:s},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},N.waterfall=function(t,e){function r(t){return y(function(i,n){if(i)e.apply(null,[i].concat(n));else{var o=t.next();o?n.push(r(o)):n.push(e),L(t).apply(null,n)}})}if(e=u(e||n),!j(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(N.iterator(t))():e()},N.parallel=function(t,e){R(N.eachOf,t,e)},N.parallelLimit=function(t,e,r){R(b(e),t,r)},N.series=function(t,e){R(N.eachOfSeries,t,e)},N.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return ri;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function o(t,e,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length?N.setImmediate(function(){t.drain()}):void c(e,function(e){var a={data:e,priority:o,callback:"function"==typeof s?s:n};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),N.setImmediate(t.process)})}var s=N.queue(t,e);return s.push=function(t,e,r){o(s,t,e,r)},delete s.unshift,s},N.cargo=function(t,e){return P(t,1,e)},N.log=F("log"),N.dir=F("dir"),N.memoize=function(t,e){var r={},i={},n=Object.prototype.hasOwnProperty;e=e||o;var s=y(function(o){var s=o.pop(),a=e.apply(null,o);n.call(r,a)?N.setImmediate(function(){s.apply(null,r[a])}):n.call(i,a)?i[a].push(s):(i[a]=[s],t.apply(null,o.concat([y(function(t){r[a]=t;var e=i[a];delete i[a];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return s.memo=r,s.unmemoized=t,s},N.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},N.times=D(N.map),N.timesSeries=D(N.mapSeries),N.timesLimit=function(t,e,r,i){return N.mapLimit(d(t),e,r,i)},N.seq=function(){var t=arguments;return y(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=n,N.reduce(t,e,function(t,e,i){e.apply(r,t.concat([y(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},N.compose=function(){return N.seq.apply(null,Array.prototype.reverse.call(arguments))},N.applyEach=B(N.eachOf),N.applyEachSeries=B(N.eachOfSeries),N.forever=function(t,e){function r(t){return t?i(t):void o(r)}var i=h(e||n),o=L(t);r()},N.ensureAsync=L,N.constant=y(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),N.wrapSync=N.asyncify=function(t){return y(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}X(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof r&&r.exports?r.exports=N:"function"==typeof t&&t.amd?t([],function(){return N}):U.async=N}()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:3}],2:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;s>h;h++)if(n[h]!==o[h]){a=h;break}for(var u=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:3}],3:[function(t,e,r){function i(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&n()}function n(){if(!l){var t=setTimeout(i);l=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(i=r[0]+"@",t=r[1]),t=t.replace(D,".");var n=t.split("."),o=s(n,e).join(".");return i+o}function h(t){for(var e,r,i=[],n=0,o=t.length;o>n;)e=t.charCodeAt(n++),e>=55296&&56319>=e&&o>n?(r=t.charCodeAt(n++),56320==(64512&r)?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--)):i.push(e);return i}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function l(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:E}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function p(t,e,r){var i=0;for(t=r?I(t/C):t>>1,t+=I(t/e);t>L*w>>1;i+=E)t=I(t/L);return I(i+(L+1)*t/(t+A))}function d(t){var e,r,i,n,s,a,h,c,d,f,v=[],g=t.length,m=0,y=R,x=M;for(r=t.lastIndexOf(O),0>r&&(r=0),i=0;r>i;++i)t.charCodeAt(i)>=128&&o("not-basic"),v.push(t.charCodeAt(i));for(n=r>0?r+1:0;g>n;){for(s=m,a=1,h=E;n>=g&&o("invalid-input"),c=l(t.charCodeAt(n++)),(c>=E||c>I((T-m)/a))&&o("overflow"),m+=c*a,d=x>=h?S:h>=x+w?w:h-x,!(d>c);h+=E)f=E-d,a>I(T/f)&&o("overflow"),a*=f;e=v.length+1,x=p(m-s,e,0==s),I(m/e)>T-y&&o("overflow"),y+=I(m/e),m%=e,v.splice(m++,0,y)}return u(v)}function f(t){var e,r,i,n,s,a,u,l,d,f,v,g,m,y,x,b=[];for(t=h(t),g=t.length,e=R,r=0,s=M,a=0;g>a;++a)v=t[a],128>v&&b.push(N(v));for(i=n=b.length,n&&b.push(O);g>i;){for(u=T,a=0;g>a;++a)v=t[a],v>=e&&u>v&&(u=v);for(m=i+1,u-e>I((T-r)/m)&&o("overflow"),r+=(u-e)*m,e=u,a=0;g>a;++a)if(v=t[a],e>v&&++r>T&&o("overflow"),v==e){for(l=r,d=E;f=s>=d?S:d>=s+w?w:d-s,!(f>l);d+=E)x=l-f,y=E-f,b.push(N(c(f+x%y,0))),l=I(x/y);b.push(N(c(l,0))),s=p(r,m,i==n),r=0,++i}++r,++e}return b.join("")}function v(t){return a(t,function(t){return P.test(t)?d(t.slice(4).toLowerCase()):t})}function g(t){return a(t,function(t){return F.test(t)?"xn--"+f(t):t})}var m="object"==typeof i&&i&&!i.nodeType&&i,y="object"==typeof r&&r&&!r.nodeType&&r,x="object"==typeof e&&e;(x.global===x||x.window===x||x.self===x)&&(n=x);var b,_,T=2147483647,E=36,S=1,w=26,A=38,C=700,M=72,R=128,O="-",P=/^xn--/,F=/[^\x20-\x7E]/,D=/[\x2E\u3002\uFF0E\uFF61]/g,B={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=E-S,I=Math.floor,N=String.fromCharCode;if(b={version:"1.3.2",ucs2:{decode:h,encode:u},decode:d,encode:f,toASCII:g,toUnicode:v},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return b});else if(m&&y)if(r.exports==m)y.exports=b;else for(_ in b)b.hasOwnProperty(_)&&(m[_]=b[_]);else n.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],5:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;u>l;++l){var c,p,d,f,v=t[l].replace(a,"%20"),g=v.indexOf(r);g>=0?(c=v.substr(0,g),p=v.substr(g+1)):(c=v,p=""),d=decodeURIComponent(c),f=decodeURIComponent(p),i(s,d)?n(s[d])?s[d].push(f):s[d]=[s[d],f]:s[d]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],6:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(v),m=["'"].concat(g),y=["%","/","?",";","#"].concat(m),x=["/","?","#"],b=255,_=/^[a-z0-9A-Z_-]{0,63}$/,T=/^([a-z0-9A-Z_-]{0,63})(.*)$/,E={javascript:!0,"javascript:":!0},S={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=t("querystring");i.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t;i=i.trim();var n=d.exec(i);if(n){n=n[0];var o=n.toLowerCase();this.protocol=o,i=i.substr(n.length)}if(r||n||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||n&&S[n]||(i=i.substr(2),this.slashes=!0)}if(!S[n]&&(s||n&&!w[n])){for(var a=-1,u=0;ul)&&(a=l)}var c,f;f=-1===a?i.lastIndexOf("@"):i.lastIndexOf("@",a),-1!==f&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;ul)&&(a=l)}-1===a&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var g=this.hostname.split(/\./),u=0,C=g.length;C>u;u++){var M=g[u];if(M&&!M.match(_)){for(var R="",O=0,P=M.length;P>O;O++)R+=M.charCodeAt(O)>127?"x":M[O];if(!R.match(_)){var F=g.slice(0,u),D=g.slice(u+1),B=M.match(T);B&&(F.push(B[1]),D.unshift(B[2])),D.length&&(i="/"+D.join(".")+i),this.hostname=F.join(".");break}}}if(this.hostname.length>b?this.hostname="":this.hostname=this.hostname.toLowerCase(),!v){for(var L=this.hostname.split("."),I=[],u=0;uu;u++){var j=m[u],X=encodeURIComponent(j);X===j&&(X=escape(j)),i=i.split(j).join(X)}var Y=i.indexOf("#");-1!==Y&&(this.hash=i.substr(Y),i=i.slice(0,Y));var G=i.indexOf("?");if(-1!==G?(this.search=i.substr(G),this.query=i.substr(G+1),e&&(this.query=A.parse(this.query)),i=i.slice(0,G)):e&&(this.search="",this.query={}),i&&(this.pathname=i),w[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",N=this.search||"";this.path=U+N}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=A.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||w[e])&&n!==!1?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+n+r+s+i},i.prototype.resolve=function(t){return this.resolveObject(n(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(h(t)){var e=new i;e.parse(t,!1,!0),t=e}var r=new i;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!w[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||S[t.protocol])r.pathname=t.pathname;else{for(var n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),p=u||a||r.host&&t.pathname,d=p,f=r.pathname&&r.pathname.split("/")||[],n=t.pathname&&t.pathname.split("/")||[],v=r.protocol&&!w[r.protocol];if(v&&(r.hostname="",r.port=null,r.host&&(""===f[0]?f[0]=r.host:f.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),p=p&&(""===n[0]||""===f[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,f=n;else if(n.length)f||(f=[]),f.pop(),f=f.concat(n),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(v){r.hostname=r.host=f.shift();var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!f.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var m=f.slice(-1)[0],y=(r.host||t.host)&&("."===m||".."===m)||""===m,x=0,b=f.length;b>=0;b--)m=f[b],"."==m?f.splice(b,1):".."===m?(f.splice(b,1),x++):x&&(f.splice(b,1),x--);if(!p&&!d)for(;x--;x)f.unshift("..");!p||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),y&&"/"!==f.join("/").substr(-1)&&f.push("");var _=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(v){r.hostname=r.host=_?"":f.length?f.shift():"";var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return p=p||r.host&&f.length,p&&!_&&f.unshift(""),f.length?r.pathname=f.join("/"):(r.pathname=null,r.path=null),l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:4,querystring:7}],9:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,a=n(t,0,o,r,!0),h=[];if(!a)return h;var u,l,p,d,f,v,g;if(i&&(a=c(t,e,a,r)),t.length>80*r){u=p=t[0],l=d=t[1];for(var m=r;o>m;m+=r)f=t[m],v=t[m+1],u>f&&(u=f),l>v&&(l=v),f>p&&(p=f),v>d&&(d=v);g=Math.max(p-u,d-l)}return s(a,h,r,u,l,g),h}function n(t,e,r,i,n){var o,s,a,h=0;for(o=e,s=r-i;r>o;o+=i)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(n===h>0)for(o=e;r>o;o+=i)a=M(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=M(o,t[o],t[o+1],a);return a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!T(i,i.next)&&0!==_(i.prev,i,i.next))i=i.next;else{if(R(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function s(t,e,r,i,n,c,p){if(t){!p&&c&&v(t,i,n,c);for(var d,f,g=t;t.prev!==t.next;)if(d=t.prev,f=t.next,c?h(t,i,n,c):a(t))e.push(d.i/r),e.push(t.i/r),e.push(f.i/r),R(t),t=f.next,g=f.next;else if(t=f,t===g){p?1===p?(t=u(t,e,r),s(t,e,r,i,n,c,2)):2===p&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(_(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(x(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&_(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(_(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=m(a,h,e,r,i),p=m(u,l,e,r,i),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&x(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;E(n,i,i.next,o)&&w(n,o)&&w(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return i}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&b(h,u)){var l=C(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var s,a,h,u,l,c=[];for(s=0,a=e.length;a>s;s++)h=e[s]*i,u=a-1>s?e[s+1]*i:t.length,l=n(t,h,u,i,!1),l===l.next&&(l.steiner=!0),c.push(y(l));for(c.sort(p),s=0;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);n>=a&&a>s&&(s=a,r=i.x=i.x&&i.x>=r.x&&x(oh||h===l&&i.x>r.x)&&w(i,t)&&(r=i,l=h)),i=i.next;return r}function v(t,e,r,i){var n=t;do null===n.z&&(n.z=m(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,g(n)}function g(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;u>e&&(a++,i=i.nextZ,i);e++);for(h=u;a>0||h>0&&i;)0===a?(n=i,i=i.nextZ,h--):0!==h&&i?r.z<=i.z?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--):(n=r,r=r.nextZ,a--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}function m(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function b(t,e){return T(t,e)||t.next.i!==e.i&&t.prev.i!==e.i&&!S(t,e)&&w(t,e)&&w(e,t)&&A(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function T(t,e){return t.x===e.x&&t.y===e.y}function E(t,e,r,i){return _(t,e,r)>0!=_(t,e,i)>0&&_(r,i,t)>0!=_(r,i,e)>0}function S(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&E(r,r.next,t,e))return!0; - r=r.next}while(r!==t);return!1}function w(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function A(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function C(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function M(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function R(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=i},{}],10:[function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var o="function"!=typeof Object.create?"~":!1;n.prototype._events=void 0,n.prototype.listeners=function(t,e){var r=o?o+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,a=new Array(s);s>n;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,s),!0}for(u=1,h=new Array(c-1);c>u;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var p,d=l.length;for(u=0;d>u;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(p=1,h=new Array(c-1);c>p;p++)h[p-1]=arguments[p];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=o?o+t:t;if(!this._events||!this._events[n])return this;var s=this._events[n],a=[];if(e)if(s.fn)(s.fn!==e||i&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,u=s.length;u>h;h++)(s[h].fn!==e||i&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=o,"undefined"!=typeof e&&(e.exports=n)},{}],11:[function(t,e,r){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var r,s,a=i(t),h=1;h=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,i(n))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var i=0,n=function(){e(t[i],function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length?r():n())})};n()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,i){var n=d(e);n.apply(null,[t,r,i])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,i){if(i=i||function(){},!e.length||0>=t)return i();var n=0,o=0,s=0;!function a(){if(n>=e.length)return i();for(;t>s&&o=e.length?i():a())})}()}},f=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},v=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},g=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},m=function(t,e,r,i){if(e=l(e,function(t,e){return{index:e,value:t}}),i){var n=[];t(e,function(t,e){r(t.value,function(r,i){n[t.index]=i,e(r)})},function(t){i(t,n)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=f(m),s.mapSeries=g(m),s.mapLimit=function(t,e,r,i){return y(e)(t,r,i)};var y=function(t){return v(t,m)};s.reduce=function(t,e,r,i){s.eachSeries(t,function(t,i){r(e,t,function(t,r){e=r,i(t)})},function(t){i(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,i){var n=l(t,function(t){return t}).reverse();s.reduce(n,e,r,i)},s.foldr=s.reduceRight;var x=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=f(x),s.filterSeries=g(x),s.select=s.filter,s.selectSeries=s.filterSeries;var b=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=f(b),s.rejectSeries=g(b);var _=function(t,e,r,i){t(e,function(t,e){r(t,function(r){r?(i(t),i=function(){}):e()})},function(t){i()})};s.detect=f(_),s.detectSeries=g(_),s.some=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t&&(r(!0),r=function(){}),i()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t||(r(!1),r=function(){}),i()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){if(t)return r(t);var i=function(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0};r(null,l(e.sort(i),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=p(t),i=r.length;if(!i)return e();var n={},o=[],a=function(t){o.unshift(t)},l=function(t){for(var e=0;ei;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function n(t,e,n,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:n,callback:"function"==typeof o?o:null};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){n(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,i=[],n={tasks:i,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),u(t,function(t){i.push({data:t,callback:"function"==typeof r?r:null}),n.drained=!1,n.saturated&&i.length===e&&n.saturated()}),s.setImmediate(n.process)},process:function o(){if(!r){if(0===i.length)return n.drain&&!n.drained&&n.drain(),void(n.drained=!0);var s="number"==typeof e?i.splice(0,e):i.splice(0,i.length),a=l(s,function(t){return t.data});n.empty&&n.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return i.length},running:function(){return r}};return n};var S=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=S("log"),s.dir=S("dir"),s.memoize=function(t,e){var r={},i={};e=e||function(t){return t};var n=function(){var n=Array.prototype.slice.call(arguments),o=n.pop(),a=e.apply(null,n);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in i?i[a].push(o):(i[a]=[o],t.apply(null,n.concat([function(){r[a]=arguments;var t=i[a];delete i[a];for(var e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)}])))};return n.memo=r,n.unmemoized=t,n},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.map(i,e,r)},s.timesSeries=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.mapSeries(i,e,r)},s.seq=function(){var t=arguments;return function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();s.reduce(t,r,function(t,r,i){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);i(t,e)}]))},function(t,r){i.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var w=function(t,e){var r=function(){var r=this,i=Array.prototype.slice.call(arguments),n=i.pop();return t(e,function(t,e){t.apply(r,i.concat([e]))},n)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return r.apply(this,i)}return r};s.applyEach=f(w),s.applyEachSeries=g(w),s.forever=function(t,e){function r(i){if(i){if(e)return e(i);throw i}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):n.async=s}()}).call(this,e("_process"))},{_process:3}],13:[function(t,e,r){function i(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=n.queue(this._boundLoadResource,e),this.resources={}}var n=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.add=i.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n0)if(this.xhrType===i.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===i.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},i.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},i.prototype._determineXhrType=function(){return i._xhrTypeMap[this._getExtension()]||i.XHR_RESPONSE_TYPE.TEXT},i.prototype._determineLoadType=function(){return i._loadTypeMap[this._getExtension()]||i.LOAD_TYPE.XHR},i.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?");-1!==i&&(e=e.substring(0,i)),t=e.substring(e.lastIndexOf(".")+1)}return t},i.prototype._getMimeFromXhrType=function(t){switch(t){case i.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case i.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case i.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case i.XHR_RESPONSE_TYPE.JSON:return"application/json";case i.XHR_RESPONSE_TYPE.DEFAULT:case i.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},i.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},i._loadTypeMap={gif:i.LOAD_TYPE.IMAGE,png:i.LOAD_TYPE.IMAGE,bmp:i.LOAD_TYPE.IMAGE,jpg:i.LOAD_TYPE.IMAGE,jpeg:i.LOAD_TYPE.IMAGE,tif:i.LOAD_TYPE.IMAGE,tiff:i.LOAD_TYPE.IMAGE,webp:i.LOAD_TYPE.IMAGE,tga:i.LOAD_TYPE.IMAGE},i._xhrTypeMap={xhtml:i.XHR_RESPONSE_TYPE.DOCUMENT,html:i.XHR_RESPONSE_TYPE.DOCUMENT,htm:i.XHR_RESPONSE_TYPE.DOCUMENT,xml:i.XHR_RESPONSE_TYPE.DOCUMENT,tmx:i.XHR_RESPONSE_TYPE.DOCUMENT,tsx:i.XHR_RESPONSE_TYPE.DOCUMENT,svg:i.XHR_RESPONSE_TYPE.DOCUMENT,gif:i.XHR_RESPONSE_TYPE.BLOB,png:i.XHR_RESPONSE_TYPE.BLOB,bmp:i.XHR_RESPONSE_TYPE.BLOB,jpg:i.XHR_RESPONSE_TYPE.BLOB,jpeg:i.XHR_RESPONSE_TYPE.BLOB,tif:i.XHR_RESPONSE_TYPE.BLOB,tiff:i.XHR_RESPONSE_TYPE.BLOB,webp:i.XHR_RESPONSE_TYPE.BLOB,tga:i.XHR_RESPONSE_TYPE.BLOB,json:i.XHR_RESPONSE_TYPE.JSON,text:i.XHR_RESPONSE_TYPE.TEXT,txt:i.XHR_RESPONSE_TYPE.TEXT},i.setExtensionLoadType=function(t,e){o(i._loadTypeMap,t,e)},i.setExtensionXhrType=function(t,e){o(i._xhrTypeMap,t,e)}},{eventemitter3:10,url:8}],15:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",i=new Array(4),n=0,o=0,s=0;n>2,i[1]=(3&e[0])<<4|e[1]>>4,i[2]=(15&e[1])<<2|e[2]>>6,i[3]=63&e[2],s=n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o=0;r--)this.updateAccessibleObjects(e[r])},i.prototype.update=function(){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;othis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},i.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.title=t.accessibleTitle||"displayObject "+this.tabIndex,t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},i.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},i.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},i.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction; - e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},i.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},i.prototype._onMouseMove=function(){this.deactivate()},i.prototype.destroy=function(){this.div=null;for(var t=0;t1)for(var r=0;e>r;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},i.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},i.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(0>r||0>i)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t,this.onChildrenChange(i>r?r:i)}},i.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},i.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);o.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},i.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},i.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;e>r;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(-1===i)return;t.parent=null,o.removeItems(this.children,i,1),this.onChildrenChange(i),t.emit("removed",this)}return t},i.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,o.removeItems(this.children,t,1),this.onChildrenChange(t),e.emit("removed",this),e},i.prototype.removeChildren=function(t,e){var r,i,n=t||0,o="number"==typeof e?e:this.children.length,s=o-n;if(s>0&&o>=s){for(r=this.children.splice(n,s),i=0;it;++t)this.children[t].updateTransform()}},i.prototype.containerUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=0,l=this.children.length;l>u;++u){var c=this.children[u];c.visible&&(h=!0,t=this.children[u].getBounds(),i=ie?s:e,a=a>r?a:r)}if(!h)return n.Rectangle.EMPTY;var p=this._bounds;p.x=i,p.y=o,p.width=s-i,p.height=a-o,this._currentBounds=p}return this._currentBounds},i.prototype.containerGetBounds=i.prototype.getBounds,i.prototype.getLocalBounds=function(){var t=this.worldTransform;this.worldTransform=n.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.worldTransform=t,this._currentBounds=null,this.getBounds(n.Matrix.IDENTITY)},i.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},i.prototype._renderWebGL=function(t){},i.prototype._renderCanvas=function(t){},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},i.prototype.destroy=function(t){if(s.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":33,"../textures/RenderTexture":71,"../utils":77,"./DisplayObject":24}],24:[function(t,e,r){function i(){s.call(this),this.position=new n.Point,this.scale=new n.Point(1,1),this.pivot=new n.Point(0,0),this.skew=new n.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new n.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}var n=t("../math"),o=t("../textures/RenderTexture"),s=t("eventemitter3"),a=t("../const"),h=new n.Matrix,u={worldTransform:new n.Matrix,worldAlpha:1,children:[]};i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.updateTransform=function(){var t,e,r,i,n,o,s=this.parent.worldTransform,u=this.worldTransform;this.skew.x||this.skew.y?(h.setTransform(this.position.x,this.position.y,this.pivot.x,this.pivot.y,this.scale.x,this.scale.y,this.rotation,this.skew.x,this.skew.y),u.a=h.a*s.a+h.b*s.c,u.b=h.a*s.b+h.b*s.d,u.c=h.c*s.a+h.d*s.c,u.d=h.c*s.b+h.d*s.d,u.tx=h.tx*s.a+h.ty*s.c+s.tx,u.ty=h.tx*s.b+h.ty*s.d+s.ty):this.rotation%a.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),t=this._cr*this.scale.x,e=this._sr*this.scale.x,r=-this._sr*this.scale.y,i=this._cr*this.scale.y,n=this.position.x,o=this.position.y,(this.pivot.x||this.pivot.y)&&(n-=this.pivot.x*t+this.pivot.y*r,o-=this.pivot.x*e+this.pivot.y*i),u.a=t*s.a+e*s.c,u.b=t*s.b+e*s.d,u.c=r*s.a+i*s.c,u.d=r*s.b+i*s.d,u.tx=n*s.a+o*s.c+s.tx,u.ty=n*s.b+o*s.d+s.ty):(t=this.scale.x,i=this.scale.y,n=this.position.x-this.pivot.x*t,o=this.position.y-this.pivot.y*i,u.a=t*s.a,u.b=t*s.b,u.c=i*s.c,u.d=i*s.d,u.tx=n*s.a+o*s.c+s.tx,u.ty=n*s.b+o*s.d+s.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(t){return n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},i.prototype.toLocal=function(t,e,r){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=u,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t,r)},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.generateTexture=function(t,e,r){var i=this.getLocalBounds(),n=new o(t,0|i.width,0|i.height,e,r);return h.tx=-i.x,h.ty=-i.y,n.render(this,h),n},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.position.x=t||0,this.position.y=e||0,this.scale.x=r?r:1,this.scale.y=i?i:1,this.rotation=n||0,this.skew.x=o||0,this.skew.y=s||0,this.pivot.x=a||0,this.pivot.y=h||0,this},i.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.skew=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":22,"../math":33,"../textures/RenderTexture":71,eventemitter3:10}],25:[function(t,e,r){function i(){n.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=l.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new u.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var n=t("../display/Container"),o=t("../textures/Texture"),s=t("../renderers/canvas/utils/CanvasBuffer"),a=t("../renderers/canvas/utils/CanvasGraphics"),h=t("./GraphicsData"),u=t("../math"),l=t("../const"),c=new u.Point;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){var t=new i;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)l=c/s,n=h+(t-h)*l,o=u+(e-u)*l,a.push(n+(t+(r-t)*l-n)*l,o+(e+(i-e)*l-o)*l);return this.dirty=this.boundsDirty=!0,this},i.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var s,a,h,u,l,c=20,p=this.currentPath.shape.points,d=p[p.length-2],f=p[p.length-1],v=0,g=1;c>=g;++g)v=g/c,s=1-v,a=s*s,h=a*s,u=v*v,l=u*v,p.push(h*d+3*a*v*t+3*s*u*r+l*n,h*f+3*a*v*e+3*s*u*i+l*o);return this.dirty=this.boundsDirty=!0,this},i.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,u=s-t,l=i-e,c=r-t,p=Math.abs(h*c-u*l);if(1e-8>p||0===n)(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);else{var d=h*h+u*u,f=l*l+c*c,v=h*l+u*c,g=n*Math.sqrt(d)/p,m=n*Math.sqrt(f)/p,y=g*v/d,x=m*v/f,b=g*c+m*u,_=g*l+m*h,T=u*(m+y),E=h*(m+y),S=c*(g+x),w=l*(g+x),A=Math.atan2(E-_,T-b),C=Math.atan2(w-_,S-b);this.arc(b+t,_+e,n,A,C,u*l>c*h)}return this.dirty=this.boundsDirty=!0,this},i.prototype.arc=function(t,e,r,i,n,o){if(o=o||!1,i===n)return this;!o&&i>=n?n+=2*Math.PI:o&&n>=i&&(i+=2*Math.PI);var s=o?-1*(i-n):n-i,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(i)*r,u=e+Math.sin(i)*r;this.currentPath?this.currentPath.shape.points.push(h,u):this.moveTo(h,u);for(var l=this.currentPath.shape.points,c=s/(2*a),p=2*c,d=Math.cos(c),f=Math.sin(c),v=a-1,g=v%1/v,m=0;v>=m;m++){var y=m+g*m,x=c+i+p*y,b=Math.cos(x),_=-Math.sin(x);l.push((d*b+f*_)*r+t,(d*-_+f*b)*r+e)}return this.dirty=this.boundsDirty=!0,this},i.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.prototype.drawRect=function(t,e,r,i){return this.drawShape(new u.Rectangle(t,e,r,i)),this},i.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new u.RoundedRectangle(t,e,r,i,n)),this},i.prototype.drawCircle=function(t,e,r){return this.drawShape(new u.Circle(t,e,r)),this},i.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new u.Ellipse(t,e,r,i)),this},i.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof u.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;ig?g:S,S=S>y?y:S,S=S>b?b:S,w=w>m?m:w,w=w>x?x:w,w=w>_?_:w,T=g>T?g:T,T=y>T?y:T,T=b>T?b:T,E=m>E?m:E,E=x>E?x:E,E=_>E?_:E,this._bounds.x=S,this._bounds.width=T-S,this._bounds.y=w,this._bounds.height=E-w,this._currentBounds=this._bounds}return this._currentBounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,c);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,i=a+u>i?a+u:i;else if(d===l.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,u=n.radius+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else if(d===l.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,u=n.height+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else{o=n.points;for(var v=0;vs-f?s-f:t,e=s+f>e?s+f:e,r=r>a-f?a-f:r,i=a+f>i?a+f:i}}else t=0,e=0,r=0,i=0;var g=this.boundsPadding;this._localBounds.x=t-g,this._localBounds.width=e-t+2*g,this._localBounds.y=r-g,this._localBounds.height=i-r+2*g},i.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===l.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},i.prototype.destroy=function(){n.prototype.destroy.apply(this,arguments);for(var t=0;ta;a++)e=s.data[a],1===s.data[a].mode?(r.stencilManager.pushStencil(t,e),i.uniform1f(r.shaderManager.complexPrimitiveShader.uniforms.alpha._location,t.worldAlpha*e.alpha),i.drawElements(i.TRIANGLE_FAN,4,i.UNSIGNED_SHORT,2*(e.indices.length-4)),r.stencilManager.popStencil(t,e)):(o=r.shaderManager.primitiveShader,r.shaderManager.setShader(o),i.uniformMatrix3fv(o.uniforms.translationMatrix._location,!1,t.worldTransform.toArray(!0)),i.uniformMatrix3fv(o.uniforms.projectionMatrix._location,!1,r.currentRenderTarget.projectionMatrix.toArray(!0)),i.uniform3fv(o.uniforms.tint._location,n.hex2rgb(t.tint)),i.uniform1f(o.uniforms.alpha._location,t.worldAlpha),i.bindBuffer(i.ARRAY_BUFFER,e.buffer),i.vertexAttribPointer(o.attributes.aVertexPosition,2,i.FLOAT,!1,24,0),i.vertexAttribPointer(o.attributes.aColor,4,i.FLOAT,!1,24,8),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.indexBuffer),i.drawElements(i.TRIANGLE_STRIP,e.indices.length,i.UNSIGNED_SHORT,0)),r.drawCount++},i.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[e.id];r||(r=t._webGL[e.id]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i=6)if(a.points.length<2*this.maximumSimplePolySize){o=this.switchMode(r,0);var h=this.buildPoly(a,o);h||(o=this.switchMode(r,1),this.buildComplexPoly(a,o))}else o=this.switchMode(r,1),this.buildComplexPoly(a,o);a.lineWidth>0&&(o=this.switchMode(r,0),this.buildLine(a,o))}else o=this.switchMode(r,0),a.type===s.SHAPES.RECT?this.buildRectangle(a,o):a.type===s.SHAPES.CIRC||a.type===s.SHAPES.ELIP?this.buildCircle(a,o):a.type===s.SHAPES.RREC&&this.buildRoundedRectangle(a,o);r.lastIndex++}for(i=0;i32e4||r.mode!==e||1===e)&&(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r))):(r=this.graphicsDataPool.pop()||new u(t.gl),r.mode=e,t.data.push(r)),r.dirty=!0,r},i.prototype.buildRectangle=function(t,e){var r=t.shape,i=r.x,o=r.y,s=r.width,a=r.height;if(t.fill){var h=n.hex2rgb(t.fillColor),u=t.fillAlpha,l=h[0]*u,c=h[1]*u,p=h[2]*u,d=e.points,f=e.indices,v=d.length/6;d.push(i,o),d.push(l,c,p,u),d.push(i+s,o),d.push(l,c,p,u),d.push(i,o+a),d.push(l,c,p,u),d.push(i+s,o+a),d.push(l,c,p,u),f.push(v,v,v+1,v+2,v+3,v+3)}if(t.lineWidth){var g=t.points;t.points=[i,o,i+s,o,i+s,o+a,i,o+a,i,o],this.buildLine(t,e),t.points=g}},i.prototype.buildRoundedRectangle=function(t,e){var r=t.shape,i=r.x,o=r.y,s=r.width,a=r.height,h=r.radius,u=[];if(u.push(i,o+h),this.quadraticBezierCurve(i,o+a-h,i,o+a,i+h,o+a,u),this.quadraticBezierCurve(i+s-h,o+a,i+s,o+a,i+s,o+a-h,u),this.quadraticBezierCurve(i+s,o+h,i+s,o,i+s-h,o,u),this.quadraticBezierCurve(i+h,o,i,o,i,o+h+1e-10,u),t.fill){var c=n.hex2rgb(t.fillColor),p=t.fillAlpha,d=c[0]*p,f=c[1]*p,v=c[2]*p,g=e.points,m=e.indices,y=g.length/6,x=l(u,null,2),b=0;for(b=0;b=m;m++)g=m/f,h=a(t,r,g),u=a(e,i,g),l=a(r,n,g),c=a(i,o,g),p=a(h,l,g),d=a(u,c,g),v.push(p,d);return v},i.prototype.buildCircle=function(t,e){var r,i,o=t.shape,a=o.x,h=o.y;t.type===s.SHAPES.CIRC?(r=o.radius,i=o.radius):(r=o.width,i=o.height);var u=Math.floor(30*Math.sqrt(o.radius))||Math.floor(15*Math.sqrt(o.width+o.height)),l=2*Math.PI/u,c=0;if(t.fill){var p=n.hex2rgb(t.fillColor),d=t.fillAlpha,f=p[0]*d,v=p[1]*d,g=p[2]*d,m=e.points,y=e.indices,x=m.length/6;for(y.push(x),c=0;u+1>c;c++)m.push(a,h,f,v,g,d),m.push(a+Math.sin(l*c)*r,h+Math.cos(l*c)*i,f,v,g,d),y.push(x++,x++);y.push(x-1)}if(t.lineWidth){var b=t.points;for(t.points=[],c=0;u+1>c;c++)t.points.push(a+Math.sin(l*c)*r,h+Math.cos(l*c)*i);this.buildLine(t,e),t.points=b}},i.prototype.buildLine=function(t,e){var r=0,i=t.points;if(0!==i.length){var s=new o.Point(i[0],i[1]),a=new o.Point(i[i.length-2],i[i.length-1]);if(s.x===a.x&&s.y===a.y){i=i.slice(),i.pop(),i.pop(),a=new o.Point(i[i.length-2],i[i.length-1]);var h=a.x+.5*(s.x-a.x),u=a.y+.5*(s.y-a.y);i.unshift(h,u),i.push(h,u)}var l,c,p,d,f,v,g,m,y,x,b,_,T,E,S,w,A,C,M,R,O,P,F,D=e.points,B=e.indices,L=i.length/2,I=i.length,N=D.length/6,U=t.lineWidth/2,k=n.hex2rgb(t.lineColor),j=t.lineAlpha,X=k[0]*j,Y=k[1]*j,G=k[2]*j;for(p=i[0],d=i[1],f=i[2],v=i[3],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,D.push(p-y,d-x,X,Y,G,j),D.push(p+y,d+x,X,Y,G,j),r=1;L-1>r;r++)p=i[2*(r-1)],d=i[2*(r-1)+1],f=i[2*r],v=i[2*r+1],g=i[2*(r+1)],m=i[2*(r+1)+1],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,b=-(v-m),_=f-g,F=Math.sqrt(b*b+_*_),b/=F,_/=F,b*=U,_*=U,S=-x+d-(-x+v),w=-y+f-(-y+p),A=(-y+p)*(-x+v)-(-y+f)*(-x+d),C=-_+m-(-_+v),M=-b+f-(-b+g),R=(-b+g)*(-_+v)-(-b+f)*(-_+m),O=S*M-C*w,Math.abs(O)<.1?(O+=10.1,D.push(f-y,v-x,X,Y,G,j),D.push(f+y,v+x,X,Y,G,j)):(l=(w*R-M*A)/O,c=(C*A-S*R)/O,P=(l-f)*(l-f)+(c-v)*(c-v),P>19600?(T=y-b,E=x-_,F=Math.sqrt(T*T+E*E),T/=F,E/=F,T*=U,E*=U,D.push(f-T,v-E),D.push(X,Y,G,j),D.push(f+T,v+E),D.push(X,Y,G,j),D.push(f-T,v-E),D.push(X,Y,G,j),I++):(D.push(l,c),D.push(X,Y,G,j),D.push(f-(l-f),v-(c-v)),D.push(X,Y,G,j)));for(p=i[2*(L-2)],d=i[2*(L-2)+1],f=i[2*(L-1)],v=i[2*(L-1)+1],y=-(d-v),x=p-f,F=Math.sqrt(y*y+x*x),y/=F,x/=F,y*=U,x*=U,D.push(f-y,v-x),D.push(X,Y,G,j),D.push(f+y,v+x),D.push(X,Y,G,j),B.push(N),r=0;I>r;r++)B.push(N++);B.push(N-1)}},i.prototype.buildComplexPoly=function(t,e){var r=t.points.slice();if(!(r.length<6)){var i=e.indices;e.points=r,e.alpha=t.fillAlpha,e.color=n.hex2rgb(t.fillColor);for(var o,s,a=1/0,h=-(1/0),u=1/0,l=-(1/0),c=0;co?o:a,h=o>h?o:h,u=u>s?s:u,l=s>l?s:l;r.push(a,u,h,u,h,l,a,l);var p=r.length/2;for(c=0;p>c;c++)i.push(c)}},i.prototype.buildPoly=function(t,e){var r=t.points;if(!(r.length<6)){var i=e.points,o=e.indices,s=r.length/2,a=n.hex2rgb(t.fillColor),h=t.fillAlpha,u=a[0]*h,c=a[1]*h,p=a[2]*h,d=l(r,null,2);if(!d)return!1;var f=i.length/6,v=0;for(v=0;vv;v++)i.push(r[2*v],r[2*v+1],u,c,p,h);return!0}}},{"../../const":22,"../../math":33,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63,"../../utils":77,"./WebGLGraphicsData":28,earcut:9}],28:[function(t,e,r){function i(t){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}i.prototype.constructor=i,e.exports=i,i.prototype.reset=function(){this.points.length=0,this.indices.length=0},i.prototype.upload=function(){var t=this.gl;this.glPoints=new Float32Array(this.points),t.bindBuffer(t.ARRAY_BUFFER,this.buffer),t.bufferData(t.ARRAY_BUFFER,this.glPoints,t.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.glIndices,t.STATIC_DRAW),this.dirty=!1},i.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],29:[function(t,e,r){var i=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Sprite:t("./sprites/Sprite"),ParticleContainer:t("./particles/ParticleContainer"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),ParticleRenderer:t("./particles/webgl/ParticleRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasGraphics:t("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:t("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),WebGLManager:t("./renderers/webgl/managers/WebGLManager"),ShaderManager:t("./renderers/webgl/managers/ShaderManager"),Shader:t("./renderers/webgl/shaders/Shader"),TextureShader:t("./renderers/webgl/shaders/TextureShader"),PrimitiveShader:t("./renderers/webgl/shaders/PrimitiveShader"),ComplexPrimitiveShader:t("./renderers/webgl/shaders/ComplexPrimitiveShader"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),AbstractFilter:t("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:t("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:t("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},{"./const":22,"./display/Container":23,"./display/DisplayObject":24,"./graphics/Graphics":25,"./graphics/GraphicsData":26,"./graphics/webgl/GraphicsRenderer":27,"./math":33,"./particles/ParticleContainer":39,"./particles/webgl/ParticleRenderer":41,"./renderers/canvas/CanvasRenderer":44,"./renderers/canvas/utils/CanvasBuffer":45,"./renderers/canvas/utils/CanvasGraphics":46,"./renderers/webgl/WebGLRenderer":49,"./renderers/webgl/filters/AbstractFilter":50,"./renderers/webgl/filters/FXAAFilter":51,"./renderers/webgl/filters/SpriteMaskFilter":52,"./renderers/webgl/managers/ShaderManager":56,"./renderers/webgl/managers/WebGLManager":58,"./renderers/webgl/shaders/ComplexPrimitiveShader":59,"./renderers/webgl/shaders/PrimitiveShader":60,"./renderers/webgl/shaders/Shader":61,"./renderers/webgl/shaders/TextureShader":62,"./renderers/webgl/utils/ObjectRenderer":63,"./renderers/webgl/utils/RenderTarget":65,"./sprites/Sprite":67,"./sprites/webgl/SpriteRenderer":68,"./text/Text":69,"./textures/BaseTexture":70,"./textures/RenderTexture":71,"./textures/Texture":72,"./textures/TextureUvs":73,"./textures/VideoBaseTexture":74,"./ticker":76,"./utils":77}],30:[function(t,e,r){function i(t){return 0>t?-1:t>0?1:0}function n(){for(var t=0;16>t;t++){var e=[];c.push(e);for(var r=0;16>r;r++)for(var n=i(o[t]*o[r]+a[t]*s[r]),p=i(s[t]*o[r]+h[t]*s[r]),d=i(o[t]*a[r]+a[t]*h[r]),f=i(s[t]*a[r]+h[t]*h[r]),v=0;16>v;v++)if(o[v]===n&&s[v]===p&&a[v]===d&&h[v]===f){e.push(v);break}}for(t=0;16>t;t++){var g=new l; - g.set(o[t],s[t],a[t],h[t],0,0),u.push(g)}}var o=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=t("./Matrix"),c=[];n();var p={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return c[t][e]},sub:function(t,e){return c[t][p.inv(e)]},rotate180:function(t){return 4^t},isSwapWidthHeight:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?p.S:p.N:2*Math.abs(e)<=Math.abs(t)?t>0?p.E:p.W:e>0?t>0?p.SE:p.SW:t>0?p.NE:p.NW},matrixAppendRotationInv:function(t,e,r,i){var n=u[p.inv(e)];r=r||0,i=i||0,n.tx=r,n.ty=i,t.append(n)}};e.exports=p},{"./Matrix":31}],31:[function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=t("./Point");i.prototype.constructor=i,e.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*r*i+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){var u,l,c,p,d,f,v,g,m,y;return d=Math.sin(s),f=Math.cos(s),v=Math.cos(h),g=Math.sin(h),m=-Math.sin(a),y=Math.cos(a),u=f*n,l=d*n,c=-d*o,p=f*o,this.a=v*u+g*c,this.b=v*l+g*p,this.c=m*u+y*c,this.d=m*l+y*p,this.tx=t+(r*u+i*c),this.ty=e+(r*l+i*p),this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},{"./Point":32}],32:[function(t,e,r){function i(t,e){this.x=t||0,this.y=e||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y)},i.prototype.copy=function(t){this.set(t.x,t.y)},i.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},i.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],33:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),GroupD8:t("./GroupD8"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./GroupD8":30,"./Matrix":31,"./Point":32,"./shapes/Circle":34,"./shapes/Ellipse":35,"./shapes/Polygon":36,"./shapes/Rectangle":37,"./shapes/RoundedRectangle":38}],34:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":22,"./Rectangle":37}],35:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=o.SHAPES.ELIP}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":22,"./Rectangle":37}],36:[function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)i.push(e[s].x,e[s].y);e=i}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var n=t("../Point"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;i>n;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1],l=a>e!=u>e&&(h-s)*(e-a)/(u-a)+s>t;l&&(r=!r)}return r}},{"../../const":22,"../Point":32}],37:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height?!0:!1}},{"../../const":22}],39:[function(t,e,r){function i(t,e,r){n.call(this),r=r||15e3,t=t||15e3;var i=16384;r>i&&(r=i),r>t&&(r=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._buffers=null,this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=o.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(e)}var n=t("../display/Container"),o=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);er;r+=6,i+=4)this.indices[r+0]=i+0,this.indices[r+1]=i+1,this.indices[r+2]=i+2,this.indices[r+3]=i+0,this.indices[r+4]=i+2,this.indices[r+5]=i+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new h.Matrix}var n=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("./ParticleShader"),a=t("./ParticleBuffer"),h=t("../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,o.registerPlugin("particle",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=new s(this.renderer.shaderManager),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,size:1,uploadFunction:this.uploadAlpha,offset:0}]},i.prototype.start=function(){var t=this.renderer.gl;t.activeTexture(t.TEXTURE0),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.shader;this.renderer.shaderManager.setShader(e)},i.prototype.render=function(t){var e=t.children,r=e.length,i=t._maxSize,n=t._batchSize;if(0!==r){r>i&&(r=i),t._buffers||(t._buffers=this.generateBuffers(t)),this.renderer.blendModeManager.setBlendMode(t.blendMode);var o=this.renderer.gl,s=t.worldTransform.copy(this.tempMatrix);s.prepend(this.renderer.currentRenderTarget.projectionMatrix),o.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,s.toArray(!0)),o.uniform1f(this.shader.uniforms.uAlpha._location,t.worldAlpha);var a=e[0]._texture.baseTexture;if(a._glTextures[o.id])o.bindTexture(o.TEXTURE_2D,a._glTextures[o.id]);else{if(!this.renderer.updateTexture(a))return;t._properties[0]&&t._properties[3]||(t._bufferToUpdate=0)}for(var h=0,u=0;r>h;h+=n,u+=1){var l=r-h;l>n&&(l=n);var c=t._buffers[u];c.uploadDynamic(e,h,l),t._bufferToUpdate===u&&(c.uploadStatic(e,h,l),t._bufferToUpdate=u+1),c.bind(this.shader),o.drawElements(o.TRIANGLES,6*l,o.UNSIGNED_SHORT,0),this.renderer.drawCount++}}},i.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._maxSize,o=t._batchSize,s=t._properties;for(e=0;n>e;e+=o)i.push(new a(r,this.properties,s,o));return i},i.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,u,l,c,p,d,f,v=0;r>v;v++)s=t[e+v],a=s._texture,u=s.scale.x,l=s.scale.y,a.trim?(h=a.trim,p=h.x-s.anchor.x*h.width,c=p+a.crop.width,f=h.y-s.anchor.y*h.height,d=f+a.crop.height):(c=a._frame.width*(1-s.anchor.x),p=a._frame.width*-s.anchor.x,d=a._frame.height*(1-s.anchor.y),f=a._frame.height*-s.anchor.y),i[o]=p*u,i[o+1]=f*l,i[o+n]=c*u,i[o+n+1]=f*l,i[o+2*n]=c*u,i[o+2*n+1]=d*l,i[o+3*n]=p*u,i[o+3*n+1]=d*l,o+=4*n},i.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},i.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},i.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":33,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63,"./ParticleBuffer":40,"./ParticleShader":42}],42:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var n=t("../../renderers/webgl/shaders/TextureShader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"../../renderers/webgl/shaders/TextureShader":62}],43:[function(t,e,r){function i(t,e,r,i){if(a.call(this),n.sayHello(t),i)for(var h in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof i[h]&&(i[h]=s.DEFAULT_RENDER_OPTIONS[h]);else i=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution,this.transparent=i.transparent,this.autoResize=i.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this.roundPixels=i.roundPixels,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new o.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var n=t("../utils"),o=t("../math"),s=t("../const"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgb)}}}),i.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},i.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":22,"../math":33,"../utils":77,eventemitter3:10}],44:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"Canvas",t,e,r),this.type=h.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new o,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new a.Matrix,worldAlpha:1},this.resize(t,e)}var n=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("../../utils"),a=t("../../math"),h=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,s.pluginTarget.mixin(i),i.prototype.render=function(t){this.emit("prerender");var e=t.parent;this._lastObjectRendered=t,t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=e,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.context.globalCompositeOperation=this.blendModes[h.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(t,this.context),this.emit("postrender")},i.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.renderDisplayObject=function(t,e){var r=this.context;this.context=e,t.renderCanvas(this),this.context=r},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.context[this.smoothProperty]=h.SCALE_MODES.DEFAULT===h.SCALE_MODES.LINEAR)},i.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},s.canUseNewCanvasBlendModes()?(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[h.BLEND_MODES.SCREEN]="screen",this.blendModes[h.BLEND_MODES.OVERLAY]="overlay",this.blendModes[h.BLEND_MODES.DARKEN]="darken",this.blendModes[h.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[h.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[h.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[h.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[h.BLEND_MODES.HUE]="hue",this.blendModes[h.BLEND_MODES.SATURATION]="saturate",this.blendModes[h.BLEND_MODES.COLOR]="color",this.blendModes[h.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[h.BLEND_MODES.NORMAL]="source-over",this.blendModes[h.BLEND_MODES.ADD]="lighter",this.blendModes[h.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[h.BLEND_MODES.SCREEN]="source-over",this.blendModes[h.BLEND_MODES.OVERLAY]="source-over",this.blendModes[h.BLEND_MODES.DARKEN]="source-over",this.blendModes[h.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[h.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[h.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[h.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[h.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[h.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[h.BLEND_MODES.HUE]="source-over",this.blendModes[h.BLEND_MODES.SATURATION]="source-over",this.blendModes[h.BLEND_MODES.COLOR]="source-over",this.blendModes[h.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":22,"../../math":33,"../../utils":77,"../SystemRenderer":43,"./utils/CanvasMaskManager":47}],45:[function(t,e,r){function i(t,e){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=t,this.canvas.height=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),i.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},i.prototype.resize=function(t,e){this.canvas.width=t,this.canvas.height=e},i.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],46:[function(t,e,r){var i=t("../../../const"),n={};e.exports=n,n.renderGraphics=function(t,e){var r=t.worldAlpha;t.dirty&&(this.updateGraphicsTint(t),t.dirty=!1);for(var n=0;nC?C:A,e.beginPath(),e.moveTo(T,E+A),e.lineTo(T,E+w-A),e.quadraticCurveTo(T,E+w,T+A,E+w),e.lineTo(T+S-A,E+w),e.quadraticCurveTo(T+S,E+w,T+S,E+w-A),e.lineTo(T+S,E+A),e.quadraticCurveTo(T+S,E,T+S-A,E),e.lineTo(T+A,E),e.quadraticCurveTo(T,E,T,E+A),e.closePath(),(o.fillColor||0===o.fillColor)&&(e.globalAlpha=o.fillAlpha*r,e.fillStyle="#"+("00000"+(0|a).toString(16)).substr(-6),e.fill()),o.lineWidth&&(e.globalAlpha=o.lineAlpha*r,e.strokeStyle="#"+("00000"+(0|h).toString(16)).substr(-6),e.stroke())}}},n.renderGraphicsMask=function(t,e){var r=t.graphicsData.length;if(0!==r){e.beginPath();for(var n=0;r>n;n++){var o=t.graphicsData[n],s=o.shape;if(o.type===i.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hw?w:S,e.moveTo(b,_+S),e.lineTo(b,_+E-S),e.quadraticCurveTo(b,_+E,b+S,_+E),e.lineTo(b+T-S,_+E),e.quadraticCurveTo(b+T,_+E,b+T,_+E-S),e.lineTo(b+T,_+S),e.quadraticCurveTo(b+T,_,b+T-S,_),e.lineTo(b+S,_),e.quadraticCurveTo(b,_,b,_+S),e.closePath()}}}},n.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}}},{"../../../const":22}],47:[function(t,e,r){function i(){}var n=t("./CanvasGraphics");i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t,e){e.context.save();var r=t.alpha,i=t.worldTransform,o=e.resolution;e.context.setTransform(i.a*o,i.b*o,i.c*o,i.d*o,i.tx*o,i.ty*o),t.texture||(n.renderGraphicsMask(t,e.context),e.context.clip()),t.worldAlpha=r},i.prototype.popMask=function(t){t.context.restore()},i.prototype.destroy=function(){}},{"./CanvasGraphics":46}],48:[function(t,e,r){var i=t("../../../utils"),n={};e.exports=n,n.getTintedTexture=function(t,e){var r=t.texture;e=n.roundColor(e);var i="#"+("00000"+(0|e).toString(16)).substr(-6);if(r.tintCache=r.tintCache||{},r.tintCache[i])return r.tintCache[i];var o=n.canvas||document.createElement("canvas");if(n.tintMethod(r,e,o),n.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=o,n.canvas=null;return o},n.tintWithMultiply=function(t,e,r){var i=r.getContext("2d"),n=t.baseTexture.resolution,o=t.crop.clone();o.x*=n,o.y*=n,o.width*=n,o.height*=n,r.width=o.width,r.height=o.height,i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,o.width,o.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height)},n.tintWithOverlay=function(t,e,r){var i=r.getContext("2d"),n=t.baseTexture.resolution,o=t.crop.clone();o.x*=n,o.y*=n,o.width*=n,o.height*=n,r.width=o.width,r.height=o.height,i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,o.width,o.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,o.x,o.y,o.width,o.height,0,0,o.width,o.height)},n.tintWithPerPixel=function(t,e,r){var n=r.getContext("2d"),o=t.baseTexture.resolution,s=t.crop.clone();s.x*=o,s.y*=o,s.width*=o,s.height*=o,r.width=s.width,r.height=s.height,n.globalCompositeOperation="copy",n.drawImage(t.baseTexture.source,s.x,s.y,s.width,s.height,0,0,s.width,s.height);for(var a=i.hex2rgb(e),h=a[0],u=a[1],l=a[2],c=n.getImageData(0,0,s.width,s.height),p=c.data,d=0;de;++e)this.shaders[e].syncUniform(t)}},{"../shaders/TextureShader":62}],51:[function(t,e,r){function i(){n.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FXAA_REDUCE_MIN\n #define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n #define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n #define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var n=t("./AbstractFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager,n=this.getShader(t);i.applyFilter(n,e,r)}},{"./AbstractFilter":50}],52:[function(t,e,r){function i(t){var e=new o.Matrix;n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:t._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:e.toArray(!0)}}),this.maskSprite=t,this.maskMatrix=e}var n=t("./AbstractFilter"),o=t("../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager;this.uniforms.mask.value=this.maskSprite._texture,i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(t){this.uniforms.mask.value=t}},offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}}})},{"../../../math":33,"./AbstractFilter":50}],53:[function(t,e,r){function i(t){n.call(this,t),this.currentBlendMode=99999}var n=t("./WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setBlendMode=function(t){if(this.currentBlendMode===t)return!1;this.currentBlendMode=t;var e=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(e[0],e[1]),!0}},{"./WebGLManager":58}],54:[function(t,e,r){function i(t){n.call(this,t),this.filterStack=[],this.filterStack.push({renderTarget:t.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new h.Rectangle(0,0,t.width,t.height),this.currentFrame=null}var n=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../../../const"),a=t("../utils/Quad"),h=t("../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.onContextChange=function(){this.texturePool.length=0;var t=this.renderer.gl;this.quad=new a(t)},i.prototype.setFilterStack=function(t){this.filterStack=t},i.prototype.pushFilter=function(t,e){var r=t.filterArea?t.filterArea.clone():t.getBounds();r.x=0|r.x,r.y=0|r.y,r.width=0|r.width,r.height=0|r.height;var i=0|e[0].padding;if(r.x-=i,r.y-=i,r.width+=2*i,r.height+=2*i,this.renderer.currentRenderTarget.transform){var n=this.renderer.currentRenderTarget.transform;r.x+=n.tx,r.y+=n.ty,this.capFilterArea(r),r.x-=n.tx,r.y-=n.ty}else this.capFilterArea(r);if(r.width>0&&r.height>0){this.currentFrame=r;var o=this.getRenderTarget();this.renderer.setRenderTarget(o),o.clear(),this.filterStack.push({renderTarget:o,filter:e})}else this.filterStack.push({renderTarget:null,filter:e})},i.prototype.popFilter=function(){var t=this.filterStack.pop(),e=this.filterStack[this.filterStack.length-1],r=t.renderTarget;if(t.renderTarget){var i=e.renderTarget,n=this.renderer.gl;this.currentFrame=r.frame,this.quad.map(this.textureSize,r.frame),n.bindBuffer(n.ARRAY_BUFFER,this.quad.vertexBuffer),n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var o=t.filter;if(n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,n.FLOAT,!1,0,0),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,n.FLOAT,!1,0,32),n.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,n.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(s.BLEND_MODES.NORMAL),1===o.length)o[0].uniforms.dimensions&&(o[0].uniforms.dimensions.value[0]=this.renderer.width,o[0].uniforms.dimensions.value[1]=this.renderer.height,o[0].uniforms.dimensions.value[2]=this.quad.vertices[0],o[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),o[0].applyFilter(this.renderer,r,i),this.returnRenderTarget(r);else{for(var a=r,h=this.getRenderTarget(!0),u=0;uthis.textureSize.width&&(t.width=this.textureSize.width-t.x),t.y+t.height>this.textureSize.height&&(t.height=this.textureSize.height-t.y)},i.prototype.resize=function(t,e){this.textureSize.width=t,this.textureSize.height=e;for(var r=0;re;++e)t._array[2*e]=o[e].x,t._array[2*e+1]=o[e].y;s.uniform2fv(i,t._array);break;case"v3v":for(t._array||(t._array=new Float32Array(3*o.length)),e=0,r=o.length;r>e;++e)t._array[3*e]=o[e].x,t._array[3*e+1]=o[e].y,t._array[3*e+2]=o[e].z;s.uniform3fv(i,t._array);break;case"v4v":for(t._array||(t._array=new Float32Array(4*o.length)),e=0,r=o.length;r>e;++e)t._array[4*e]=o[e].x,t._array[4*e+1]=o[e].y,t._array[4*e+2]=o[e].z,t._array[4*e+3]=o[e].w;s.uniform4fv(i,t._array);break;case"t":case"sampler2D":if(!t.value||!t.value.baseTexture.hasLoaded)break;s.activeTexture(s["TEXTURE"+this.textureCount]);var a=t.value.baseTexture._glTextures[s.id];a||(this.initSampler2D(t),a=t.value.baseTexture._glTextures[s.id]),s.bindTexture(s.TEXTURE_2D,a),s.uniform1i(t._location,this.textureCount),this.textureCount++;break;default:console.warn("Pixi.js Shader Warning: Unknown uniform type: "+t.type)}},i.prototype.syncUniforms=function(){this.textureCount=1;for(var t in this.uniforms)this.syncUniform(this.uniforms[t])},i.prototype.initSampler2D=function(t){var e=this.gl,r=t.value.baseTexture;if(r.hasLoaded)if(t.textureData){var i=t.textureData;r._glTextures[e.id]=e.createTexture(),e.bindTexture(e.TEXTURE_2D,r._glTextures[e.id]),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r.premultipliedAlpha),e.texImage2D(e.TEXTURE_2D,0,i.luminance?e.LUMINANCE:e.RGBA,e.RGBA,e.UNSIGNED_BYTE,r.source),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i.magFilter?i.magFilter:e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i.wrapS?i.wrapS:e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i.wrapT?i.wrapT:e.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(r)},i.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},i.prototype._glCompile=function(t,e){var r=this.gl.createShader(t);return this.gl.shaderSource(r,e),this.gl.compileShader(r),this.gl.getShaderParameter(r,this.gl.COMPILE_STATUS)?r:(console.log(this.gl.getShaderInfoLog(r)),null)}},{"../../../utils":77}],62:[function(t,e,r){function i(t,e,r,o,s){var a={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(o)for(var h in o)a[h]=o[h];var u={aVertexPosition:0,aTextureCoord:0,aColor:0};if(s)for(var l in s)u[l]=s[l];e=e||i.defaultVertexSrc,r=r||i.defaultFragmentSrc,n.call(this,t,e,r,a,u)}var n=t("./Shader");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),i.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":61}],63:[function(t,e,r){function i(t){n.call(this,t)}var n=t("../managers/WebGLManager");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.start=function(){},i.prototype.stop=function(){this.flush()},i.prototype.flush=function(){},i.prototype.render=function(t){}},{"../managers/WebGLManager":58}],64:[function(t,e,r){function i(t){this.gl=t,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,128,t.DYNAMIC_DRAW),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),this.upload()}i.prototype.constructor=i,i.prototype.map=function(t,e){var r=0,i=0;this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this.upload()},i.prototype.upload=function(){var t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferSubData(t.ARRAY_BUFFER,0,this.vertices),t.bufferSubData(t.ARRAY_BUFFER,32,this.uvs),t.bufferSubData(t.ARRAY_BUFFER,64,this.colors)},i.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},e.exports=i},{}],65:[function(t,e,r){var i=t("../../../math"),n=t("../../../utils"),o=t("../../../const"),s=t("./StencilMaskStack"),a=function(t,e,r,a,h,u){if(this.gl=t,this.frameBuffer=null,this.texture=null,this.size=new i.Rectangle(0,0,1,1),this.resolution=h||o.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new s,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=a||o.SCALE_MODES.DEFAULT,this.root=u,!this.root){this.frameBuffer=t.createFramebuffer(),this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,a===o.SCALE_MODES.LINEAR?t.LINEAR:t.NEAREST);var l=n.isPowerOfTwo(e,r);l?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0)}this.resize(e,r)};a.prototype.constructor=a,e.exports=a,a.prototype.clear=function(t){var e=this.gl;t&&e.bindFramebuffer(e.FRAMEBUFFER,this.frameBuffer),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT)},a.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var t=this.gl;this.stencilBuffer=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencilBuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencilBuffer),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},a.prototype.activate=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.frameBuffer);var e=this.frame||this.size;this.calculateProjection(e),this.transform&&this.projectionMatrix.append(this.transform),t.viewport(0,0,e.width*this.resolution,e.height*this.resolution)},a.prototype.calculateProjection=function(t){var e=this.projectionMatrix;e.identity(),this.root?(e.a=1/t.width*2,e.d=-1/t.height*2,e.tx=-1-t.x*e.a,e.ty=1-t.y*e.d):(e.a=1/t.width*2,e.d=1/t.height*2,e.tx=-1-t.x*e.a,e.ty=-1-t.y*e.d)},a.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){if(this.size.width=t,this.size.height=e,!this.root){var r=this.gl;r.bindTexture(r.TEXTURE_2D,this.texture),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,t*this.resolution,e*this.resolution,0,r.RGBA,r.UNSIGNED_BYTE,null),this.stencilBuffer&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencilBuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t*this.resolution,e*this.resolution))}var i=this.frame||this.size;this.calculateProjection(i)}},a.prototype.destroy=function(){var t=this.gl;t.deleteRenderbuffer(this.stencilBuffer),t.deleteFramebuffer(this.frameBuffer),t.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":22,"../../../math":33,"../../../utils":77,"./StencilMaskStack":66}],66:[function(t,e,r){function i(){this.stencilStack=[],this.reverse=!0,this.count=0}i.prototype.constructor=i,e.exports=i},{}],67:[function(t,e,r){function i(t){s.call(this),this.anchor=new n.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=u.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY}var n=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../renderers/canvas/utils/CanvasTinter"),h=t("../utils"),u=t("../const"),l=new n.Point,c=n.GroupD8,p=new n.Matrix;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture._frame.width},set:function(t){var e=h.sign(this.scale.x)||1;this.scale.x=e*t/this.texture._frame.width,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this.texture._frame.height},set:function(t){var e=h.sign(this.scale.y)||1;this.scale.y=e*t/this.texture._frame.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),i.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=h.sign(this.scale.x)*this._width/this.texture.frame.width),this._height&&(this.scale.y=h.sign(this.scale.y)*this._height/this.texture.frame.height)},i.prototype._renderWebGL=function(t){t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},i.prototype.getBounds=function(t){if(!this._currentBounds){var e,r,i,n,o=this._texture._frame.width,s=this._texture._frame.height,a=o*(1-this.anchor.x),h=o*-this.anchor.x,u=s*(1-this.anchor.y),l=s*-this.anchor.y,c=t||this.worldTransform,p=c.a,d=c.b,f=c.c,v=c.d,g=c.tx,m=c.ty,y=p*h+f*l+g,x=v*l+d*h+m,b=p*a+f*l+g,_=v*l+d*a+m,T=p*a+f*u+g,E=v*u+d*a+m,S=p*h+f*u+g,w=v*u+d*h+m;if(e=y,e=e>b?b:e,e=e>T?T:e,e=e>S?S:e,i=x,i=i>_?_:i,i=i>E?E:i,i=i>w?w:i,r=y,r=b>r?b:r,r=T>r?T:r,r=S>r?S:r,n=x,n=_>n?_:n,n=E>n?E:n,n=w>n?w:n,this.children.length){var A=this.containerGetBounds();a=A.x,h=A.x+A.width,u=A.y,l=A.y+A.height,e=a>e?e:a,i=u>i?i:u,r=r>h?r:h,n=n>l?n:l}var C=this._bounds;C.x=e,C.width=r-e,C.y=i,C.height=n-i,this._currentBounds=C}return this._currentBounds},i.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,l);var e,r=this._texture._frame.width,i=this._texture._frame.height,n=-r*this.anchor.x;return l.x>n&&l.xe&&l.yi;i+=6,o+=4)this.indices[i+0]=o+0,this.indices[i+1]=o+1,this.indices[i+2]=o+2,this.indices[i+3]=o+0,this.indices[i+4]=o+2,this.indices[i+5]=o+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var n=t("../../renderers/webgl/utils/ObjectRenderer"),o=t("../../renderers/webgl/WebGLRenderer"),s=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,o.registerPlugin("sprite",i),i.prototype.onContextChange=function(){var t=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=t.createBuffer(),this.indexBuffer=t.createBuffer(),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer),t.bufferData(t.ELEMENT_ARRAY_BUFFER,this.indices,t.STATIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices,t.DYNAMIC_DRAW),this.currentBlendMode=99999},i.prototype.render=function(t){var e=t._texture;this.currentBatchSize>=this.size&&this.flush();var r=e._uvs;if(r){var i,n,o,s,a=t.anchor.x,h=t.anchor.y;if(e.trim&&void 0===t.tileScale){var u=e.trim;n=u.x-a*u.width,i=n+e.crop.width,s=u.y-h*u.height,o=s+e.crop.height}else i=e._frame.width*(1-a),n=e._frame.width*-a,o=e._frame.height*(1-h),s=e._frame.height*-h;var l=this.currentBatchSize*this.vertByteSize,c=t.worldTransform,p=c.a,d=c.b,f=c.c,v=c.d,g=c.tx,m=c.ty,y=this.colors,x=this.positions;if(this.renderer.roundPixels){var b=this.renderer.resolution;x[l]=((p*n+f*s+g)*b|0)/b,x[l+1]=((v*s+d*n+m)*b|0)/b,x[l+5]=((p*i+f*s+g)*b|0)/b,x[l+6]=((v*s+d*i+m)*b|0)/b,x[l+10]=((p*i+f*o+g)*b|0)/b,x[l+11]=((v*o+d*i+m)*b|0)/b,x[l+15]=((p*n+f*o+g)*b|0)/b,x[l+16]=((v*o+d*n+m)*b|0)/b}else x[l]=p*n+f*s+g,x[l+1]=v*s+d*n+m,x[l+5]=p*i+f*s+g,x[l+6]=v*s+d*i+m,x[l+10]=p*i+f*o+g,x[l+11]=v*o+d*i+m,x[l+15]=p*n+f*o+g,x[l+16]=v*o+d*n+m;x[l+2]=r.x0,x[l+3]=r.y0,x[l+7]=r.x1,x[l+8]=r.y1,x[l+12]=r.x2,x[l+13]=r.y2,x[l+17]=r.x3,x[l+18]=r.y3;var _=t.tint;y[l+4]=y[l+9]=y[l+14]=y[l+19]=(_>>16)+(65280&_)+((255&_)<<16)+(255*t.worldAlpha<<24),this.sprites[this.currentBatchSize++]=t}},i.prototype.flush=function(){if(0!==this.currentBatchSize){var t,e=this.renderer.gl;if(this.currentBatchSize>.5*this.size)e.bufferSubData(e.ARRAY_BUFFER,0,this.vertices);else{var r=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);e.bufferSubData(e.ARRAY_BUFFER,0,r)}for(var i,n,o,s,a=0,h=0,u=null,l=this.renderer.blendModeManager.currentBlendMode,c=null,p=!1,d=!1,f=0,v=this.currentBatchSize;v>f;f++)s=this.sprites[f],i=s._texture.baseTexture,n=s.blendMode,o=s.shader||this.shader,p=l!==n,d=c!==o,(u!==i||p||d)&&(this.renderBatch(u,a,h),h=f,a=0,u=i,p&&(l=n,this.renderer.blendModeManager.setBlendMode(l)),d&&(c=o,t=c.shaders?c.shaders[e.id]:c,t||(t=c.getShader(this.renderer)),this.renderer.shaderManager.setShader(t),t.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),t.syncUniforms(),e.activeTexture(e.TEXTURE0))),a++;this.renderBatch(u,a,h),this.currentBatchSize=0}},i.prototype.renderBatch=function(t,e,r){if(0!==e){var i=this.renderer.gl;t._glTextures[i.id]?i.bindTexture(i.TEXTURE_2D,t._glTextures[i.id]):this.renderer.updateTexture(t),i.drawElements(i.TRIANGLES,6*e,i.UNSIGNED_SHORT,6*r*2),this.renderer.drawCount++}},i.prototype.start=function(){var t=this.renderer.gl;t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var e=this.vertByteSize;t.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,t.FLOAT,!1,e,0),t.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,t.FLOAT,!1,e,8),t.vertexAttribPointer(this.shader.attributes.aColor,4,t.UNSIGNED_BYTE,!0,e,16)},i.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),n.prototype.destroy.call(this),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":22,"../../renderers/webgl/WebGLRenderer":49,"../../renderers/webgl/utils/ObjectRenderer":63}],69:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var i=o.fromCanvas(this.canvas);i.trim=new s.Rectangle,n.call(this,i),this.text=t,this.style=e}var n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fontPropertiesCache={},i.fontPropertiesCanvas=document.createElement("canvas"),i.fontPropertiesContext=i.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(i.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=void 0!==t.dropShadowAngle?t.dropShadowAngle:Math.PI/6,t.dropShadowDistance=void 0!==t.dropShadowDistance?t.dropShadowDistance:5,t.dropShadowBlur=void 0!==t.dropShadowBlur?t.dropShadowBlur:0,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),i=new Array(r.length),n=0,o=this.determineFontProperties(t.font),s=0;s0?(this.context.shadowColor=t.dropShadowColor,this.context.shadowBlur=t.dropShadowBlur):this.context.fillStyle=t.dropShadowColor;var d=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,f=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(s=0;sh;h++){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d+=p}for(e.ascent=s-h,d=c-p,f=!1,h=a;h>s;h--){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d-=p}e.descent=h-s,e.fontSize=e.ascent+e.descent,i.fontPropertiesCache[t]=e}return e},i.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;no?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=u,e+=" "+s[a])}n0&&e>0,this.width=this._frame.width=this.crop.width=t,this.height=this._frame.height=this.crop.height=e,r&&(this.baseTexture.width=this.width,this.baseTexture.height=this.height),this.valid&&(this.textureBuffer.resize(this.width,this.height),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.clear=function(){this.valid&&(this.renderer.type===l.RENDERER_TYPE.WEBGL&&this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER,this.textureBuffer.frameBuffer),this.textureBuffer.clear())},i.prototype.renderWebGL=function(t,e,r,i){if(this.valid){if(i=void 0!==i?i:!0,this.textureBuffer.transform=e,this.textureBuffer.activate(),t.worldAlpha=1,i){t.worldTransform.identity(),t.currentBounds=null;var n,o,s=t.children;for(n=0,o=s.length;o>n;++n)s[n].updateTransform()}var a=this.renderer.filterManager;this.renderer.filterManager=this.filterManager,this.renderer.renderDisplayObject(t,this.textureBuffer,r),this.renderer.filterManager=a}},i.prototype.renderCanvas=function(t,e,r,i){if(this.valid){i=!!i;var n=c;n.identity(),e&&n.append(e);var o=t.worldTransform;t.worldTransform=n,t.worldAlpha=1;var s,a,h=t.children;for(s=0,a=h.length;a>s;++s)h[s].updateTransform();r&&this.textureBuffer.clear();var u=this.textureBuffer.context,l=this.renderer.resolution;this.renderer.resolution=this.resolution,this.renderer.renderDisplayObject(t,u),this.renderer.resolution=l,t.worldTransform===n&&(t.worldTransform=o)}},i.prototype.destroy=function(){o.prototype.destroy.call(this,!0),this.textureBuffer.destroy(),this.filterManager&&this.filterManager.destroy(),this.renderer=null},i.prototype.getImage=function(){var t=new Image;return t.src=this.getBase64(),t},i.prototype.getBase64=function(){return this.getCanvas().toDataURL()},i.prototype.getCanvas=function(){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var t=this.renderer.gl,e=this.textureBuffer.size.width,r=this.textureBuffer.size.height,i=new Uint8Array(4*e*r);t.bindFramebuffer(t.FRAMEBUFFER,this.textureBuffer.frameBuffer),t.readPixels(0,0,e,r,t.RGBA,t.UNSIGNED_BYTE,i),t.bindFramebuffer(t.FRAMEBUFFER,null);var n=new h(e,r),o=n.context.getImageData(0,0,e,r);return o.data.set(i),n.context.putImageData(o,0,0),n.canvas}return this.textureBuffer.canvas},i.prototype.getPixels=function(){var t,e;if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl;t=this.textureBuffer.size.width,e=this.textureBuffer.size.height;var i=new Uint8Array(4*t*e);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer),r.readPixels(0,0,t,e,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return t=this.textureBuffer.canvas.width,e=this.textureBuffer.canvas.height,this.textureBuffer.canvas.getContext("2d").getImageData(0,0,t,e).data},i.prototype.getPixel=function(t,e){if(this.renderer.type===l.RENDERER_TYPE.WEBGL){var r=this.renderer.gl,i=new Uint8Array(4);return r.bindFramebuffer(r.FRAMEBUFFER,this.textureBuffer.frameBuffer), - r.readPixels(t,e,1,1,r.RGBA,r.UNSIGNED_BYTE,i),r.bindFramebuffer(r.FRAMEBUFFER,null),i}return this.textureBuffer.canvas.getContext("2d").getImageData(t,e,1,1).data}},{"../const":22,"../math":33,"../renderers/canvas/utils/CanvasBuffer":45,"../renderers/webgl/managers/FilterManager":54,"../renderers/webgl/utils/RenderTarget":65,"./BaseTexture":70,"./Texture":72}],72:[function(t,e,r){function i(t,e,r,n,o){if(a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.width=0,this.height=0,this.crop=r||e,this._rotate=+(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw"attempt to use diamond-shaped UVs. If you are sure, set rotation manually";t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),u=t("../utils");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,this.width=t.width,this.height=t.height,!this.trim&&!this.rotate&&(t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height))throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim?(this.width=this.trim.width,this.height=this.trim.height,this._frame.width=this.trim.width,this._frame.height=this.trim.height):this.crop=t,this.valid&&this._updateUvs()}},rotate:{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.crop=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.crop,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this.crop,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new i(n.fromImage(t,e,r)),u.TextureCache[t]=o),o},i.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(o.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(o.fromUrl(t,e))},i.addTextureToCache=function(t,e){u.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},i.EMPTY=new i(new n)},{"../math":33,"../utils":77,"./BaseTexture":70,"./TextureUvs":73,"./VideoBaseTexture":74,eventemitter3:10}],73:[function(t,e,r){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1}e.exports=i;var n=t("../math/GroupD8");i.prototype.set=function(t,e,r){var i=e.width,o=e.height;if(r){var s=n.isSwapWidthHeight(r),a=(s?t.height:t.width)/2/i,h=(s?t.width:t.height)/2/o,u=t.x/i+a,l=t.y/o+h;r=n.add(r,n.NW),this.x0=u+a*n.uX(r),this.y0=l+h*n.uY(r),r=n.add(r,2),this.x1=u+a*n.uX(r),this.y1=l+h*n.uY(r),r=n.add(r,2),this.x2=u+a*n.uX(r),this.y2=l+h*n.uY(r),r=n.add(r,2),this.x3=u+a*n.uX(r),this.y3=l+h*n.uY(r)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o}},{"../math/GroupD8":30}],74:[function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),s.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=i},{"../const":22,eventemitter3:10}],76:[function(t,e,r){var i=t("./Ticker"),n=new i;n.autoStart=!0,e.exports={shared:n,Ticker:i}},{"./Ticker":75}],77:[function(t,e,r){var i=t("../const"),n=e.exports={_uid:0,_saidHello:!1,EventEmitter:t("eventemitter3"),pluginTarget:t("./pluginTarget"),async:t("async"),uid:function(){return++n._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},canUseNewCanvasBlendModes:function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]},getNextPowerOfTwo:function(t){if(t>0&&0===(t&t-1))return t;for(var e=1;t>e;)e<<=1;return e},isPowerOfTwo:function(t,e){return t>0&&0===(t&t-1)&&e>0&&0===(e&e-1)},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+t+" - http://www.pixijs.com/");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(i){return!1}},sign:function(t){return t?0>t?-1:1:0},removeItems:function(t,e,r){var i=t.length;if(!(e>=i||0===r)){r=e+r>i?i-e:r;for(var n=e,o=i-r;o>n;++n)t[n]=t[n+r];t.length=o}},TextureCache:{},BaseTextureCache:{}}},{"../const":22,"./pluginTarget":78,async:1,eventemitter3:10}],78:[function(t,e,r){function i(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){i(t)}}},{}],79:[function(t,e,r){var i=t("./core"),n=t("./mesh"),o=t("./extras"),s=t("./filters");i.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},i.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(i,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),i.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),i.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),n.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),n.Rope}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),o.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),o.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),o.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),i.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),i.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),i.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),i.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),i}}}),i.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},o.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},i.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},i.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},i.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(s,{AbstractFilter:{get:function(){return console.warn("filters.AbstractFilter is an undocumented alias, please use AbstractFilter from now on."),i.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),i.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),i.SpriteMaskFilter}}}),i.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),i.utils.uid()}},{"./core":29,"./extras":86,"./filters":103,"./mesh":128}],80:[function(t,e,r){function i(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):i.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){for(var t=i.fonts[this._font.name],e=new n.Point,r=null,o=[],s=0,a=0,h=[],u=0,l=this._font.size/t.size,c=-1,p=0,d=0;d0&&e.x*l>this.maxWidth)n.utils.removeItems(o,c,d-c),d=c,c=-1,h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var v=t.chars[f];v&&(r&&v.kerning[r]&&(e.x+=v.kerning[r]),o.push({texture:v.texture,line:u,charCode:f,position:new n.Point(e.x+v.xOffset,e.y+v.yOffset)}),s=e.x+(v.texture.width+v.xOffset),e.x+=v.xAdvance,p=Math.max(p,v.yOffset+v.texture.height),r=f)}}h.push(s),a=Math.max(a,s);var g=[];for(d=0;u>=d;d++){var m=0;"right"===this._font.align?m=a-h[d]:"center"===this._font.align&&(m=(a-h[d])/2),g.push(m)}var y=o.length,x=this.tint;for(d=0;y>d;d++){var b=this._glyphs[d];b?b.texture=o[d].texture:(b=new n.Sprite(o[d].texture),this._glyphs.push(b)),b.position.x=(o[d].position.x+g[o[d].line])*l,b.position.y=o[d].position.y*l,b.scale.x=b.scale.y=l,b.tint=x,b.parent||this.addChild(b)}for(d=y;dt&&(t+=this._textures.length),t}}}),i.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},i.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this._texture=this._textures[this.currentFrame]},i.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;0>r;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},i.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},i.fromFrames=function(t){for(var e=[],r=0;rx?x:t,t=t>_?_:t,t=t>E?E:t,r=y,r=r>b?b:r,r=r>T?T:r,r=r>S?S:r,e=m,e=x>e?x:e,e=_>e?_:e,e=E>e?E:e,i=y,i=b>i?b:i,i=T>i?T:i,i=S>i?S:i;var w=this._bounds;return w.x=t,w.width=e-t,w.y=r,w.height=i-r,this._currentBounds=w,w},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,i=this._height,n=-r*this.anchor.x;return o.x>n&&o.xe&&o.y 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n vec2 p = mod( uv / ( pixelSize * 0.5 ), 2.0) - vec2(1.0);\n col = col * character(n, p);\n\n gl_FragColor = vec4(col, 1.0);\n}\n",{dimensions:{type:"4fv",value:new Float32Array([0,0,0,0])},pixelSize:{type:"1f",value:8}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{size:{get:function(){return this.uniforms.pixelSize.value},set:function(t){this.uniforms.pixelSize.value=t}}})},{"../../core":29}],88:[function(t,e,r){function i(){n.AbstractFilter.call(this),this.blurXFilter=new o,this.blurYFilter=new s,this.defaultFilter=new n.AbstractFilter}var n=t("../../core"),o=t("../blur/BlurXFilter"),s=t("../blur/BlurYFilter");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.defaultFilter.applyFilter(t,e,r),this.blurXFilter.applyFilter(t,e,i),t.blendModeManager.setBlendMode(n.BLEND_MODES.SCREEN),this.blurYFilter.applyFilter(t,i,r),t.blendModeManager.setBlendMode(n.BLEND_MODES.NORMAL),t.filterManager.returnRenderTarget(i)},Object.defineProperties(i.prototype,{blur:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=this.blurYFilter.blur=t}},blurX:{get:function(){return this.blurXFilter.blur},set:function(t){this.blurXFilter.blur=t}},blurY:{get:function(){return this.blurYFilter.blur},set:function(t){this.blurYFilter.blur=t}}})},{"../../core":29,"../blur/BlurXFilter":91,"../blur/BlurYFilter":92 -}],89:[function(t,e,r){function i(t,e){n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform float dirX;\nuniform float dirY;\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[3];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[0] = aTextureCoord + vec2( (0.004 * strength) * dirX, (0.004 * strength) * dirY );\n vBlurTexCoords[1] = aTextureCoord + vec2( (0.008 * strength) * dirX, (0.008 * strength) * dirY );\n vBlurTexCoords[2] = aTextureCoord + vec2( (0.012 * strength) * dirX, (0.012 * strength) * dirY );\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[3];\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n gl_FragColor = vec4(0.0);\n\n gl_FragColor += texture2D(uSampler, vTextureCoord ) * 0.3989422804014327;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 0]) * 0.2419707245191454;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 1]) * 0.05399096651318985;\n gl_FragColor += texture2D(uSampler, vBlurTexCoords[ 2]) * 0.004431848411938341;\n}\n",{strength:{type:"1f",value:1},dirX:{type:"1f",value:t||0},dirY:{type:"1f",value:e||0}}),this.defaultFilter=new n.AbstractFilter,this.passes=1,this.dirX=t||0,this.dirY=e||0,this.strength=4}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.width/e.size.width),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{var o=t.filterManager.getRenderTarget(!0);t.filterManager.applyFilter(n,e,o,i);for(var s=0;s>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,u,l,e,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},i.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.m.value},set:function(t){this.uniforms.m.value=t}}})},{"../../core":29}],95:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float step;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n color = floor(color * step) / step;\n\n gl_FragColor = color;\n}\n",{step:{type:"1f",value:5}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{step:{get:function(){return this.uniforms.step.value},set:function(t){this.uniforms.step.value=t}}})},{"../../core":29}],96:[function(t,e,r){function i(t,e,r){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n",{matrix:{type:"1fv",value:new Float32Array(t)},texelSize:{type:"v2",value:{x:1/e,y:1/r}}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.matrix.value},set:function(t){this.uniforms.matrix.value=new Float32Array(t)}},width:{get:function(){return 1/this.uniforms.texelSize.value.x},set:function(t){this.uniforms.texelSize.value.x=1/t}},height:{get:function(){return 1/this.uniforms.texelSize.value.y},set:function(t){this.uniforms.texelSize.value.y=1/t}}})},{"../../core":29}],97:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i},{"../../core":29}],98:[function(t,e,r){function i(t,e){var r=new n.Matrix;t.renderable=!1,n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision mediump float;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n",{mapSampler:{type:"sampler2D",value:t.texture},otherMatrix:{type:"mat3",value:r.toArray(!0)},scale:{type:"v2",value:{x:1,y:1}}}),this.maskSprite=t,this.maskMatrix=r,(null===e||void 0===e)&&(e=20),this.scale=new n.Point(e,e)}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager;i.calculateMappedMatrix(e.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.scale.value.x=this.scale.x*(1/e.frame.width),this.uniforms.scale.value.y=this.scale.y*(1/e.frame.height);var n=this.getShader(t);i.applyFilter(n,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mapSampler.value},set:function(t){this.uniforms.mapSampler.value=t}}})},{"../../core":29}],99:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 dimensions;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * dimensions.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n",{scale:{type:"1f",value:1},angle:{type:"1f",value:5},dimensions:{type:"4fv",value:[0,0,0,0]}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{scale:{get:function(){return this.uniforms.scale.value},set:function(t){this.uniforms.scale.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],100:[function(t,e,r){function i(){n.AbstractFilter.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform float strength;\nuniform vec2 offset;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vBlurTexCoords[6];\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3((aVertexPosition+offset), 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n\n vBlurTexCoords[ 0] = aTextureCoord + vec2(0.0, -0.012 * strength);\n vBlurTexCoords[ 1] = aTextureCoord + vec2(0.0, -0.008 * strength);\n vBlurTexCoords[ 2] = aTextureCoord + vec2(0.0, -0.004 * strength);\n vBlurTexCoords[ 3] = aTextureCoord + vec2(0.0, 0.004 * strength);\n vBlurTexCoords[ 4] = aTextureCoord + vec2(0.0, 0.008 * strength);\n vBlurTexCoords[ 5] = aTextureCoord + vec2(0.0, 0.012 * strength);\n\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vTextureCoord;\nvarying vec2 vBlurTexCoords[6];\nvarying vec4 vColor;\n\nuniform vec3 color;\nuniform float alpha;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n vec4 sum = vec4(0.0);\n\n sum += texture2D(uSampler, vBlurTexCoords[ 0])*0.004431848411938341;\n sum += texture2D(uSampler, vBlurTexCoords[ 1])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 2])*0.2419707245191454;\n sum += texture2D(uSampler, vTextureCoord )*0.3989422804014327;\n sum += texture2D(uSampler, vBlurTexCoords[ 3])*0.2419707245191454;\n sum += texture2D(uSampler, vBlurTexCoords[ 4])*0.05399096651318985;\n sum += texture2D(uSampler, vBlurTexCoords[ 5])*0.004431848411938341;\n\n gl_FragColor = vec4( color.rgb * sum.a * alpha, sum.a * alpha );\n}\n",{blur:{type:"1f",value:1/512},color:{type:"c",value:[0,0,0]},alpha:{type:"1f",value:.7},offset:{type:"2f",value:[5,5]},strength:{type:"1f",value:1}}),this.passes=1,this.strength=4}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r,i){var n=this.getShader(t);if(this.uniforms.strength.value=this.strength/4/this.passes*(e.frame.height/e.size.height),1===this.passes)t.filterManager.applyFilter(n,e,r,i);else{for(var o=t.filterManager.getRenderTarget(!0),s=e,a=o,h=0;h= (time - params.z)) )\n {\n float diff = (dist - time);\n float powDiff = 1.0 - pow(abs(diff*params.x), params.y);\n\n float diffTime = diff * powDiff;\n vec2 diffUV = normalize(uv - center);\n texCoord = uv + (diffUV * diffTime);\n }\n\n gl_FragColor = texture2D(uSampler, texCoord);\n}\n",{center:{type:"v2",value:{x:.5,y:.5}},params:{type:"v3",value:{x:10,y:.8,z:.1}},time:{type:"1f",value:0}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{center:{get:function(){return this.uniforms.center.value},set:function(t){this.uniforms.center.value=t}},params:{get:function(){return this.uniforms.params.value},set:function(t){this.uniforms.params.value=t}},time:{get:function(){return this.uniforms.time.value},set:function(t){this.uniforms.time.value=t}}})},{"../../core":29}],110:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n gl_FragColor = color / total;\n gl_FragColor.rgb /= gl_FragColor.a + 0.00001;\n}\n",{blur:{type:"1f",value:100},gradientBlur:{type:"1f",value:600},start:{type:"v2",value:{x:0,y:window.innerHeight/2}},end:{type:"v2",value:{x:600,y:window.innerHeight/2}},delta:{type:"v2",value:{x:30,y:30}},texSize:{type:"v2",value:{x:window.innerWidth,y:window.innerHeight}}}),this.updateDelta()}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){this.uniforms.delta.value.x=0,this.uniforms.delta.value.y=0},Object.defineProperties(i.prototype,{blur:{get:function(){return this.uniforms.blur.value},set:function(t){this.uniforms.blur.value=t}},gradientBlur:{get:function(){return this.uniforms.gradientBlur.value},set:function(t){this.uniforms.gradientBlur.value=t}},start:{get:function(){return this.uniforms.start.value},set:function(t){this.uniforms.start.value=t,this.updateDelta()}},end:{get:function(){return this.uniforms.end.value},set:function(t){this.uniforms.end.value=t,this.updateDelta()}}})},{"../../core":29}],111:[function(t,e,r){function i(){n.AbstractFilter.call(this),this.tiltShiftXFilter=new o,this.tiltShiftYFilter=new s}var n=t("../../core"),o=t("./TiltShiftXFilter"),s=t("./TiltShiftYFilter");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.applyFilter=function(t,e,r){var i=t.filterManager.getRenderTarget(!0);this.tiltShiftXFilter.applyFilter(t,e,i),this.tiltShiftYFilter.applyFilter(t,i,r),t.filterManager.returnRenderTarget(i)},Object.defineProperties(i.prototype,{blur:{get:function(){return this.tiltShiftXFilter.blur},set:function(t){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=t}},gradientBlur:{get:function(){return this.tiltShiftXFilter.gradientBlur},set:function(t){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=t}},start:{get:function(){return this.tiltShiftXFilter.start},set:function(t){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=t}},end:{get:function(){return this.tiltShiftXFilter.end},set:function(t){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=t}}})},{"../../core":29,"./TiltShiftXFilter":112,"./TiltShiftYFilter":113}],112:[function(t,e,r){function i(){n.call(this)}var n=t("./TiltShiftAxisFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=t/r,this.uniforms.delta.value.y=e/r}},{"./TiltShiftAxisFilter":110}],113:[function(t,e,r){function i(){n.call(this)}var n=t("./TiltShiftAxisFilter");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.updateDelta=function(){var t=this.uniforms.end.value.x-this.uniforms.start.value.x,e=this.uniforms.end.value.y-this.uniforms.start.value.y,r=Math.sqrt(t*t+e*e);this.uniforms.delta.value.x=-e/r,this.uniforms.delta.value.y=t/r}},{"./TiltShiftAxisFilter":110}],114:[function(t,e,r){function i(){n.AbstractFilter.call(this,null,"precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\n\nvoid main(void)\n{\n vec2 coord = vTextureCoord - offset;\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratio = (radius - dist) / radius;\n float angleMod = ratio * ratio * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n gl_FragColor = texture2D(uSampler, coord+offset);\n}\n",{radius:{type:"1f",value:.5},angle:{type:"1f",value:5},offset:{type:"v2",value:{x:.5,y:.5}}})}var n=t("../../core");i.prototype=Object.create(n.AbstractFilter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset.value},set:function(t){this.uniforms.offset.value=t}},radius:{get:function(){return this.uniforms.radius.value},set:function(t){this.uniforms.radius.value=t}},angle:{get:function(){return this.uniforms.angle.value},set:function(t){this.uniforms.angle.value=t}}})},{"../../core":29}],115:[function(t,e,r){(function(r){t("./polyfill");var i=e.exports=t("./core");i.extras=t("./extras"),i.filters=t("./filters"),i.interaction=t("./interaction"),i.loaders=t("./loaders"),i.mesh=t("./mesh"),i.accessibility=t("./accessibility"),i.loader=new i.loaders.Loader,Object.assign(i,t("./deprecation")),r.PIXI=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":21,"./core":29,"./deprecation":79,"./extras":86,"./filters":103,"./interaction":118,"./loaders":121,"./mesh":128,"./polyfill":133}],116:[function(t,e,r){function i(){this.global=new n.Point,this.target=null,this.originalEvent=null}var n=t("../core");i.prototype.constructor=i,e.exports=i,i.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}},{"../core":29}],117:[function(t,e,r){function i(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var n=t("../core"),o=t("./InteractionData");Object.assign(n.DisplayObject.prototype,t("./interactiveTarget")),i.prototype.constructor=i,e.exports=i,i.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;h--){var u=a[h];if(this.processInteractive(t,u,r,i,s)){if(!u.parent)continue;o=!0,s=!1,u.interactive&&(i=!1)}}return n&&(i&&!o&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),o=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(o=e.containsPoint(t))),e.interactive&&r(e,o)),o},i.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},i.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},i.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},i.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},i.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor="inherit",this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},i.prototype.processMouseMove=function(t,e){this.processMouseOverOut(t,e),(!this.moveWhenInside||e)&&this.dispatchEvent(t,"mousemove",this.eventData)},i.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor="inherit",this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},i.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},i.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},i.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},i.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},i.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData))},i.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,this.moveWhenInside),this.returnTouchData(o)}},i.prototype.processTouchMove=function(t,e){(!this.moveWhenInside||e)&&this.dispatchEvent(t,"touchmove",this.eventData)},i.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},i.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",i),n.CanvasRenderer.registerPlugin("interaction",i)},{"../core":29,"./InteractionData":116,"./interactiveTarget":119}],118:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":116,"./InteractionManager":117,"./interactiveTarget":119}],119:[function(t,e,r){var i={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=i},{}],120:[function(t,e,r){function i(t,e){var r={},i=t.data.getElementsByTagName("info")[0],n=t.data.getElementsByTagName("common")[0];r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hn;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},i.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;n>o;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},i.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this._texture.baseTexture.source,a=this._texture.baseTexture.width,h=this._texture.baseTexture.height,u=e[i],l=e[n],c=e[o],p=e[i+1],d=e[n+1],f=e[o+1],v=r[i]*a,g=r[n]*a,m=r[o]*a,y=r[i+1]*h,x=r[n+1]*h,b=r[o+1]*h;if(this.canvasPadding>0){var _=this.canvasPadding/this.worldTransform.a,T=this.canvasPadding/this.worldTransform.d,E=(u+l+c)/3,S=(p+d+f)/3,w=u-E,A=p-S,C=Math.sqrt(w*w+A*A);u=E+w/C*(C+_),p=S+A/C*(C+T),w=l-E,A=d-S,C=Math.sqrt(w*w+A*A),l=E+w/C*(C+_),d=S+A/C*(C+T),w=c-E,A=f-S,C=Math.sqrt(w*w+A*A),c=E+w/C*(C+_),f=S+A/C*(C+T)}t.save(),t.beginPath(),t.moveTo(u,p),t.lineTo(l,d),t.lineTo(c,f),t.closePath(),t.clip();var M=v*x+y*m+g*b-x*m-y*g-v*b,R=u*x+y*c+l*b-x*c-y*l-u*b,O=v*l+u*m+g*c-l*m-u*g-v*c,P=v*x*c+y*l*m+u*g*b-u*x*m-y*g*c-v*l*b,F=p*x+y*f+d*b-x*f-y*d-p*b,D=v*d+p*m+g*f-d*m-p*g-v*f,B=v*x*f+y*d*m+p*g*b-p*x*m-y*g*f-v*d*b;t.transform(R/M,F/M,O/M,D/M,P/M,B/M),t.drawImage(s,0,0),t.restore()},i.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;i-2>n;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],u=r[o+1],l=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,l),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},i.prototype._onTextureUpdate=function(){this.updateFrame=!0},i.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,u=-(1/0),l=-(1/0),c=1/0,p=1/0,d=this.vertices,f=0,v=d.length;v>f;f+=2){var g=d[f],m=d[f+1],y=r*g+o*m+a,x=s*m+i*g+h;c=c>y?y:c,p=p>x?x:p,u=y>u?y:u,l=x>l?x:l}if(c===-(1/0)||l===1/0)return n.Rectangle.EMPTY;var b=this._bounds;b.x=c,b.width=u-c,b.y=p,b.height=l-p,this._currentBounds=b}return this._currentBounds},i.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,o);var e,r,n=this.vertices,a=s.points;if(this.drawMode===i.DRAW_MODES.TRIANGLES){var h=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*h[e],l=2*h[e+1],c=2*h[e+2];if(a[0]=n[u],a[1]=n[u+1],a[2]=n[l],a[3]=n[l+1],a[4]=n[c],a[5]=n[c+1],s.contains(o.x,o.y))return!0}}else for(r=n.length,e=0;r>e;e+=6)if(a[0]=n[e],a[1]=n[e+1],a[2]=n[e+2],a[3]=n[e+3],a[4]=n[e+4],a[5]=n[e+5],s.contains(o.x,o.y))return!0;return!1},i.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":29}],126:[function(t,e,r){function i(t,e,r){n.call(this,t),this._ready=!0,this.segmentsX=e||10,this.segmentsY=r||10,this.drawMode=n.DRAW_MODES.TRIANGLES,this.refresh()}var n=t("./Mesh");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.segmentsX*this.segmentsY,e=[],r=[],i=[],n=[],o=this.texture,s=this.segmentsX-1,a=this.segmentsY-1,h=0,u=o.width/s,l=o.height/a;for(h=0;t>h;h++){var c=h%this.segmentsX,p=h/this.segmentsX|0;e.push(c*u,p*l),i.push(o._uvs.x0+(o._uvs.x1-o._uvs.x0)*(c/(this.segmentsX-1)),o._uvs.y0+(o._uvs.y3-o._uvs.y0)*(p/(this.segmentsY-1)))}var d=s*a;for(h=0;d>h;h++){var f=h%s,v=h/s|0,g=v*this.segmentsX+f,m=v*this.segmentsX+f+1,y=(v+1)*this.segmentsX+f,x=(v+1)*this.segmentsX+f+1;n.push(g,m,y),n.push(m,x,y)}this.vertices=new Float32Array(e),this.uvs=new Float32Array(i),this.colors=new Float32Array(r),this.indices=new Uint16Array(n)},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()}},{"./Mesh":125}],127:[function(t,e,r){function i(t,e){n.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var n=t("./Mesh"),o=t("../core");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,i=this.colors,n=this._texture._uvs,s=new o.Point(n.x0,n.y0),a=new o.Point(n.x2-n.x0,n.y2-n.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var h,u,l,c=t.length,p=1;c>p;p++)h=t[p],u=4*p,l=p/(c-1),e[u]=l*a.x+s.x,e[u+1]=0+s.y,e[u+2]=l*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*p,i[u]=1,i[u+1]=1,u=2*p,r[u]=u,r[u+1]=u+1;this.dirty=!0}},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},i.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,u=0,l=this.vertices,c=t.length,p=0;c>p;p++)r=t[p],i=4*p,e=p1&&(n=1),o=Math.sqrt(h*h+u*u),s=this._texture.height/2,h/=o,u/=o,h*=s,u*=s,l[i]=r.x+h,l[i+1]=r.y+u,l[i+2]=r.x-h,l[i+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":29,"./Mesh":125}],128:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Plane:t("./Plane"),Rope:t("./Rope"),MeshRenderer:t("./webgl/MeshRenderer"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":125,"./Plane":126,"./Rope":127,"./webgl/MeshRenderer":129,"./webgl/MeshShader":130}],129:[function(t,e,r){function i(t){n.ObjectRenderer.call(this,t),this.indices=new Uint16Array(15e3);for(var e=0,r=0;15e3>e;e+=6,r+=4)this.indices[e+0]=r+0,this.indices[e+1]=r+1,this.indices[e+2]=r+2,this.indices[e+3]=r+0,this.indices[e+4]=r+2,this.indices[e+5]=r+3;this.currentShader=null}var n=t("../../core"),o=t("../Mesh");i.prototype=Object.create(n.ObjectRenderer.prototype),i.prototype.constructor=i,e.exports=i,n.WebGLRenderer.registerPlugin("mesh",i),i.prototype.onContextChange=function(){},i.prototype.render=function(t){t._vertexBuffer||this._initWebGL(t);var e=this.renderer,r=e.gl,i=t._texture.baseTexture,n=t.shader,s=t.drawMode===o.DRAW_MODES.TRIANGLE_MESH?r.TRIANGLE_STRIP:r.TRIANGLES;e.blendModeManager.setBlendMode(t.blendMode),n=n?n.shaders[r.id]||n.getShader(e):e.shaderManager.plugins.meshShader,this.renderer.shaderManager.setShader(n),n.uniforms.translationMatrix.value=t.worldTransform.toArray(!0),n.uniforms.projectionMatrix.value=e.currentRenderTarget.projectionMatrix.toArray(!0),n.uniforms.alpha.value=t.worldAlpha,n.syncUniforms(),t.dirty?(t.dirty=!1,r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferData(r.ARRAY_BUFFER,t.vertices,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.bufferData(r.ARRAY_BUFFER,t.uvs,r.STATIC_DRAW),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,t.indices,r.STATIC_DRAW)):(r.bindBuffer(r.ARRAY_BUFFER,t._vertexBuffer),r.bufferSubData(r.ARRAY_BUFFER,0,t.vertices), - r.vertexAttribPointer(n.attributes.aVertexPosition,2,r.FLOAT,!1,0,0),r.bindBuffer(r.ARRAY_BUFFER,t._uvBuffer),r.vertexAttribPointer(n.attributes.aTextureCoord,2,r.FLOAT,!1,0,0),r.activeTexture(r.TEXTURE0),i._glTextures[r.id]?r.bindTexture(r.TEXTURE_2D,i._glTextures[r.id]):this.renderer.updateTexture(i),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t._indexBuffer),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,t.indices)),r.drawElements(s,t.indices.length,r.UNSIGNED_SHORT,0)},i.prototype._initWebGL=function(t){var e=this.renderer.gl;t._vertexBuffer=e.createBuffer(),t._indexBuffer=e.createBuffer(),t._uvBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._vertexBuffer),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.DYNAMIC_DRAW),e.bindBuffer(e.ARRAY_BUFFER,t._uvBuffer),e.bufferData(e.ARRAY_BUFFER,t.uvs,e.STATIC_DRAW),t.colors&&(t._colorBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,t._colorBuffer),e.bufferData(e.ARRAY_BUFFER,t.colors,e.STATIC_DRAW)),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t._indexBuffer),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW)},i.prototype.flush=function(){},i.prototype.start=function(){this.currentShader=null},i.prototype.destroy=function(){n.ObjectRenderer.prototype.destroy.call(this)}},{"../../core":29,"../Mesh":125}],130:[function(t,e,r){function i(t){n.Shader.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"),{alpha:{type:"1f",value:0},translationMatrix:{type:"mat3",value:new Float32Array(9)},projectionMatrix:{type:"mat3",value:new Float32Array(9)}},{aVertexPosition:0,aTextureCoord:0})}var n=t("../../core");i.prototype=Object.create(n.Shader.prototype),i.prototype.constructor=i,e.exports=i,n.ShaderManager.registerPlugin("meshShader",i)},{"../../core":29}],131:[function(t,e,r){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},{}],132:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":11}],133:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign")},{"./Math.sign":131,"./Object.assign":132,"./requestAnimationFrame":134}],134:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;ni&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[115])(115)}); +!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.PIXI=t()}}(function(){var t;return function e(t,r,i){function n(s,a){if(!r[s]){if(!t[s]){var h="function"==typeof require&&require;if(!a&&h)return h(s,!0);if(o)return o(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return n(r?r:e)},l,l.exports,e,t,r,i)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){var t=this.gl;t.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],3:[function(t,e,r){var i=t("./GLTexture"),n=function(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100};n.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new i(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},n.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},n.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT)},n.prototype.bind=function(){var t=this.gl;this.texture&&this.texture.unbind(),t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},n.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},n.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},n.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},n.createRGBA=function(t,e,r,o){var s=i.fromData(t,null,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},n.createFloat32=function(t,e,r,o){var s=new i.fromData(t,o,e,r);s.enableNearestScaling(),s.enableWrapClamp();var a=new n(t,e,r);return a.enableTexture(s),a.unbind(),a},e.exports=n},{"./GLTexture":5}],4:[function(t,e,r){var i=t("./shader/compileProgram"),n=t("./shader/extractAttributes"),o=t("./shader/extractUniforms"),s=t("./shader/generateUniformAccessObject"),a=function(t,e,r){this.gl=t,this.program=i(t,e,r),this.attributes=n(t,this.program);var a=o(t,this.program);this.uniforms=s(t,a)};a.prototype.bind=function(){this.gl.useProgram(this.program)},a.prototype.destroy=function(){this.gl},e.exports=a},{"./shader/compileProgram":9,"./shader/extractAttributes":11,"./shader/extractUniforms":12,"./shader/generateUniformAccessObject":13}],5:[function(t,e,r){var i=function(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||0,this.height=r||0,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE};i.prototype.upload=function(t){this.bind();var e=this.gl;this.width=t.videoWidth||t.width,this.height=t.videoHeight||t.height,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t)};var n=!1;i.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(this.width=e||this.width,this.height=r||this.height,t instanceof Float32Array){if(!n){var o=i.getExtension("OES_texture_float");if(!o)throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),i.texImage2D(i.TEXTURE_2D,0,this.format,this.width,this.height,0,this.format,this.type,t||null)},i.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},i.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},i.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},i.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},i.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},i.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},i.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},i.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},i.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},i.prototype.destroy=function(){var t=this.gl;t.deleteTexture(this.texture)},i.fromSource=function(t,e,r){var n=new i(t);return n.premultiplyAlpha=r||!1,n.upload(e),n},i.fromData=function(t,e,r,n){var o=new i(t);return o.uploadData(e,r,n),o},e.exports=i},{}],6:[function(t,e,r){function i(t,e){if(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}var n=t("./setVertexAttribArrays");i.prototype.constructor=i,e.exports=i,i.prototype.bind=function(){return this.nativeVao?(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty&&(this.dirty=!1,this.activate())):this.activate(),this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;rs;s++){var a=t.getActiveAttrib(e,s),h=i(t,a.type);r[a.name]={type:h,size:n(h),location:t.getAttribLocation(e,a.name),pointer:function(e,r,i,n){t.vertexAttribPointer(this.location,this.size,e||t.FLOAT,r||!1,i||0,n||0)}}}return r};e.exports=o},{"./mapSize":14,"./mapType":15}],12:[function(t,e,r){var i=t("./mapType"),n=t("./defaultValue"),o=function(t,e){for(var r={},o=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),s=0;o>s;s++){var a=t.getActiveUniform(e,s),h=a.name.replace(/\[.*?\]/,""),u=i(t,a.type);r[h]={type:u,size:a.size,location:t.getUniformLocation(e,h),value:n(u,a.size)}}return r};e.exports=o},{"./defaultValue":10,"./mapType":15}],13:[function(t,e,r){var i=function(t,e){var r={data:{}};r.gl=t;for(var i=Object.keys(e),a=0;a=0&&t.length%1===0}function c(t,e){for(var r=-1,i=t.length;++ri?i:null}):(r=X(t),e=r.length,function(){return i++,e>i?r[i]:null})}function x(t,e){return e=null==e?t.length-1:+e,function(){for(var r=Math.max(arguments.length-e,0),i=Array(r),n=0;r>n;n++)i[n]=arguments[n+e];switch(e){case 0:return t.call(this,i);case 1:return t.call(this,arguments[0],i)}}}function m(t){return function(e,r,i){return t(e,i)}}function T(t){return function(e,r,i){i=u(i||n),e=e||[];var o=y(e);if(0>=t)return i(null);var s=!1,a=0,l=!1;!function c(){if(s&&0>=a)return i(null);for(;t>a&&!l;){var n=o();if(null===n)return s=!0,void(0>=a&&i(null));a+=1,r(e[n],n,h(function(t){a-=1,t?(i(t),l=!0):c()}))}}()}}function b(t){return function(e,r,i){return t(N.eachOf,e,r,i)}}function _(t){return function(e,r,i,n){return t(T(r),e,i,n)}}function w(t){return function(e,r,i){return t(N.eachOfSeries,e,r,i)}}function E(t,e,r,i){i=u(i||n),e=e||[];var o=l(e)?[]:{};t(e,function(t,e,i){r(t,function(t,r){o[e]=r,i(t)})},function(t){i(t,o)})}function S(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(r){r&&n.push({index:e,value:t}),i()})},function(){i(p(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function C(t,e,r,i){S(t,e,function(t,e){r(t,function(t){e(!t)})},i)}function M(t,e,r){return function(i,n,o,s){function a(){s&&s(r(!1,void 0))}function h(t,i,n){return s?void o(t,function(i){s&&e(i)&&(s(r(!0,t)),s=o=!1),n()}):n()}arguments.length>3?t(i,n,h,a):(s=o,o=n,t(i,h,a))}}function R(t,e){return e}function A(t,e,r){r=r||n;var i=l(e)?[]:{};t(e,function(t,e,r){t(x(function(t,n){n.length<=1&&(n=n[0]),i[e]=n,r(t)}))},function(t){r(t,i)})}function O(t,e,r,i){var n=[];t(e,function(t,e,i){r(t,function(t,e){n=n.concat(e||[]),i(t)})},function(t){i(t,n)})}function P(t,e,r){function i(t,e,r,i){if(null!=i&&"function"!=typeof i)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length&&t.idle()?N.setImmediate(function(){t.drain()}):(c(e,function(e){var o={data:e,callback:i||n};r?t.tasks.unshift(o):t.tasks.push(o),t.tasks.length===t.concurrency&&t.saturated()}),void N.setImmediate(t.process))}function o(t,e){return function(){s-=1;var r=!1,i=arguments;c(e,function(t){c(a,function(e,i){e!==t||r||(a.splice(i,1),r=!0)}),t.callback.apply(t,i)}),t.tasks.length+s===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var s=0,a=[],u={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(t,e){i(u,t,!1,e)},kill:function(){u.drain=n,u.tasks=[]},unshift:function(t,e){i(u,t,!0,e)},process:function(){for(;!u.paused&&s=e;e++)N.setImmediate(u.process)}}};return u}function D(t){return x(function(e,r){e.apply(null,r.concat([x(function(e,r){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&c(r,function(e){console[t](e)}))})]))})}function L(t){return function(e,r,i){t(d(e),r,i)}}function I(t){return x(function(e,r){var i=x(function(r){var i=this,n=r.pop();return t(e,function(t,e,n){t.apply(i,r.concat([n]))},n)});return r.length?i.apply(this,r):i})}function B(t){return x(function(e){var r=e.pop();e.push(function(){var t=arguments;i?N.setImmediate(function(){r.apply(null,t)}):r.apply(null,t)});var i=!0;t.apply(this,e),i=!1})}var F,N={},k="object"==typeof self&&self.self===self&&self||"object"==typeof i&&i.global===i&&i||this;null!=k&&(F=k.async),N.noConflict=function(){return k.async=F,N};var U=Object.prototype.toString,j=Array.isArray||function(t){return"[object Array]"===U.call(t)},G=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},X=Object.keys||function(t){var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e},W="function"==typeof setImmediate&&setImmediate,z=W?function(t){W(t)}:function(t){setTimeout(t,0)};"object"==typeof e&&"function"==typeof e.nextTick?N.nextTick=e.nextTick:N.nextTick=z,N.setImmediate=W?z:N.nextTick,N.forEach=N.each=function(t,e,r){return N.eachOf(t,m(e),r)},N.forEachSeries=N.eachSeries=function(t,e,r){return N.eachOfSeries(t,m(e),r)},N.forEachLimit=N.eachLimit=function(t,e,r,i){return T(e)(t,m(r),i)},N.forEachOf=N.eachOf=function(t,e,r){function i(t){a--,t?r(t):null===o&&0>=a&&r(null)}r=u(r||n),t=t||[];for(var o,s=y(t),a=0;null!=(o=s());)a+=1,e(t[o],o,h(i));0===a&&r(null)},N.forEachOfSeries=N.eachOfSeries=function(t,e,r){function i(){var n=!0;return null===s?r(null):(e(t[s],s,h(function(t){if(t)r(t);else{if(s=o(),null===s)return r(null);n?N.setImmediate(i):i()}})),void(n=!1))}r=u(r||n),t=t||[];var o=y(t),s=o();i()},N.forEachOfLimit=N.eachOfLimit=function(t,e,r,i){T(e)(t,r,i)},N.map=b(E),N.mapSeries=w(E),N.mapLimit=_(E),N.inject=N.foldl=N.reduce=function(t,e,r,i){N.eachOfSeries(t,function(t,i,n){r(e,t,function(t,r){e=r,n(t)})},function(t){i(t,e)})},N.foldr=N.reduceRight=function(t,e,r,i){var n=p(t,o).reverse();N.reduce(n,e,r,i)},N.transform=function(t,e,r,i){3===arguments.length&&(i=r,r=e,e=j(t)?[]:{}),N.eachOf(t,function(t,i,n){r(e,t,i,n)},function(t){i(t,e)})},N.select=N.filter=b(S),N.selectLimit=N.filterLimit=_(S),N.selectSeries=N.filterSeries=w(S),N.reject=b(C),N.rejectLimit=_(C),N.rejectSeries=w(C),N.any=N.some=M(N.eachOf,s,o),N.someLimit=M(N.eachOfLimit,s,o),N.all=N.every=M(N.eachOf,a,a),N.everyLimit=M(N.eachOfLimit,a,a),N.detect=M(N.eachOf,o,R),N.detectSeries=M(N.eachOfSeries,o,R),N.detectLimit=M(N.eachOfLimit,o,R),N.sortBy=function(t,e,r){function i(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0}N.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){return t?r(t):void r(null,p(e.sort(i),function(t){return t.value}))})},N.auto=function(t,e,r){function i(t){y.unshift(t)}function o(t){var e=g(y,t);e>=0&&y.splice(e,1)}function s(){h--,c(y.slice(0),function(t){t()})}"function"==typeof arguments[1]&&(r=e,e=null),r=u(r||n);var a=X(t),h=a.length;if(!h)return r(null);e||(e=h);var l={},p=0,d=!1,y=[];i(function(){h||r(null,l)}),c(a,function(n){function a(){return e>p&&f(m,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(n)}function h(){a()&&(p++,o(h),c[c.length-1](y,l))}if(!d){for(var u,c=j(t[n])?t[n]:[t[n]],y=x(function(t,e){if(p--,e.length<=1&&(e=e[0]),t){var i={};v(l,function(t,e){i[e]=t}),i[n]=e,d=!0,r(t,i)}else l[n]=e,N.setImmediate(s)}),m=c.slice(0,c.length-1),T=m.length;T--;){if(!(u=t[m[T]]))throw new Error("Has nonexistent dependency in "+m.join(", "));if(j(u)&&g(u,n)>=0)throw new Error("Has cyclic dependencies")}a()?(p++,c[c.length-1](y,l)):i(h)}})},N.retry=function(t,e,r){function i(t,e){if("number"==typeof e)t.times=parseInt(e,10)||o;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||o,t.interval=parseInt(e.interval,10)||s}}function n(t,e){function r(t,r){return function(i){t(function(t,e){i(!t||r,{err:t,result:e})},e)}}function i(t){return function(e){setTimeout(function(){e(null)},t)}}for(;h.times;){var n=!(h.times-=1);a.push(r(h.task,n)),!n&&h.interval>0&&a.push(i(h.interval))}N.series(a,function(e,r){r=r[r.length-1],(t||h.callback)(r.err,r.result)})}var o=5,s=0,a=[],h={times:o,interval:s},u=arguments.length;if(1>u||u>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=u&&"function"==typeof t&&(r=e,e=t),"function"!=typeof t&&i(h,t),h.callback=r,h.task=e,h.callback?n():n},N.waterfall=function(t,e){function r(t){return x(function(i,n){if(i)e.apply(null,[i].concat(n));else{var o=t.next();o?n.push(r(o)):n.push(e),B(t).apply(null,n)}})}if(e=u(e||n),!j(t)){var i=new Error("First argument to waterfall must be an array of functions");return e(i)}return t.length?void r(N.iterator(t))():e()},N.parallel=function(t,e){A(N.eachOf,t,e)},N.parallelLimit=function(t,e,r){A(T(e),t,r)},N.series=function(t,e){A(N.eachOfSeries,t,e)},N.iterator=function(t){function e(r){function i(){return t.length&&t[r].apply(null,arguments),i.next()}return i.next=function(){return ri;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function o(t,e,o,s){if(null!=s&&"function"!=typeof s)throw new Error("task callback must be a function");return t.started=!0,j(e)||(e=[e]),0===e.length?N.setImmediate(function(){t.drain()}):void c(e,function(e){var a={data:e,priority:o,callback:"function"==typeof s?s:n};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.tasks.length===t.concurrency&&t.saturated(),N.setImmediate(t.process)})}var s=N.queue(t,e);return s.push=function(t,e,r){o(s,t,e,r)},delete s.unshift,s},N.cargo=function(t,e){return P(t,1,e)},N.log=D("log"),N.dir=D("dir"),N.memoize=function(t,e){var r={},i={},n=Object.prototype.hasOwnProperty;e=e||o;var s=x(function(o){var s=o.pop(),a=e.apply(null,o);n.call(r,a)?N.setImmediate(function(){s.apply(null,r[a])}):n.call(i,a)?i[a].push(s):(i[a]=[s],t.apply(null,o.concat([x(function(t){r[a]=t;var e=i[a];delete i[a];for(var n=0,o=e.length;o>n;n++)e[n].apply(null,t)})])))});return s.memo=r,s.unmemoized=t,s},N.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},N.times=L(N.map),N.timesSeries=L(N.mapSeries),N.timesLimit=function(t,e,r,i){return N.mapLimit(d(t),e,r,i)},N.seq=function(){var t=arguments;return x(function(e){var r=this,i=e[e.length-1];"function"==typeof i?e.pop():i=n,N.reduce(t,e,function(t,e,i){e.apply(r,t.concat([x(function(t,e){i(t,e)})]))},function(t,e){i.apply(r,[t].concat(e))})})},N.compose=function(){return N.seq.apply(null,Array.prototype.reverse.call(arguments))},N.applyEach=I(N.eachOf),N.applyEachSeries=I(N.eachOfSeries),N.forever=function(t,e){function r(t){return t?i(t):void o(r)}var i=h(e||n),o=B(t);r()},N.ensureAsync=B,N.constant=x(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),N.wrapSync=N.asyncify=function(t){return x(function(e){var r,i=e.pop();try{r=t.apply(this,e)}catch(n){return i(n)}G(r)&&"function"==typeof r.then?r.then(function(t){i(null,t)})["catch"](function(t){i(t.message?t:new Error(t))}):i(null,r)})},"object"==typeof r&&r.exports?r.exports=N:"function"==typeof t&&t.amd?t([],function(){return N}):k.async=N}()}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:19}],17:[function(t,e,r){"use strict";"use restrict";function i(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}var n=32;r.INT_BITS=n,r.INT_MAX=2147483647,r.INT_MIN=-1<0)-(0>t)},r.abs=function(t){var e=t>>n-1;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(e>t)},r.max=function(t,e){return t^(t^e)&-(e>t)},r.isPow2=function(t){return!(t&t-1||!t)},r.log2=function(t){var e,r;return e=(t>65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,e|=r,e|t>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return t-=t>>>1&1431655765,t=(858993459&t)+(t>>>2&858993459),16843009*(t+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,t&=15,27030>>>t&1};var o=new Array(256);!function(t){for(var e=0;256>e;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<>>8&255]<<16|o[t>>>16&255]<<8|o[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),t=65535&(t|t>>>16),t<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),t=1023&(t|t>>>16),t<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>i(t)+1}},{}],18:[function(t,e,r){(function(t){function e(t,e){for(var r=0,i=t.length-1;i>=0;i--){var n=t[i];"."===n?t.splice(i,1):".."===n?(t.splice(i,1),r++):r&&(t.splice(i,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function i(t,e){if(t.filter)return t.filter(e);for(var r=[],i=0;i=-1&&!n;o--){var s=o>=0?arguments[o]:t.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(r=s+"/"+r,n="/"===s.charAt(0))}return r=e(i(r.split("/"),function(t){return!!t}),!n).join("/"),(n?"/":"")+r||"."},r.normalize=function(t){var n=r.isAbsolute(t),o="/"===s(t,-1);return t=e(i(t.split("/"),function(t){return!!t}),!n).join("/"),t||n||(t="."),t&&o&&(t+="/"),(n?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(i(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function i(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var n=i(t.split("/")),o=i(e.split("/")),s=Math.min(n.length,o.length),a=s,h=0;s>h;h++)if(n[h]!==o[h]){a=h;break}for(var u=[],h=a;he&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:19}],19:[function(t,e,r){function i(){l=!1,a.length?u=a.concat(u):c=-1,u.length&&n()}function n(){if(!l){var t=setTimeout(i);l=!0;for(var e=u.length;e;){for(a=u,u=[];++c1)for(var r=1;r1&&(i=r[0]+"@",t=r[1]),t=t.replace(L,".");var n=t.split("."),o=s(n,e).join(".");return i+o}function h(t){for(var e,r,i=[],n=0,o=t.length;o>n;)e=t.charCodeAt(n++),e>=55296&&56319>=e&&o>n?(r=t.charCodeAt(n++),56320==(64512&r)?i.push(((1023&e)<<10)+(1023&r)+65536):(i.push(e),n--)):i.push(e);return i}function u(t){return s(t,function(t){var e="";return t>65535&&(t-=65536,e+=N(t>>>10&1023|55296),t=56320|1023&t),e+=N(t)}).join("")}function l(t){return 10>t-48?t-22:26>t-65?t-65:26>t-97?t-97:w}function c(t,e){return t+22+75*(26>t)-((0!=e)<<5)}function p(t,e,r){var i=0;for(t=r?F(t/M):t>>1,t+=F(t/e);t>B*S>>1;i+=w)t=F(t/B);return F(i+(B+1)*t/(t+C))}function d(t){var e,r,i,n,s,a,h,c,d,f,v=[],g=t.length,y=0,x=A,m=R;for(r=t.lastIndexOf(O),0>r&&(r=0),i=0;r>i;++i)t.charCodeAt(i)>=128&&o("not-basic"),v.push(t.charCodeAt(i));for(n=r>0?r+1:0;g>n;){for(s=y,a=1,h=w;n>=g&&o("invalid-input"),c=l(t.charCodeAt(n++)),(c>=w||c>F((_-y)/a))&&o("overflow"),y+=c*a,d=m>=h?E:h>=m+S?S:h-m,!(d>c);h+=w)f=w-d,a>F(_/f)&&o("overflow"),a*=f;e=v.length+1,m=p(y-s,e,0==s),F(y/e)>_-x&&o("overflow"),x+=F(y/e),y%=e,v.splice(y++,0,x)}return u(v)}function f(t){var e,r,i,n,s,a,u,l,d,f,v,g,y,x,m,T=[];for(t=h(t),g=t.length,e=A,r=0,s=R,a=0;g>a;++a)v=t[a],128>v&&T.push(N(v));for(i=n=T.length,n&&T.push(O);g>i;){for(u=_,a=0;g>a;++a)v=t[a],v>=e&&u>v&&(u=v);for(y=i+1,u-e>F((_-r)/y)&&o("overflow"),r+=(u-e)*y,e=u,a=0;g>a;++a)if(v=t[a],e>v&&++r>_&&o("overflow"),v==e){for(l=r,d=w;f=s>=d?E:d>=s+S?S:d-s,!(f>l);d+=w)m=l-f,x=w-f,T.push(N(c(f+m%x,0))),l=F(m/x);T.push(N(c(l,0))),s=p(r,y,i==n),r=0,++i}++r,++e}return T.join("")}function v(t){return a(t,function(t){return P.test(t)?d(t.slice(4).toLowerCase()):t})}function g(t){return a(t,function(t){return D.test(t)?"xn--"+f(t):t})}var y="object"==typeof i&&i&&!i.nodeType&&i,x="object"==typeof r&&r&&!r.nodeType&&r,m="object"==typeof e&&e;m.global!==m&&m.window!==m&&m.self!==m||(n=m);var T,b,_=2147483647,w=36,E=1,S=26,C=38,M=700,R=72,A=128,O="-",P=/^xn--/,D=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},B=w-E,F=Math.floor,N=String.fromCharCode;if(T={version:"1.3.2",ucs2:{decode:h,encode:u},decode:d,encode:f,toASCII:g,toUnicode:v},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return T});else if(y&&x)if(r.exports==y)x.exports=T;else for(b in T)T.hasOwnProperty(b)&&(y[b]=T[b]);else n.punycode=T}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],21:[function(t,e,r){"use strict";function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,o){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var a=/\+/g;t=t.split(e);var h=1e3;o&&"number"==typeof o.maxKeys&&(h=o.maxKeys);var u=t.length;h>0&&u>h&&(u=h);for(var l=0;u>l;++l){var c,p,d,f,v=t[l].replace(a,"%20"),g=v.indexOf(r);g>=0?(c=v.substr(0,g),p=v.substr(g+1)):(c=v,p=""),d=decodeURIComponent(c),f=decodeURIComponent(p),i(s,d)?n(s[d])?s[d].push(f):s[d]=[s[d],f]:s[d]=f}return s};var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],22:[function(t,e,r){"use strict";function i(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i",'"',"`"," ","\r","\n"," "],g=["{","}","|","\\","^","`"].concat(v),y=["'"].concat(g),x=["%","/","?",";","#"].concat(y),m=["/","?","#"],T=255,b=/^[a-z0-9A-Z_-]{0,63}$/,_=/^([a-z0-9A-Z_-]{0,63})(.*)$/,w={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=t("querystring");i.prototype.parse=function(t,e,r){if(!h(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t;i=i.trim();var n=d.exec(i);if(n){n=n[0];var o=n.toLowerCase();this.protocol=o,i=i.substr(n.length)}if(r||n||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||n&&E[n]||(i=i.substr(2),this.slashes=!0)}if(!E[n]&&(s||n&&!S[n])){for(var a=-1,u=0;ul)&&(a=l)}var c,f;f=-1===a?i.lastIndexOf("@"):i.lastIndexOf("@",a),-1!==f&&(c=i.slice(0,f),i=i.slice(f+1),this.auth=decodeURIComponent(c)),a=-1;for(var u=0;ul)&&(a=l)}-1===a&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var v="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!v)for(var g=this.hostname.split(/\./),u=0,M=g.length;M>u;u++){var R=g[u];if(R&&!R.match(b)){for(var A="",O=0,P=R.length;P>O;O++)A+=R.charCodeAt(O)>127?"x":R[O];if(!A.match(b)){var D=g.slice(0,u),L=g.slice(u+1),I=R.match(_);I&&(D.push(I[1]),L.unshift(I[2])),L.length&&(i="/"+L.join(".")+i),this.hostname=D.join(".");break}}}if(this.hostname.length>T?this.hostname="":this.hostname=this.hostname.toLowerCase(),!v){for(var B=this.hostname.split("."),F=[],u=0;uu;u++){var j=y[u],G=encodeURIComponent(j);G===j&&(G=escape(j)),i=i.split(j).join(G)}var X=i.indexOf("#");-1!==X&&(this.hash=i.substr(X),i=i.slice(0,X));var W=i.indexOf("?");if(-1!==W?(this.search=i.substr(W),this.query=i.substr(W+1),e&&(this.query=C.parse(this.query)),i=i.slice(0,W)):e&&(this.search="",this.query={}),i&&(this.pathname=i),S[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",N=this.search||"";this.path=k+N}return this.href=this.format(),this},i.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&u(this.query)&&Object.keys(this.query).length&&(o=C.stringify(this.query));var s=this.search||o&&"?"+o||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||S[e])&&n!==!1?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),r=r.replace(/[?#]/g,function(t){return encodeURIComponent(t)}),s=s.replace("#","%23"),e+n+r+s+i},i.prototype.resolve=function(t){return this.resolveObject(n(t,!1,!0)).format()},i.prototype.resolveObject=function(t){if(h(t)){var e=new i;e.parse(t,!1,!0),t=e}var r=new i;if(Object.keys(this).forEach(function(t){r[t]=this[t]},this),r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol)return Object.keys(t).forEach(function(e){"protocol"!==e&&(r[e]=t[e])}),S[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r;if(t.protocol&&t.protocol!==r.protocol){if(!S[t.protocol])return Object.keys(t).forEach(function(e){r[e]=t[e]}),r.href=r.format(),r;if(r.protocol=t.protocol,t.host||E[t.protocol])r.pathname=t.pathname;else{for(var n=(t.pathname||"").split("/");n.length&&!(t.host=n.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==n[0]&&n.unshift(""),n.length<2&&n.unshift(""),r.pathname=n.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var o=r.pathname||"",s=r.search||"";r.path=o+s}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var a=r.pathname&&"/"===r.pathname.charAt(0),u=t.host||t.pathname&&"/"===t.pathname.charAt(0),p=u||a||r.host&&t.pathname,d=p,f=r.pathname&&r.pathname.split("/")||[],n=t.pathname&&t.pathname.split("/")||[],v=r.protocol&&!S[r.protocol];if(v&&(r.hostname="",r.port=null,r.host&&(""===f[0]?f[0]=r.host:f.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===n[0]?n[0]=t.host:n.unshift(t.host)),t.host=null),p=p&&(""===n[0]||""===f[0])),u)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,f=n;else if(n.length)f||(f=[]),f.pop(),f=f.concat(n),r.search=t.search,r.query=t.query;else if(!c(t.search)){if(v){r.hostname=r.host=f.shift();var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return r.search=t.search,r.query=t.query,l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!f.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var y=f.slice(-1)[0],x=(r.host||t.host)&&("."===y||".."===y)||""===y,m=0,T=f.length;T>=0;T--)y=f[T],"."==y?f.splice(T,1):".."===y?(f.splice(T,1),m++):m&&(f.splice(T,1),m--);if(!p&&!d)for(;m--;m)f.unshift("..");!p||""===f[0]||f[0]&&"/"===f[0].charAt(0)||f.unshift(""),x&&"/"!==f.join("/").substr(-1)&&f.push("");var b=""===f[0]||f[0]&&"/"===f[0].charAt(0);if(v){r.hostname=r.host=b?"":f.length?f.shift():"";var g=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;g&&(r.auth=g.shift(),r.host=r.hostname=g.shift())}return p=p||r.host&&f.length,p&&!b&&f.unshift(""),f.length?r.pathname=f.join("/"):(r.pathname=null,r.path=null),l(r.pathname)&&l(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{punycode:20,querystring:23}],25:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i=e&&e.length,o=i?e[0]*r:t.length,a=n(t,0,o,r,!0),h=[];if(!a)return h;var u,l,p,d,f,v,g;if(i&&(a=c(t,e,a,r)),t.length>80*r){u=p=t[0],l=d=t[1];for(var y=r;o>y;y+=r)f=t[y],v=t[y+1],u>f&&(u=f),l>v&&(l=v),f>p&&(p=f),v>d&&(d=v);g=Math.max(p-u,d-l)}return s(a,h,r,u,l,g),h}function n(t,e,r,i,n){var o,s,a,h=0;for(o=e,s=r-i;r>o;o+=i)h+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;if(n===h>0)for(o=e;r>o;o+=i)a=R(o,t[o],t[o+1],a);else for(o=r-i;o>=e;o-=i)a=R(o,t[o],t[o+1],a);return a}function o(t,e){if(!t)return t;e||(e=t);var r,i=t;do if(r=!1,i.steiner||!_(i,i.next)&&0!==b(i.prev,i,i.next))i=i.next;else{if(A(i),i=e=i.prev,i===i.next)return null;r=!0}while(r||i!==e);return e}function s(t,e,r,i,n,c,p){if(t){!p&&c&&v(t,i,n,c);for(var d,f,g=t;t.prev!==t.next;)if(d=t.prev,f=t.next,c?h(t,i,n,c):a(t))e.push(d.i/r),e.push(t.i/r),e.push(f.i/r),A(t),t=f.next,g=f.next;else if(t=f,t===g){p?1===p?(t=u(t,e,r),s(t,e,r,i,n,c,2)):2===p&&l(t,e,r,i,n,c):s(o(t),e,r,i,n,c,1);break}}}function a(t){var e=t.prev,r=t,i=t.next;if(b(e,r,i)>=0)return!1;for(var n=t.next.next;n!==t.prev;){if(m(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&b(n.prev,n,n.next)>=0)return!1;n=n.next}return!0}function h(t,e,r,i){var n=t.prev,o=t,s=t.next;if(b(n,o,s)>=0)return!1;for(var a=n.xo.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=y(a,h,e,r,i),p=y(u,l,e,r,i),d=t.nextZ;d&&d.z<=p;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&m(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&b(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function u(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;w(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),A(i),A(i.next),i=t=o),i=i.next}while(i!==t);return i}function l(t,e,r,i,n,a){var h=t;do{for(var u=h.next.next;u!==h.prev;){if(h.i!==u.i&&T(h,u)){var l=M(h,u);return h=o(h,h.next),l=o(l,l.next),s(h,e,r,i,n,a),void s(l,e,r,i,n,a)}u=u.next}h=h.next}while(h!==t)}function c(t,e,r,i){var s,a,h,u,l,c=[];for(s=0,a=e.length;a>s;s++)h=e[s]*i,u=a-1>s?e[s+1]*i:t.length,l=n(t,h,u,i,!1),l===l.next&&(l.steiner=!0),c.push(x(l));for(c.sort(p),s=0;s=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);n>=a&&a>s&&(s=a,r=i.x=i.x&&i.x>=r.x&&m(oh||h===l&&i.x>r.x)&&S(i,t)&&(r=i,l=h)),i=i.next;return r}function v(t,e,r,i){var n=t;do null===n.z&&(n.z=y(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,g(n)}function g(t){var e,r,i,n,o,s,a,h,u=1;do{for(r=t,t=null,o=null,s=0;r;){for(s++,i=r,a=0,e=0;u>e&&(a++,i=i.nextZ,i);e++);for(h=u;a>0||h>0&&i;)0===a?(n=i,i=i.nextZ,h--):0!==h&&i?r.z<=i.z?(n=r,r=r.nextZ,a--):(n=i,i=i.nextZ,h--):(n=r,r=r.nextZ,a--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}o.nextZ=null,u*=2}while(s>1);return t}function y(t,e,r,i,n){return t=32767*(t-r)/n,e=32767*(e-i)/n,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function x(t){var e=t,r=t;do e.x=0&&(t-s)*(i-a)-(r-s)*(e-a)>=0&&(r-s)*(o-a)-(n-s)*(i-a)>=0}function T(t,e){return _(t,e)||t.next.i!==e.i&&t.prev.i!==e.i&&!E(t,e)&&S(t,e)&&S(e,t)&&C(t,e)}function b(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function _(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,r,i){return b(t,e,r)>0!=b(t,e,i)>0&&b(r,i,t)>0!=b(r,i,e)>0}function E(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&w(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function S(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function C(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;do r.y>o!=r.next.y>o&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next;while(r!==t);return i}function M(t,e){var r=new O(t.i,t.x,t.y),i=new O(e.i,e.x,e.y),n=t.next,o=e.prev;return t.next=e,e.prev=t,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function R(t,e,r,i){var n=new O(t,e,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function A(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function O(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}e.exports=i},{}],26:[function(t,e,r){"use strict";function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function n(){}var o="function"!=typeof Object.create?"~":!1;n.prototype._events=void 0,n.prototype.listeners=function(t,e){var r=o?o+t:t,i=this._events&&this._events[r];if(e)return!!i;if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,a=new Array(s);s>n;n++)a[n]=i[n].fn;return a},n.prototype.emit=function(t,e,r,i,n,s){var a=o?o+t:t;if(!this._events||!this._events[a])return!1;var h,u,l=this._events[a],c=arguments.length;if("function"==typeof l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),c){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,n),!0;case 6:return l.fn.call(l.context,e,r,i,n,s),!0}for(u=1,h=new Array(c-1);c>u;u++)h[u-1]=arguments[u];l.fn.apply(l.context,h)}else{var p,d=l.length;for(u=0;d>u;u++)switch(l[u].once&&this.removeListener(t,l[u].fn,void 0,!0),c){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,e);break;case 3:l[u].fn.call(l[u].context,e,r);break;default:if(!h)for(p=1,h=new Array(c-1);c>p;p++)h[p-1]=arguments[p];l[u].fn.apply(l[u].context,h)}}return!0},n.prototype.on=function(t,e,r){var n=new i(e,r||this),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.once=function(t,e,r){var n=new i(e,r||this,!0),s=o?o+t:t;return this._events||(this._events=o?{}:Object.create(null)),this._events[s]?this._events[s].fn?this._events[s]=[this._events[s],n]:this._events[s].push(n):this._events[s]=n,this},n.prototype.removeListener=function(t,e,r,i){var n=o?o+t:t;if(!this._events||!this._events[n])return this;var s=this._events[n],a=[];if(e)if(s.fn)(s.fn!==e||i&&!s.once||r&&s.context!==r)&&a.push(s);else for(var h=0,u=s.length;u>h;h++)(s[h].fn!==e||i&&!s[h].once||r&&s[h].context!==r)&&a.push(s[h]);return a.length?this._events[n]=1===a.length?a[0]:a:delete this._events[n],this},n.prototype.removeAllListeners=function(t){return this._events?(t?delete this._events[o?o+t:t]:this._events=o?{}:Object.create(null),this):this},n.prototype.off=n.prototype.removeListener,n.prototype.addListener=n.prototype.on,n.prototype.setMaxListeners=function(){return this},n.prefixed=o,"undefined"!=typeof e&&(e.exports=n)},{}],27:[function(e,r,i){!function(e){var i=/iPhone/i,n=/iPod/i,o=/iPad/i,s=/(?=.*\bAndroid\b)(?=.*\bMobile\b)/i,a=/Android/i,h=/(?=.*\bAndroid\b)(?=.*\bSD4930UR\b)/i,u=/(?=.*\bAndroid\b)(?=.*\b(?:KFOT|KFTT|KFJWI|KFJWA|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|KFARWI|KFASWI|KFSAWI|KFSAWA)\b)/i,l=/IEMobile/i,c=/(?=.*\bWindows\b)(?=.*\bARM\b)/i,p=/BlackBerry/i,d=/BB10/i,f=/Opera Mini/i,v=/(CriOS|Chrome)(?=.*\bMobile\b)/i,g=/(?=.*\bFirefox\b)(?=.*\bMobile\b)/i,y=new RegExp("(?:Nexus 7|BNTV250|Kindle Fire|Silk|GT-P1000)","i"),x=function(t,e){return t.test(e)},m=function(t){var e=t||navigator.userAgent,r=e.split("[FBAN");return"undefined"!=typeof r[1]&&(e=r[0]),this.apple={phone:x(i,e),ipod:x(n,e),tablet:!x(i,e)&&x(o,e),device:x(i,e)||x(n,e)||x(o,e)},this.amazon={phone:x(h,e),tablet:!x(h,e)&&x(u,e),device:x(h,e)||x(u,e)},this.android={phone:x(h,e)||x(s,e),tablet:!x(h,e)&&!x(s,e)&&(x(u,e)||x(a,e)),device:x(h,e)||x(u,e)||x(s,e)||x(a,e)},this.windows={phone:x(l,e),tablet:x(c,e),device:x(l,e)||x(c,e)},this.other={blackberry:x(p,e),blackberry10:x(d,e),opera:x(f,e),firefox:x(g,e),chrome:x(v,e),device:x(p,e)||x(d,e)||x(f,e)||x(g,e)||x(v,e)},this.seven_inch=x(y,e),this.any=this.apple.device||this.android.device||this.windows.device||this.other.device||this.seven_inch,this.phone=this.apple.phone||this.android.phone||this.windows.phone,this.tablet=this.apple.tablet||this.android.tablet||this.windows.tablet,"undefined"==typeof window?this:void 0},T=function(){var t=new m;return t.Class=m,t};"undefined"!=typeof r&&r.exports&&"undefined"==typeof window?r.exports=m:"undefined"!=typeof r&&r.exports&&"undefined"!=typeof window?r.exports=T():"function"==typeof t&&t.amd?t("isMobile",[],e.isMobile=T()):e.isMobile=T()}(this)},{}],28:[function(t,e,r){"use strict";function i(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var n=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(t,e){for(var r,s,a=i(t),h=1;h=t.length&&r())}if(r=r||function(){},!t.length)return r();var o=0;u(t,function(t){e(t,i(n))})},s.forEach=s.each,s.eachSeries=function(t,e,r){if(r=r||function(){},!t.length)return r();var i=0,n=function(){e(t[i],function(e){e?(r(e),r=function(){}):(i+=1,i>=t.length?r():n())})};n()},s.forEachSeries=s.eachSeries,s.eachLimit=function(t,e,r,i){var n=d(e);n.apply(null,[t,r,i])},s.forEachLimit=s.eachLimit;var d=function(t){return function(e,r,i){if(i=i||function(){},!e.length||0>=t)return i();var n=0,o=0,s=0;!function a(){if(n>=e.length)return i();for(;t>s&&o=e.length?i():a())})}()}},f=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.each].concat(e))}},v=function(t,e){return function(){var r=Array.prototype.slice.call(arguments);return e.apply(null,[d(t)].concat(r))}},g=function(t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[s.eachSeries].concat(e))}},y=function(t,e,r,i){if(e=l(e,function(t,e){return{index:e,value:t}}),i){var n=[];t(e,function(t,e){r(t.value,function(r,i){n[t.index]=i,e(r)})},function(t){i(t,n)})}else t(e,function(t,e){r(t.value,function(t){e(t)})})};s.map=f(y),s.mapSeries=g(y),s.mapLimit=function(t,e,r,i){return x(e)(t,r,i)};var x=function(t){return v(t,y)};s.reduce=function(t,e,r,i){s.eachSeries(t,function(t,i){r(e,t,function(t,r){e=r,i(t)})},function(t){i(t,e)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(t,e,r,i){var n=l(t,function(t){return t}).reverse();s.reduce(n,e,r,i)},s.foldr=s.reduceRight;var m=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r&&n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.filter=f(m),s.filterSeries=g(m),s.select=s.filter,s.selectSeries=s.filterSeries;var T=function(t,e,r,i){var n=[];e=l(e,function(t,e){return{index:e,value:t}}),t(e,function(t,e){r(t.value,function(r){r||n.push(t),e()})},function(t){i(l(n.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})};s.reject=f(T),s.rejectSeries=g(T);var b=function(t,e,r,i){t(e,function(t,e){r(t,function(r){r?(i(t),i=function(){}):e()})},function(t){i()})};s.detect=f(b),s.detectSeries=g(b),s.some=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t&&(r(!0),r=function(){}),i()})},function(t){r(!1)})},s.any=s.some,s.every=function(t,e,r){s.each(t,function(t,i){e(t,function(t){t||(r(!1),r=function(){}),i()})},function(t){r(!0)})},s.all=s.every,s.sortBy=function(t,e,r){s.map(t,function(t,r){e(t,function(e,i){e?r(e):r(null,{value:t,criteria:i})})},function(t,e){if(t)return r(t);var i=function(t,e){var r=t.criteria,i=e.criteria;return i>r?-1:r>i?1:0};r(null,l(e.sort(i),function(t){return t.value}))})},s.auto=function(t,e){e=e||function(){};var r=p(t),i=r.length;if(!i)return e();var n={},o=[],a=function(t){o.unshift(t)},l=function(t){for(var e=0;ei;){var o=i+(n-i+1>>>1);r(e,t[o])>=0?i=o:n=o-1}return i}function n(t,e,n,o){return t.started||(t.started=!0),h(e)||(e=[e]),0==e.length?s.setImmediate(function(){t.drain&&t.drain()}):void u(e,function(e){var a={data:e,priority:n,callback:"function"==typeof o?o:null};t.tasks.splice(i(t.tasks,a,r)+1,0,a),t.saturated&&t.tasks.length===t.concurrency&&t.saturated(),s.setImmediate(t.process)})}var o=s.queue(t,e);return o.push=function(t,e,r){n(o,t,e,r)},delete o.unshift,o},s.cargo=function(t,e){var r=!1,i=[],n={tasks:i,payload:e,saturated:null,empty:null,drain:null,drained:!0,push:function(t,r){h(t)||(t=[t]),u(t,function(t){i.push({data:t,callback:"function"==typeof r?r:null}),n.drained=!1,n.saturated&&i.length===e&&n.saturated()}),s.setImmediate(n.process)},process:function o(){if(!r){if(0===i.length)return n.drain&&!n.drained&&n.drain(),void(n.drained=!0);var s="number"==typeof e?i.splice(0,e):i.splice(0,i.length),a=l(s,function(t){return t.data});n.empty&&n.empty(),r=!0,t(a,function(){r=!1;var t=arguments;u(s,function(e){e.callback&&e.callback.apply(null,t)}),o()})}},length:function(){return i.length},running:function(){return r}};return n};var E=function(t){return function(e){var r=Array.prototype.slice.call(arguments,1);e.apply(null,r.concat([function(e){var r=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(e?console.error&&console.error(e):console[t]&&u(r,function(e){console[t](e)}))}]))}};s.log=E("log"),s.dir=E("dir"),s.memoize=function(t,e){var r={},i={};e=e||function(t){return t};var n=function(){var n=Array.prototype.slice.call(arguments),o=n.pop(),a=e.apply(null,n);a in r?s.nextTick(function(){o.apply(null,r[a])}):a in i?i[a].push(o):(i[a]=[o],t.apply(null,n.concat([function(){r[a]=arguments;var t=i[a];delete i[a];for(var e=0,n=t.length;n>e;e++)t[e].apply(null,arguments)}])))};return n.memo=r,n.unmemoized=t,n},s.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},s.times=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.map(i,e,r)},s.timesSeries=function(t,e,r){for(var i=[],n=0;t>n;n++)i.push(n);return s.mapSeries(i,e,r)},s.seq=function(){var t=arguments; + return function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();s.reduce(t,r,function(t,r,i){r.apply(e,t.concat([function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);i(t,e)}]))},function(t,r){i.apply(e,[t].concat(r))})}},s.compose=function(){return s.seq.apply(null,Array.prototype.reverse.call(arguments))};var S=function(t,e){var r=function(){var r=this,i=Array.prototype.slice.call(arguments),n=i.pop();return t(e,function(t,e){t.apply(r,i.concat([e]))},n)};if(arguments.length>2){var i=Array.prototype.slice.call(arguments,2);return r.apply(this,i)}return r};s.applyEach=f(S),s.applyEachSeries=g(S),s.forever=function(t,e){function r(i){if(i){if(e)return e(i);throw i}t(r)}r()},"undefined"!=typeof r&&r.exports?r.exports=s:"undefined"!=typeof t&&t.amd?t([],function(){return s}):n.async=s}()}).call(this,e("_process"))},{_process:19}],30:[function(t,e,r){function i(t,e){a.call(this),e=e||10,this.baseUrl=t||"",this.progress=0,this.loading=!1,this._progressChunk=0,this._beforeMiddleware=[],this._afterMiddleware=[],this._boundLoadResource=this._loadResource.bind(this),this._boundOnLoad=this._onLoad.bind(this),this._buffer=[],this._numToLoad=0,this._queue=n.queue(this._boundLoadResource,e),this.resources={}}var n=t("async"),o=t("url"),s=t("./Resource"),a=t("eventemitter3");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.add=i.prototype.enqueue=function(t,e,r,i){if(Array.isArray(t)){for(var n=0;n0)if(this.xhrType===i.XHR_RESPONSE_TYPE.TEXT)this.data=t.responseText;else if(this.xhrType===i.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(t.responseText),this.isJson=!0}catch(r){this.error=new Error("Error trying to parse loaded json:",r)}else if(this.xhrType===i.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var n=new DOMParser;this.data=n.parseFromString(t.responseText,"text/xml")}else{var o=document.createElement("div");o.innerHTML=t.responseText,this.data=o}this.isXml=!0}catch(r){this.error=new Error("Error trying to parse loaded xml:",r)}else this.data=t.response||t.responseText;else this.error=new Error("["+t.status+"]"+t.statusText+":"+t.responseURL);this.complete()},i.prototype._determineCrossOrigin=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,u||(u=document.createElement("a")),u.href=t,t=a.parse(u.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"},i.prototype._determineXhrType=function(){return i._xhrTypeMap[this._getExtension()]||i.XHR_RESPONSE_TYPE.TEXT},i.prototype._determineLoadType=function(){return i._loadTypeMap[this._getExtension()]||i.LOAD_TYPE.XHR},i.prototype._getExtension=function(){var t,e=this.url;if(this.isDataUrl){var r=e.indexOf("/");t=e.substring(r+1,e.indexOf(";",r))}else{var i=e.indexOf("?");-1!==i&&(e=e.substring(0,i)),t=e.substring(e.lastIndexOf(".")+1)}return t},i.prototype._getMimeFromXhrType=function(t){switch(t){case i.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case i.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case i.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case i.XHR_RESPONSE_TYPE.JSON:return"application/json";case i.XHR_RESPONSE_TYPE.DEFAULT:case i.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},i.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},i.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},i.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},i._loadTypeMap={gif:i.LOAD_TYPE.IMAGE,png:i.LOAD_TYPE.IMAGE,bmp:i.LOAD_TYPE.IMAGE,jpg:i.LOAD_TYPE.IMAGE,jpeg:i.LOAD_TYPE.IMAGE,tif:i.LOAD_TYPE.IMAGE,tiff:i.LOAD_TYPE.IMAGE,webp:i.LOAD_TYPE.IMAGE,tga:i.LOAD_TYPE.IMAGE},i._xhrTypeMap={xhtml:i.XHR_RESPONSE_TYPE.DOCUMENT,html:i.XHR_RESPONSE_TYPE.DOCUMENT,htm:i.XHR_RESPONSE_TYPE.DOCUMENT,xml:i.XHR_RESPONSE_TYPE.DOCUMENT,tmx:i.XHR_RESPONSE_TYPE.DOCUMENT,tsx:i.XHR_RESPONSE_TYPE.DOCUMENT,svg:i.XHR_RESPONSE_TYPE.DOCUMENT,gif:i.XHR_RESPONSE_TYPE.BLOB,png:i.XHR_RESPONSE_TYPE.BLOB,bmp:i.XHR_RESPONSE_TYPE.BLOB,jpg:i.XHR_RESPONSE_TYPE.BLOB,jpeg:i.XHR_RESPONSE_TYPE.BLOB,tif:i.XHR_RESPONSE_TYPE.BLOB,tiff:i.XHR_RESPONSE_TYPE.BLOB,webp:i.XHR_RESPONSE_TYPE.BLOB,tga:i.XHR_RESPONSE_TYPE.BLOB,json:i.XHR_RESPONSE_TYPE.JSON,text:i.XHR_RESPONSE_TYPE.TEXT,txt:i.XHR_RESPONSE_TYPE.TEXT},i.setExtensionLoadType=function(t,e){o(i._loadTypeMap,t,e)},i.setExtensionXhrType=function(t,e){o(i._xhrTypeMap,t,e)}},{eventemitter3:26,url:24}],32:[function(t,e,r){e.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(t){for(var e,r="",i=new Array(4),n=0,o=0,s=0;n>2,i[1]=(3&e[0])<<4|e[1]>>4,i[2]=(15&e[1])<<2|e[2]>>6,i[3]=63&e[2],s=n-(t.length-1)){case 2:i[3]=64,i[2]=64;break;case 1:i[3]=64}for(o=0;o=0;r--)this.updateAccessibleObjects(e[r])}},i.prototype.update=function(){if(this.renderer.renderingToScreen){this.updateAccessibleObjects(this.renderer._lastObjectRendered);var t=this.renderer.view.getBoundingClientRect(),e=t.width/this.renderer.width,r=t.height/this.renderer.height,i=this.div;i.style.left=t.left+"px",i.style.top=t.top+"px",i.style.width=this.renderer.width+"px",i.style.height=this.renderer.height+"px";for(var o=0;othis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},i.prototype.addChild=function(t){var e=this.pool.pop();e||(e=document.createElement("button"),e.style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),t.accessibleTitle?e.title=t.accessibleTitle:t.accessibleTitle||t.accessibleHint||(e.title="displayObject "+this.tabIndex),t.accessibleHint&&e.setAttribute("aria-label",t.accessibleHint),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex},i.prototype._onClick=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"click",e.eventData)},i.prototype._onFocus=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseover",e.eventData)},i.prototype._onFocusOut=function(t){var e=this.renderer.plugins.interaction;e.dispatchEvent(t.target.displayObject,"mouseout",e.eventData)},i.prototype._onKeyDown=function(t){9===t.keyCode&&this.activate()},i.prototype._onMouseMove=function(){this.deactivate()},i.prototype.destroy=function(){this.div=null;for(var t=0;t1)for(var r=0;e>r;r++)this.addChild(arguments[r]);else t.parent&&t.parent.removeChild(t),t.parent=this,this.children.push(t),this.onChildrenChange(this.children.length-1),t.emit("added",this);return t},i.prototype.addChildAt=function(t,e){if(e>=0&&e<=this.children.length)return t.parent&&t.parent.removeChild(t),t.parent=this,this.children.splice(e,0,t),this.onChildrenChange(e),t.emit("added",this),t;throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length)},i.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);if(0>r||0>i)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[r]=e,this.children[i]=t,this.onChildrenChange(i>r?r:i)}},i.prototype.getChildIndex=function(t){var e=this.children.indexOf(t);if(-1===e)throw new Error("The supplied DisplayObject must be a child of the caller");return e},i.prototype.setChildIndex=function(t,e){if(0>e||e>=this.children.length)throw new Error("The supplied index is out of bounds");var r=this.getChildIndex(t);o.removeItems(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},i.prototype.getChildAt=function(t){if(0>t||t>=this.children.length)throw new Error("getChildAt: Supplied index "+t+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[t]},i.prototype.removeChild=function(t){var e=arguments.length;if(e>1)for(var r=0;e>r;r++)this.removeChild(arguments[r]);else{var i=this.children.indexOf(t);if(-1===i)return;t.parent=null,o.removeItems(this.children,i,1),this.onChildrenChange(i),t.emit("removed",this)}return t},i.prototype.removeChildAt=function(t){var e=this.getChildAt(t);return e.parent=null,o.removeItems(this.children,t,1),this.onChildrenChange(t),e.emit("removed",this),e},i.prototype.removeChildren=function(t,e){var r,i,n=t||0,o="number"==typeof e?e:this.children.length,s=o-n;if(s>0&&o>=s){for(r=this.children.splice(n,s),i=0;it;++t)this.children[t].updateTransform();this._currentBounds=null}},i.prototype.containerUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return n.Rectangle.EMPTY;for(var t,e,r,i=1/0,o=1/0,s=-(1/0),a=-(1/0),h=!1,u=0,l=this.children.length;l>u;++u){var c=this.children[u];c.visible&&(t=this.children[u].getBounds(),t!==n.Rectangle.EMPTY&&(h=!0,i=ie?s:e,a=a>r?a:r))}if(!h)return this._currentBounds=n.Rectangle.EMPTY,this._currentBounds;var p=this._bounds;p.x=i,p.y=o,p.width=s-i,p.height=a-o,this._currentBounds=p}return this._currentBounds},i.prototype.containerGetBounds=i.prototype.getBounds,i.prototype.getLocalBounds=function(){var t=this.transform.worldTransform;this.transform.worldTransform=n.Matrix.IDENTITY;for(var e=0,r=this.children.length;r>e;++e)this.children[e].updateTransform();return this.transform.worldTransform=t,this._currentBounds=null,this.getBounds(n.Matrix.IDENTITY)},i.prototype.renderWebGL=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var e,r;if(this._mask||this._filters){for(t.currentRenderer.flush(),this._filters&&this._filters.length&&t.filterManager.pushFilter(this,this._filters),this._mask&&t.maskManager.pushMask(this,this._mask),t.currentRenderer.start(),this._renderWebGL(t),e=0,r=this.children.length;r>e;e++)this.children[e].renderWebGL(t);t.currentRenderer.flush(),this._mask&&t.maskManager.popMask(this,this._mask),this._filters&&t.filterManager.popFilter(),t.currentRenderer.start()}else for(this._renderWebGL(t),e=0,r=this.children.length;r>e;++e)this.children[e].renderWebGL(t)}},i.prototype._renderWebGL=function(t){},i.prototype._renderCanvas=function(t){},i.prototype.renderCanvas=function(t){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&t.maskManager.pushMask(this._mask,t),this._renderCanvas(t);for(var e=0,r=this.children.length;r>e;++e)this.children[e].renderCanvas(t);this._mask&&t.maskManager.popMask(t)}},i.prototype.destroy=function(t){if(s.prototype.destroy.call(this),t)for(var e=0,r=this.children.length;r>e;++e)this.children[e].destroy(t);this.removeChildren(),this.children=null}},{"../math":61,"../utils":108,"./DisplayObject":41}],41:[function(t,e,r){function i(){o.call(this),this.transform=new s,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.filterArea=null,this.hitArea=null,this._bounds=new n.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null}var n=t("../math"),o=t("eventemitter3"),s=t("./Transform"),a={worldTransform:new n.Matrix,worldAlpha:1,children:[]};i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this.position.x},set:function(t){this.transform.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.transform.position.y=t}},worldTransform:{get:function(){return this.transform.worldTransform}},localTransform:{get:function(){return this.transform.localTransform}},position:{get:function(){return this.transform.position},set:function(t){this.transform.position=t}},scale:{get:function(){return this.transform.scale},set:function(t){this.transform.scale=t}},pivot:{get:function(){return this.transform.pivot},set:function(t){this.transform.pivot=t}},skew:{get:function(){return this.transform.skew},set:function(t){this.transform.skew=t}},rotation:{get:function(){return this.transform.rotation},set:function(t){this.transform.rotation=t}},worldVisible:{get:function(){var t=this;do{if(!t.visible)return!1;t=t.parent}while(t);return!0}},mask:{get:function(){return this._mask},set:function(t){this._mask&&(this._mask.renderable=!0),this._mask=t,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(t){this._filters=t&&t.slice()}}}),i.prototype.updateTransform=function(){this.transform=this.parent.transform.updateChildTransform(this.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha},i.prototype.displayObjectUpdateTransform=i.prototype.updateTransform,i.prototype.getBounds=function(t){return n.Rectangle.EMPTY},i.prototype.getLocalBounds=function(){return this.getBounds(n.Matrix.IDENTITY)},i.prototype.toGlobal=function(t){return this.parent?this.displayObjectUpdateTransform():(this.parent=a,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.apply(t)},i.prototype.toLocal=function(t,e,r){return e&&(t=e.toGlobal(t)),this.parent?this.displayObjectUpdateTransform():(this.parent=a,this.displayObjectUpdateTransform(),this.parent=null),this.worldTransform.applyInverse(t,r)},i.prototype.renderWebGL=function(t){},i.prototype.renderCanvas=function(t){},i.prototype.setParent=function(t){if(!t||!t.addChild)throw new Error("setParent: Argument must be a Container");return t.addChild(this),t},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){return this.position.x=t||0,this.position.y=e||0,this.scale.x=r?r:1,this.scale.y=i?i:1,this.rotation=n||0,this.skew.x=o||0,this.skew.y=s||0,this.pivot.x=a||0,this.pivot.y=h||0,this},i.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.skew=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../math":61,"./Transform":43,eventemitter3:26}],42:[function(t,e,r){function i(t,e,r,i){this._x=r||0,this._y=i||0,this.cb=t,this.scope=e}i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.cb.call(this.scope)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.cb.call(this.scope)}}}),i.prototype.set=function(t,e){this._x=t||0,this._y=e||(0!==e?this._x:0),this.transform._versionLocal++}},{}],43:[function(t,e,r){function i(){this.worldTransform=new n.Matrix,this.localTransform=new n.Matrix,this.position=new n.Point(0),this.scale=new n.Point(1,1),this.skew=new o(this.updateSkew,this,0,0),this.pivot=new n.Point(0),this._rotation=0,this._sr=Math.sin(0),this._cr=Math.cos(0),this._cy=Math.cos(0),this._sy=Math.sin(0),this._nsx=Math.sin(0),this._cx=Math.cos(0),this._dirty=!1,this.updated=!0}var n=t("../math"),o=t("./ObservablePoint");i.prototype.constructor=i,i.prototype.updateSkew=function(){this._cy=Math.cos(this.skew.y),this._sy=Math.sin(this.skew.y),this._nsx=Math.sin(this.skew.x),this._cx=Math.cos(this.skew.x)},i.prototype.updateTransform=function(t){var e,r,i,n,o=t.worldTransform,s=this.worldTransform,a=this.localTransform;e=this._cr*this.scale.x,r=this._sr*this.scale.x,i=-this._sr*this.scale.y,n=this._cr*this.scale.y,a.a=this._cy*e+this._sy*i,a.b=this._cy*r+this._sy*n,a.c=this._nsx*e+this._cx*i,a.d=this._nsx*r+this._cx*n,a.tx=this.position.x-(this.pivot.x*a.a+this.pivot.y*a.c),a.ty=this.position.y-(this.pivot.x*a.b+this.pivot.y*a.d),s.a=a.a*o.a+a.b*o.c,s.b=a.a*o.b+a.b*o.d,s.c=a.c*o.a+a.d*o.c,s.d=a.c*o.b+a.d*o.d,s.tx=a.tx*o.a+a.ty*o.c+o.tx,s.ty=a.tx*o.b+a.ty*o.d+o.ty},i.prototype.updateChildTransform=function(t){return t.updateTransform(this),t},Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this._sr=Math.sin(t),this._cr=Math.cos(t)}}}),e.exports=i},{"../math":61,"./ObservablePoint":42}],44:[function(t,e,r){function i(){this.worldTransform=new n.Matrix,this.localTransform=new n.Matrix,this.position=new o(this,0),this.scale=new o(this,1,1),this.pivot=new o(this,0),this.skew=new o(this,0),this._rotation=0,this._sr=Math.sin(0),this._cr=Math.cos(0),this._dirtyLocal=0,this._versionLocal=0,this._versionGlobal=0}var n=t("../math"),o=t("./ObservablePoint");i.prototype.constructor=i,i.prototype.updateTransform=function(t){var e=t.worldTransform,r=this.worldTransform,i=this.localTransform;this._dirtyLocal!==this._versionLocal&&(i.a=this._cr*this.scale._x,i.b=this._sr*this.scale._x,i.c=-this._sr*this.scale._y,i.d=this._cr*this.scale._y,i.tx=this.position._x-(this.pivot._x*i.a+this.pivot._y*i.c),i.ty=this.position._y-(this.pivot._x*i.b+this.pivot._y*i.d),this._dirtyLocal=this._versionLocal),r.a=i.a*e.a+i.b*e.c,r.b=i.a*e.b+i.b*e.d,r.c=i.c*e.a+i.d*e.c,r.d=i.c*e.b+i.d*e.d,r.tx=i.tx*e.a+i.ty*e.c+e.tx,r.ty=i.tx*e.b+i.ty*e.d+e.ty,this._versionGlobal++,this.updated=!0},i.prototype.updateChildTransform=function(t){return t.updateTransform(this),t},Object.defineProperties(i.prototype,{rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this._sr=Math.sin(t),this._cr=Math.cos(t)}}}),e.exports=i},{"../math":61,"./ObservablePoint":42}],45:[function(t,e,r){function i(){o.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=c.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new l.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1,this._spriteRect=null,this._fastRect=!1}var n,o=t("../display/Container"),s=t("../textures/RenderTexture"),a=t("../textures/Texture"),h=t("./GraphicsData"),u=t("../sprites/Sprite"),l=t("../math"),c=t("../const"),p=t("./utils/bezierCurveTo"),d=t("../renderers/canvas/CanvasRenderer"),f=new l.Matrix,v=new l.Point; + i._SPRITE_TEXTURE=null,i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){var t=new i;t.renderable=this.renderable,t.fillAlpha=this.fillAlpha,t.lineWidth=this.lineWidth,t.lineColor=this.lineColor,t.tint=this.tint,t.blendMode=this.blendMode,t.isMask=this.isMask,t.boundsPadding=this.boundsPadding,t.dirty=!0,t.glDirty=!0,t.cachedSpriteDirty=this.cachedSpriteDirty;for(var e=0;e=c;++c)l=c/s,n=h+(t-h)*l,o=u+(e-u)*l,a.push(n+(t+(r-t)*l-n)*l,o+(e+(i-e)*l-o)*l);return this.dirty=this.boundsDirty=!0,this},i.prototype.bezierCurveTo=function(t,e,r,i,n,o){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);var s=this.currentPath.shape.points,a=s[s.length-2],h=s[s.length-1];return s.length-=2,p(a,h,t,e,r,i,n,o,s),this.dirty=this.boundsDirty=!0,this},i.prototype.arcTo=function(t,e,r,i,n){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(t,e):this.moveTo(t,e);var o=this.currentPath.shape.points,s=o[o.length-2],a=o[o.length-1],h=a-e,u=s-t,l=i-e,c=r-t,p=Math.abs(h*c-u*l);if(1e-8>p||0===n)o[o.length-2]===t&&o[o.length-1]===e||o.push(t,e);else{var d=h*h+u*u,f=l*l+c*c,v=h*l+u*c,g=n*Math.sqrt(d)/p,y=n*Math.sqrt(f)/p,x=g*v/d,m=y*v/f,T=g*c+y*u,b=g*l+y*h,_=u*(y+x),w=h*(y+x),E=c*(g+m),S=l*(g+m),C=Math.atan2(w-b,_-T),M=Math.atan2(S-b,E-T);this.arc(T+t,b+e,n,C,M,u*l>c*h)}return this.dirty=this.boundsDirty=!0,this},i.prototype.arc=function(t,e,r,i,n,o){if(o=o||!1,i===n)return this;!o&&i>=n?n+=2*Math.PI:o&&n>=i&&(i+=2*Math.PI);var s=o?-1*(i-n):n-i,a=40*Math.ceil(Math.abs(s)/(2*Math.PI));if(0===s)return this;var h=t+Math.cos(i)*r,u=e+Math.sin(i)*r;this.currentPath?this.currentPath.shape.points.push(h,u):this.moveTo(h,u);for(var l=this.currentPath.shape.points,c=s/(2*a),p=2*c,d=Math.cos(c),f=Math.sin(c),v=a-1,g=v%1/v,y=0;v>=y;y++){var x=y+g*y,m=c+i+p*x,T=Math.cos(m),b=-Math.sin(m);l.push((d*T+f*b)*r+t,(d*-b+f*T)*r+e)}return this.dirty=this.boundsDirty=!0,this},i.prototype.beginFill=function(t,e){return this.filling=!0,this.fillColor=t||0,this.fillAlpha=void 0===e?1:e,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},i.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},i.prototype.drawRect=function(t,e,r,i){return this.drawShape(new l.Rectangle(t,e,r,i)),this},i.prototype.drawRoundedRect=function(t,e,r,i,n){return this.drawShape(new l.RoundedRectangle(t,e,r,i,n)),this},i.prototype.drawCircle=function(t,e,r){return this.drawShape(new l.Circle(t,e,r)),this},i.prototype.drawEllipse=function(t,e,r,i){return this.drawShape(new l.Ellipse(t,e,r,i)),this},i.prototype.drawPolygon=function(t){var e=t,r=!0;if(e instanceof l.Polygon&&(r=e.closed,e=e.points),!Array.isArray(e)){e=new Array(arguments.length);for(var i=0;ig?g:E,E=E>x?x:E,E=E>T?T:E,S=S>y?y:S,S=S>m?m:S,S=S>b?b:S,_=g>_?g:_,_=x>_?x:_,_=T>_?T:_,w=y>w?y:w,w=m>w?m:w,w=b>w?b:w,this._bounds.x=E,this._bounds.width=_-E,this._bounds.y=S,this._bounds.height=w-S,this._currentBounds=this._bounds}return this._currentBounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,v);for(var e=this.graphicsData,r=0;rs?s:t,e=s+h>e?s+h:e,r=r>a?a:r,i=a+u>i?a+u:i;else if(d===c.SHAPES.CIRC)s=n.x,a=n.y,h=n.radius+f/2,u=n.radius+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else if(d===c.SHAPES.ELIP)s=n.x,a=n.y,h=n.width+f/2,u=n.height+f/2,t=t>s-h?s-h:t,e=s+h>e?s+h:e,r=r>a-u?a-u:r,i=a+u>i?a+u:i;else{o=n.points;for(var v=0;vs-f?s-f:t,e=s+f>e?s+f:e,r=r>a-f?a-f:r,i=a+f>i?a+f:i}}else t=0,e=0,r=0,i=0;var g=this.boundsPadding;this._localBounds.x=t-g,this._localBounds.width=e-t+2*g,this._localBounds.y=r-g,this._localBounds.height=i-r+2*g},i.prototype.drawShape=function(t){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var e=new h(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,t);return this.graphicsData.push(e),e.type===c.SHAPES.POLY&&(e.shape.closed=e.shape.closed||this.filling,this.currentPath=e),this.dirty=this.boundsDirty=!0,e},i.prototype.generateCanvasTexture=function(t,e){e=e||1;var r=this.getLocalBounds(),i=new s.create(r.width*e,r.height*e);n||(n=new d),f.tx=-r.x,f.ty=-r.y,n.render(this,i,!1,f);var o=a.fromCanvas(i.baseTexture._canvasRenderTarget.canvas,t);return o.baseTexture.resolution=e,o},i.prototype.destroy=function(){o.prototype.destroy.apply(this,arguments);for(var t=0;tO?O:A,r.beginPath(),r.moveTo(S,C+A),r.lineTo(S,C+R-A),r.quadraticCurveTo(S,C+R,S+A,C+R),r.lineTo(S+M-A,C+R),r.quadraticCurveTo(S+M,C+R,S+M,C+R-A),r.lineTo(S+M,C+A),r.quadraticCurveTo(S+M,C,S+M-A,C),r.lineTo(S+A,C),r.quadraticCurveTo(S,C,S,C+A),r.closePath(),(h.fillColor||0===h.fillColor)&&(r.globalAlpha=h.fillAlpha*i,r.fillStyle="#"+("00000"+(0|l).toString(16)).substr(-6),r.fill()),h.lineWidth&&(r.globalAlpha=h.lineAlpha*i,r.strokeStyle="#"+("00000"+(0|c).toString(16)).substr(-6),r.stroke())}}},i.prototype.updateGraphicsTint=function(t){if(16777215!==t.tint||t._prevTint!==t.tint){t._prevTint=t.tint;for(var e=(t.tint>>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}}},i.prototype.destroy=function(){this.renderer=null}},{"../../const":39,"../../renderers/canvas/CanvasRenderer":68}],48:[function(t,e,r){var i=function(t,e,r,i,n,o,s,a,h){h=h||[];var u,l,c,p,d,f=20;h.push(t,e);for(var v=0,g=1;f>=g;++g)v=g/f,u=1-v,l=u*u,c=l*u,p=v*v,d=p*v,h.push(c*t+3*l*v*r+3*u*p*n+d*s,c*e+3*l*v*i+3*u*p*o+d*a);return h};e.exports=i},{}],49:[function(t,e,r){function i(t){s.call(this,t),this.graphicsDataPool=[],this.primitiveShader=null,this.gl=t.gl,this.CONTEXT_UID=0}var n=t("../../utils"),o=t("../../const"),s=t("../../renderers/webgl/utils/ObjectRenderer"),a=t("../../renderers/webgl/WebGLRenderer"),h=t("./WebGLGraphicsData"),u=t("./shaders/PrimitiveShader"),l=t("./utils/buildPoly"),c=t("./utils/buildRectangle"),p=t("./utils/buildRoundedRectangle"),d=t("./utils/buildCircle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,a.registerPlugin("graphics",i),i.prototype.onContextChange=function(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.primitiveShader=new u(this.gl)},i.prototype.destroy=function(){s.prototype.destroy.call(this);for(var t=0;ta;a++){e=o.data[a];var u=e.shader;r.bindShader(u),u.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),u.uniforms.tint=n.hex2rgb(t.tint),u.uniforms.alpha=t.worldAlpha,e.vao.bind().draw(i.TRIANGLE_STRIP,e.indices.length).unbind()}},i.prototype.updateGraphics=function(t){var e=this.renderer.gl,r=t._webGL[this.CONTEXT_UID];r||(r=t._webGL[this.CONTEXT_UID]={lastIndex:0,data:[],gl:e}),t.dirty=!1;var i;if(t.clearDirty){for(t.clearDirty=!1,i=0;i32e4)&&(r=this.graphicsDataPool.pop()||new h(this.renderer.gl,this.primitiveShader,this.renderer.state.attribsState),r.reset(e),t.data.push(r)),r.dirty=!0,r}},{"../../const":39,"../../renderers/webgl/WebGLRenderer":75,"../../renderers/webgl/utils/ObjectRenderer":85,"../../utils":108,"./WebGLGraphicsData":50,"./shaders/PrimitiveShader":51,"./utils/buildCircle":52,"./utils/buildPoly":54,"./utils/buildRectangle":55,"./utils/buildRoundedRectangle":56}],50:[function(t,e,r){function i(t,e,r){this.gl=t,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=n.GLBuffer.createVertexBuffer(t),this.indexBuffer=n.GLBuffer.createIndexBuffer(t),this.dirty=!0,this.glPoints=null,this.glIndices=null,this.shader=e,this.vao=new n.VertexArrayObject(t,r).addIndex(this.indexBuffer).addAttribute(this.buffer,e.attributes.aVertexPosition,t.FLOAT,!1,24,0).addAttribute(this.buffer,e.attributes.aColor,t.FLOAT,!1,24,8)}var n=t("pixi-gl-core");i.prototype.constructor=i,e.exports=i,i.prototype.reset=function(){this.points.length=0,this.indices.length=0},i.prototype.upload=function(){this.glPoints=new Float32Array(this.points),this.buffer.upload(this.glPoints),this.glIndices=new Uint16Array(this.indices),this.indexBuffer.upload(this.glIndices),this.dirty=!1},i.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.vao.destroy(),this.buffer.destroy(),this.indexBuffer.destroy(),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{"pixi-gl-core":1}],51:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"].join("\n"),["precision mediump float;","varying vec4 vColor;","void main(void){"," gl_FragColor = vColor;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],52:[function(t,e,r){var i=t("./buildLine"),n=t("../../../const"),o=t("../../../utils"),s=function(t,e){var r,s,a=t.shape,h=a.x,u=a.y;t.type===n.SHAPES.CIRC?(r=a.radius,s=a.radius):(r=a.width,s=a.height);var l=Math.floor(30*Math.sqrt(a.radius))||Math.floor(15*Math.sqrt(a.width+a.height)),c=2*Math.PI/l,p=0;if(t.fill){var d=o.hex2rgb(t.fillColor),f=t.fillAlpha,v=d[0]*f,g=d[1]*f,y=d[2]*f,x=e.points,m=e.indices,T=x.length/6;for(m.push(T),p=0;l+1>p;p++)x.push(h,u,v,g,y,f),x.push(h+Math.sin(c*p)*r,u+Math.cos(c*p)*s,v,g,y,f),m.push(T++,T++);m.push(T-1)}if(t.lineWidth){var b=t.points;for(t.points=[],p=0;l+1>p;p++)t.points.push(h+Math.sin(c*p)*r,u+Math.cos(c*p)*s);i(t,e),t.points=b}};e.exports=s},{"../../../const":39,"../../../utils":108,"./buildLine":53}],53:[function(t,e,r){var i=t("../../../math"),n=t("../../../utils"),o=function(t,e){var r=0,o=t.points;if(0!==o.length){var s=new i.Point(o[0],o[1]),a=new i.Point(o[o.length-2],o[o.length-1]);if(s.x===a.x&&s.y===a.y){o=o.slice(),o.pop(),o.pop(),a=new i.Point(o[o.length-2],o[o.length-1]);var h=a.x+.5*(s.x-a.x),u=a.y+.5*(s.y-a.y);o.unshift(h,u),o.push(h,u)}var l,c,p,d,f,v,g,y,x,m,T,b,_,w,E,S,C,M,R,A,O,P,D,L=e.points,I=e.indices,B=o.length/2,F=o.length,N=L.length/6,k=t.lineWidth/2,U=n.hex2rgb(t.lineColor),j=t.lineAlpha,G=U[0]*j,X=U[1]*j,W=U[2]*j;for(p=o[0],d=o[1],f=o[2],v=o[3],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,L.push(p-x,d-m,G,X,W,j),L.push(p+x,d+m,G,X,W,j),r=1;B-1>r;r++)p=o[2*(r-1)],d=o[2*(r-1)+1],f=o[2*r],v=o[2*r+1],g=o[2*(r+1)],y=o[2*(r+1)+1],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,T=-(v-y),b=f-g,D=Math.sqrt(T*T+b*b),T/=D,b/=D,T*=k,b*=k,E=-m+d-(-m+v),S=-x+f-(-x+p),C=(-x+p)*(-m+v)-(-x+f)*(-m+d),M=-b+y-(-b+v),R=-T+f-(-T+g),A=(-T+g)*(-b+v)-(-T+f)*(-b+y),O=E*R-M*S,Math.abs(O)<.1?(O+=10.1,L.push(f-x,v-m,G,X,W,j),L.push(f+x,v+m,G,X,W,j)):(l=(S*A-R*C)/O,c=(M*C-E*A)/O,P=(l-f)*(l-f)+(c-v)*(c-v),P>19600?(_=x-T,w=m-b,D=Math.sqrt(_*_+w*w),_/=D,w/=D,_*=k,w*=k,L.push(f-_,v-w),L.push(G,X,W,j),L.push(f+_,v+w),L.push(G,X,W,j),L.push(f-_,v-w),L.push(G,X,W,j),F++):(L.push(l,c),L.push(G,X,W,j),L.push(f-(l-f),v-(c-v)),L.push(G,X,W,j)));for(p=o[2*(B-2)],d=o[2*(B-2)+1],f=o[2*(B-1)],v=o[2*(B-1)+1],x=-(d-v),m=p-f,D=Math.sqrt(x*x+m*m),x/=D,m/=D,x*=k,m*=k,L.push(f-x,v-m),L.push(G,X,W,j),L.push(f+x,v+m),L.push(G,X,W,j),I.push(N),r=0;F>r;r++)I.push(N++);I.push(N-1)}};e.exports=o},{"../../../math":61,"../../../utils":108}],54:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=t("earcut"),s=function(t,e){t.points=t.shape.points.slice();var r=t.points;if(t.shape.closed&&(r[0]===r[r.length-2]&&r[1]===r[r.length-1]||r.push(r[0],r[1])),t.fill&&r.length>6){var s=e.points,a=e.indices,h=r.length/2,u=n.hex2rgb(t.fillColor),l=t.fillAlpha,c=u[0]*l,p=u[1]*l,d=u[2]*l,f=o(r,null,2);if(!f)return;var v=s.length/6,g=0;for(g=0;gg;g++)s.push(r[2*g],r[2*g+1],c,p,d,l)}t.lineWidth>0&&i(t,e)};e.exports=s},{"../../../utils":108,"./buildLine":53,earcut:25}],55:[function(t,e,r){var i=t("./buildLine"),n=t("../../../utils"),o=function(t,e){var r=t.shape,o=r.x,s=r.y,a=r.width,h=r.height;if(t.fill){var u=n.hex2rgb(t.fillColor),l=t.fillAlpha,c=u[0]*l,p=u[1]*l,d=u[2]*l,f=e.points,v=e.indices,g=f.length/6;f.push(o,s),f.push(c,p,d,l),f.push(o+a,s),f.push(c,p,d,l),f.push(o,s+h),f.push(c,p,d,l),f.push(o+a,s+h),f.push(c,p,d,l),v.push(g,g,g+1,g+2,g+3,g+3)}if(t.lineWidth){var y=t.points;t.points=[o,s,o+a,s,o+a,s+h,o,s+h,o,s],i(t,e),t.points=y}};e.exports=o},{"../../../utils":108,"./buildLine":53}],56:[function(t,e,r){var i=t("earcut"),n=t("./buildLine"),o=t("../../../utils"),s=function(t,e){var r=t.shape,s=r.x,h=r.y,u=r.width,l=r.height,c=r.radius,p=[];if(p.push(s,h+c),a(s,h+l-c,s,h+l,s+c,h+l,p),a(s+u-c,h+l,s+u,h+l,s+u,h+l-c,p),a(s+u,h+c,s+u,h,s+u-c,h,p),a(s+c,h,s,h,s,h+c+1e-10,p),t.fill){var d=o.hex2rgb(t.fillColor),f=t.fillAlpha,v=d[0]*f,g=d[1]*f,y=d[2]*f,x=e.points,m=e.indices,T=x.length/6,b=i(p,null,2),_=0;for(_=0;_=y;y++)g=y/f,h=a(t,r,g),u=a(e,i,g),l=a(r,n,g),c=a(i,o,g),p=a(h,l,g),d=a(u,c,g),v.push(p,d);return v};e.exports=s},{"../../../utils":108,"./buildLine":53,earcut:25}],57:[function(t,e,r){var i=e.exports=Object.assign(t("./const"),t("./math"),{utils:t("./utils"),ticker:t("./ticker"),DisplayObject:t("./display/DisplayObject"),Container:t("./display/Container"),Transform:t("./display/Transform"),TransformStatic:t("./display/TransformStatic"),Sprite:t("./sprites/Sprite"),CanvasSpriteRender:t("./sprites/canvas/CanvasSpriteRenderer"),CanvasTinter:t("./sprites/canvas/CanvasTinter"),SpriteRenderer:t("./sprites/webgl/SpriteRenderer"),Text:t("./text/Text"),Graphics:t("./graphics/Graphics"),GraphicsData:t("./graphics/GraphicsData"),GraphicsRenderer:t("./graphics/webgl/GraphicsRenderer"),CanvasGraphicsRenderer:t("./graphics/canvas/CanvasGraphicsRenderer"),Texture:t("./textures/Texture"),BaseTexture:t("./textures/BaseTexture"),RenderTexture:t("./textures/RenderTexture"),BaseRenderTexture:t("./textures/BaseRenderTexture"),VideoBaseTexture:t("./textures/VideoBaseTexture"),TextureUvs:t("./textures/TextureUvs"),CanvasRenderer:t("./renderers/canvas/CanvasRenderer"),CanvasRenderTarget:t("./renderers/canvas/utils/CanvasRenderTarget"),WebGLRenderer:t("./renderers/webgl/WebGLRenderer"),WebGLManager:t("./renderers/webgl/managers/WebGLManager"),ObjectRenderer:t("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:t("./renderers/webgl/utils/RenderTarget"),Quad:t("./renderers/webgl/utils/Quad"),SpriteMaskFilter:t("./renderers/webgl/filters/spriteMask/SpriteMaskFilter"),Filter:t("./renderers/webgl/filters/Filter"),glCore:t("pixi-gl-core"),autoDetectRenderer:function(t,e,r,n){return t=t||800,e=e||600,!n&&i.utils.isWebGLSupported()?new i.WebGLRenderer(t,e,r):new i.CanvasRenderer(t,e,r)}})},{"./const":39,"./display/Container":40,"./display/DisplayObject":41,"./display/Transform":43,"./display/TransformStatic":44,"./graphics/Graphics":45,"./graphics/GraphicsData":46,"./graphics/canvas/CanvasGraphicsRenderer":47,"./graphics/webgl/GraphicsRenderer":49,"./math":61,"./renderers/canvas/CanvasRenderer":68,"./renderers/canvas/utils/CanvasRenderTarget":70,"./renderers/webgl/WebGLRenderer":75,"./renderers/webgl/filters/Filter":77,"./renderers/webgl/filters/spriteMask/SpriteMaskFilter":80,"./renderers/webgl/managers/WebGLManager":84,"./renderers/webgl/utils/ObjectRenderer":85,"./renderers/webgl/utils/Quad":86,"./renderers/webgl/utils/RenderTarget":87,"./sprites/Sprite":91,"./sprites/canvas/CanvasSpriteRenderer":92,"./sprites/canvas/CanvasTinter":93,"./sprites/webgl/SpriteRenderer":95,"./text/Text":97,"./textures/BaseRenderTexture":98,"./textures/BaseTexture":99,"./textures/RenderTexture":100,"./textures/Texture":101,"./textures/TextureUvs":102,"./textures/VideoBaseTexture":103,"./ticker":105,"./utils":108,"pixi-gl-core":1}],58:[function(t,e,r){function i(t){return 0>t?-1:t>0?1:0}function n(){for(var t=0;16>t;t++){var e=[];c.push(e);for(var r=0;16>r;r++)for(var n=i(o[t]*o[r]+a[t]*s[r]),p=i(s[t]*o[r]+h[t]*s[r]),d=i(o[t]*a[r]+a[t]*h[r]),f=i(s[t]*a[r]+h[t]*h[r]),v=0;16>v;v++)if(o[v]===n&&s[v]===p&&a[v]===d&&h[v]===f){e.push(v);break}}for(t=0;16>t;t++){var g=new l;g.set(o[t],s[t],a[t],h[t],0,0),u.push(g)}}var o=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],s=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],a=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],h=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],u=[],l=t("./Matrix"),c=[];n();var p={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MIRROR_HORIZONTAL:12,uX:function(t){return o[t]},uY:function(t){return s[t]},vX:function(t){return a[t]},vY:function(t){return h[t]},inv:function(t){return 8&t?15&t:7&-t},add:function(t,e){return c[t][e]},sub:function(t,e){return c[t][p.inv(e)]},rotate180:function(t){return 4^t},isSwapWidthHeight:function(t){return 2===(3&t)},byDirection:function(t,e){return 2*Math.abs(t)<=Math.abs(e)?e>=0?p.S:p.N:2*Math.abs(e)<=Math.abs(t)?t>0?p.E:p.W:e>0?t>0?p.SE:p.SW:t>0?p.NE:p.NW},matrixAppendRotationInv:function(t,e,r,i){var n=u[p.inv(e)];r=r||0,i=i||0,n.tx=r,n.ty=i,t.append(n)}};e.exports=p},{"./Matrix":59}],59:[function(t,e,r){function i(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var n=t("./Point");i.prototype.constructor=i,e.exports=i,i.prototype.fromArray=function(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]},i.prototype.set=function(t,e,r,i,n,o){return this.a=t,this.b=e,this.c=r,this.d=i,this.tx=n,this.ty=o,this},i.prototype.toArray=function(t,e){this.array||(this.array=new Float32Array(9));var r=e||this.array;return t?(r[0]=this.a,r[1]=this.b,r[2]=0,r[3]=this.c,r[4]=this.d,r[5]=0,r[6]=this.tx,r[7]=this.ty,r[8]=1):(r[0]=this.a,r[1]=this.c,r[2]=this.tx,r[3]=this.b,r[4]=this.d,r[5]=this.ty,r[6]=0,r[7]=0,r[8]=1),r},i.prototype.apply=function(t,e){e=e||new n;var r=t.x,i=t.y;return e.x=this.a*r+this.c*i+this.tx,e.y=this.b*r+this.d*i+this.ty,e},i.prototype.applyInverse=function(t,e){e=e||new n;var r=1/(this.a*this.d+this.c*-this.b),i=t.x,o=t.y;return e.x=this.d*r*i+-this.c*r*o+(this.ty*this.c-this.tx*this.d)*r,e.y=this.a*r*o+-this.b*r*i+(-this.ty*this.a+this.tx*this.b)*r,e},i.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},i.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},i.prototype.rotate=function(t){var e=Math.cos(t),r=Math.sin(t),i=this.a,n=this.c,o=this.tx;return this.a=i*e-this.b*r,this.b=i*r+this.b*e,this.c=n*e-this.d*r,this.d=n*r+this.d*e,this.tx=o*e-this.ty*r,this.ty=o*r+this.ty*e,this},i.prototype.append=function(t){var e=this.a,r=this.b,i=this.c,n=this.d;return this.a=t.a*e+t.b*i,this.b=t.a*r+t.b*n,this.c=t.c*e+t.d*i,this.d=t.c*r+t.d*n,this.tx=t.tx*e+t.ty*i+this.tx,this.ty=t.tx*r+t.ty*n+this.ty,this},i.prototype.setTransform=function(t,e,r,i,n,o,s,a,h){var u,l,c,p,d,f,v,g,y,x;return d=Math.sin(s),f=Math.cos(s),v=Math.cos(h),g=Math.sin(h),y=-Math.sin(a),x=Math.cos(a),u=f*n,l=d*n,c=-d*o,p=f*o,this.a=v*u+g*c,this.b=v*l+g*p,this.c=y*u+x*c,this.d=y*l+x*p,this.tx=t+(r*u+i*c),this.ty=e+(r*l+i*p),this},i.prototype.prepend=function(t){var e=this.tx;if(1!==t.a||0!==t.b||0!==t.c||1!==t.d){var r=this.a,i=this.c;this.a=r*t.a+this.b*t.c,this.b=r*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this},i.prototype.invert=function(){var t=this.a,e=this.b,r=this.c,i=this.d,n=this.tx,o=t*i-e*r;return this.a=i/o,this.b=-e/o,this.c=-r/o,this.d=t/o,this.tx=(r*this.ty-i*n)/o,this.ty=-(t*this.ty-e*n)/o,this},i.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},i.prototype.clone=function(){var t=new i;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},i.IDENTITY=new i,i.TEMP_MATRIX=new i},{"./Point":60}],60:[function(t,e,r){function i(t,e){this.x=t||0,this.y=e||0}i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y)},i.prototype.copy=function(t){this.set(t.x,t.y)},i.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},i.prototype.set=function(t,e){this.x=t||0,this.y=e||(0!==e?this.x:0)}},{}],61:[function(t,e,r){e.exports={Point:t("./Point"),Matrix:t("./Matrix"),GroupD8:t("./GroupD8"),Circle:t("./shapes/Circle"),Ellipse:t("./shapes/Ellipse"),Polygon:t("./shapes/Polygon"),Rectangle:t("./shapes/Rectangle"),RoundedRectangle:t("./shapes/RoundedRectangle")}},{"./GroupD8":58,"./Matrix":59,"./Point":60,"./shapes/Circle":62,"./shapes/Ellipse":63,"./shapes/Polygon":64,"./shapes/Rectangle":65,"./shapes/RoundedRectangle":66}],62:[function(t,e,r){function i(t,e,r){this.x=t||0,this.y=e||0,this.radius=r||0,this.type=o.SHAPES.CIRC}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.radius)},i.prototype.contains=function(t,e){if(this.radius<=0)return!1;var r=this.x-t,i=this.y-e,n=this.radius*this.radius;return r*=r,i*=i,n>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":39,"./Rectangle":65}],63:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=o.SHAPES.ELIP}var n=t("./Rectangle"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.contains=function(t,e){if(this.width<=0||this.height<=0)return!1;var r=(t-this.x)/this.width,i=(e-this.y)/this.height;return r*=r,i*=i,1>=r+i},i.prototype.getBounds=function(){return new n(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":39,"./Rectangle":65}],64:[function(t,e,r){function i(t){var e=t;if(!Array.isArray(e)){e=new Array(arguments.length);for(var r=0;rs;s++)i.push(e[s].x,e[s].y);e=i}this.closed=!0,this.points=e,this.type=o.SHAPES.POLY}var n=t("../Point"),o=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.points.slice())},i.prototype.contains=function(t,e){for(var r=!1,i=this.points.length/2,n=0,o=i-1;i>n;o=n++){var s=this.points[2*n],a=this.points[2*n+1],h=this.points[2*o],u=this.points[2*o+1],l=a>e!=u>e&&(h-s)*(e-a)/(u-a)+s>t;l&&(r=!r)}return r}},{"../../const":39,"../Point":60}],65:[function(t,e,r){function i(t,e,r,i){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.type=n.SHAPES.RECT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.EMPTY=new i(0,0,0,0),i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height)},i.prototype.copy=function(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.x+t.width&&(this.width=t.width-this.x,this.width<0&&(this.width=0)),this.y+this.height>t.y+t.height&&(this.height=t.height-this.y,this.height<0&&(this.height=0))},i.prototype.enlarge=function(t){if(t!==i.EMPTY){var e=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);this.x=e,this.width=r-e,this.y=n,this.height=o-n}}},{"../../const":39}],66:[function(t,e,r){function i(t,e,r,i,o){this.x=t||0,this.y=e||0,this.width=r||0,this.height=i||0,this.radius=o||20,this.type=n.SHAPES.RREC}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.radius); +},i.prototype.contains=function(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height}},{"../../const":39}],67:[function(t,e,r){function i(t,e,r,i){if(u.call(this),n.sayHello(t),i)for(var o in s.DEFAULT_RENDER_OPTIONS)"undefined"==typeof i[o]&&(i[o]=s.DEFAULT_RENDER_OPTIONS[o]);else i=s.DEFAULT_RENDER_OPTIONS;this.type=s.RENDERER_TYPE.UNKNOWN,this.width=e||800,this.height=r||600,this.view=i.view||document.createElement("canvas"),this.resolution=i.resolution,this.transparent=i.transparent,this.autoResize=i.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=i.preserveDrawingBuffer,this.clearBeforeRender=i.clearBeforeRender,this.roundPixels=i.roundPixels,this._backgroundColor=0,this._backgroundColorRgba=[0,0,0,0],this._backgroundColorString="#000000",this.backgroundColor=i.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent=new a,this._lastObjectRendered=this._tempDisplayObjectParent}var n=t("../utils"),o=t("../math"),s=t("../const"),a=t("../display/Container"),h=t("../textures/RenderTexture"),u=t("eventemitter3"),l=new o.Matrix;i.prototype=Object.create(u.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._backgroundColorString=n.hex2string(t),n.hex2rgb(t,this._backgroundColorRgba)}}}),i.prototype.resize=function(t,e){this.width=t*this.resolution,this.height=e*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px",this.view.style.height=this.height/this.resolution+"px")},i.prototype.generateTexture=function(t,e,r){var i=t.getLocalBounds(),n=h.create(0|i.width,0|i.height,e,r);return l.tx=-i.x,l.ty=-i.y,this.render(t,n,!1,l,!0),n},i.prototype.destroy=function(t){t&&this.view.parentNode&&this.view.parentNode.removeChild(this.view),this.type=s.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this.roundPixels=!1,this._backgroundColor=0,this._backgroundColorRgba=null,this._backgroundColorString=null,this.backgroundColor=0,this._tempDisplayObjectParent=null,this._lastObjectRendered=null}},{"../const":39,"../display/Container":40,"../math":61,"../textures/RenderTexture":100,"../utils":108,eventemitter3:26}],68:[function(t,e,r){function i(t,e,r){r=r||{},n.call(this,"Canvas",t,e,r),this.type=u.RENDERER_TYPE.CANVAS,this.rootContext=this.view.getContext("2d",{alpha:this.transparent}),this.rootResolution=this.resolution,this.refresh=!0,this.maskManager=new o(this),this.smoothProperty="imageSmoothingEnabled",this.rootContext.imageSmoothingEnabled||(this.rootContext.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.rootContext.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.rootContext.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.rootContext.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this.blendModes=a(),this._activeBlendMode=null,this.context=null,this.renderingToScreen=!1,this.resize(t,e)}var n=t("../SystemRenderer"),o=t("./utils/CanvasMaskManager"),s=t("./utils/CanvasRenderTarget"),a=t("./utils/mapCanvasBlendModesToPixi"),h=t("../../utils"),u=t("../../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,h.pluginTarget.mixin(i),i.prototype.render=function(t,e,r,i,n){if(this.view){this.renderingToScreen=!e,this.emit("prerender"),e?(e=e.baseTexture||e,e._canvasRenderTarget||(e._canvasRenderTarget=new s(e.width,e.height,e.resolution),e.source=e._canvasRenderTarget.canvas,e.valid=!0),this.context=e._canvasRenderTarget.context,this.resolution=e._canvasRenderTarget.resolution):(this.context=this.rootContext,this.resolution=this.rootResolution);var o=this.context;if(this._lastObjectRendered=t,!n){var a=t.parent,h=this._tempDisplayObjectParent.transform.worldTransform;i?i.copy(h):h.identity(),t.parent=this._tempDisplayObjectParent,t.updateTransform(),t.parent=a}o.setTransform(1,0,0,1,0,0),o.globalAlpha=1,o.globalCompositeOperation=this.blendModes[u.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(o.fillStyle="black",o.clear()),(r||this.clearBeforeRender)&&(this.transparent?o.clearRect(0,0,this.width,this.height):(o.fillStyle=this._backgroundColorString,o.fillRect(0,0,this.width,this.height)));var l=this.context;this.context=o,t.renderCanvas(this),this.context=l,this.emit("postrender")}},i.prototype.setBlendMode=function(t){this._activeBlendMode!==t&&(this.context.globalCompositeOperation=this.blendModes[t])},i.prototype.destroy=function(t){this.destroyPlugins(),n.prototype.destroy.call(this,t),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.smoothProperty=null},i.prototype.resize=function(t,e){n.prototype.resize.call(this,t,e),this.smoothProperty&&(this.rootContext[this.smoothProperty]=u.SCALE_MODES.DEFAULT===u.SCALE_MODES.LINEAR)}},{"../../const":39,"../../utils":108,"../SystemRenderer":67,"./utils/CanvasMaskManager":69,"./utils/CanvasRenderTarget":70,"./utils/mapCanvasBlendModesToPixi":72}],69:[function(t,e,r){function i(t){this.renderer=t}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,i.prototype.pushMask=function(t){var e=this.renderer;e.context.save();var r=t.alpha,i=t.transform.worldTransform,n=e.resolution;e.context.setTransform(i.a*n,i.b*n,i.c*n,i.d*n,i.tx*n,i.ty*n),t._texture||(this.renderGraphicsShape(t),e.context.clip()),t.worldAlpha=r},i.prototype.renderGraphicsShape=function(t){var e=this.renderer.context,r=t.graphicsData.length;if(0!==r){e.beginPath();for(var i=0;r>i;i++){var o=t.graphicsData[i],s=o.shape;if(o.type===n.SHAPES.POLY){var a=s.points;e.moveTo(a[0],a[1]);for(var h=1;hS?S:E,e.moveTo(T,b+E),e.lineTo(T,b+w-E),e.quadraticCurveTo(T,b+w,T+E,b+w),e.lineTo(T+_-E,b+w),e.quadraticCurveTo(T+_,b+w,T+_,b+w-E),e.lineTo(T+_,b+E),e.quadraticCurveTo(T+_,b,T+_-E,b),e.lineTo(T+E,b),e.quadraticCurveTo(T,b,T,b+E),e.closePath()}}}},i.prototype.popMask=function(t){t.context.restore()},i.prototype.destroy=function(){}},{"../../../const":39}],70:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||n.RESOLUTION,this.resize(t,e)}var n=t("../../../const");i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return this.canvas.width},set:function(t){this.canvas.width=t}},height:{get:function(){return this.canvas.height},set:function(t){this.canvas.height=t}}}),i.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},i.prototype.resize=function(t,e){this.canvas.width=t*this.resolution,this.canvas.height=e*this.resolution},i.prototype.destroy=function(){this.context=null,this.canvas=null}},{"../../../const":39}],71:[function(t,e,r){var i=function(){if("undefined"==typeof document)return!1;var t="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",e="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",r=new Image;r.src=t+"AP804Oa6"+e;var i=new Image;i.src=t+"/wCKxvRF"+e;var n=document.createElement("canvas");n.width=6,n.height=1;var o=n.getContext("2d");o.globalCompositeOperation="multiply",o.drawImage(r,0,0),o.drawImage(i,2,0);var s=o.getImageData(2,0,1,1).data;return 255===s[0]&&0===s[1]&&0===s[2]};e.exports=i},{}],72:[function(t,e,r){function i(t){return t=t||[],o()?(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="multiply",t[n.BLEND_MODES.SCREEN]="screen",t[n.BLEND_MODES.OVERLAY]="overlay",t[n.BLEND_MODES.DARKEN]="darken",t[n.BLEND_MODES.LIGHTEN]="lighten",t[n.BLEND_MODES.COLOR_DODGE]="color-dodge",t[n.BLEND_MODES.COLOR_BURN]="color-burn",t[n.BLEND_MODES.HARD_LIGHT]="hard-light",t[n.BLEND_MODES.SOFT_LIGHT]="soft-light",t[n.BLEND_MODES.DIFFERENCE]="difference",t[n.BLEND_MODES.EXCLUSION]="exclusion",t[n.BLEND_MODES.HUE]="hue",t[n.BLEND_MODES.SATURATION]="saturate",t[n.BLEND_MODES.COLOR]="color",t[n.BLEND_MODES.LUMINOSITY]="luminosity"):(t[n.BLEND_MODES.NORMAL]="source-over",t[n.BLEND_MODES.ADD]="lighter",t[n.BLEND_MODES.MULTIPLY]="source-over",t[n.BLEND_MODES.SCREEN]="source-over",t[n.BLEND_MODES.OVERLAY]="source-over",t[n.BLEND_MODES.DARKEN]="source-over",t[n.BLEND_MODES.LIGHTEN]="source-over",t[n.BLEND_MODES.COLOR_DODGE]="source-over",t[n.BLEND_MODES.COLOR_BURN]="source-over",t[n.BLEND_MODES.HARD_LIGHT]="source-over",t[n.BLEND_MODES.SOFT_LIGHT]="source-over",t[n.BLEND_MODES.DIFFERENCE]="source-over",t[n.BLEND_MODES.EXCLUSION]="source-over",t[n.BLEND_MODES.HUE]="source-over",t[n.BLEND_MODES.SATURATION]="source-over",t[n.BLEND_MODES.COLOR]="source-over",t[n.BLEND_MODES.LUMINOSITY]="source-over"),t}var n=t("../../../const"),o=t("./canUseNewCanvasBlendModes");e.exports=i},{"../../../const":39,"./canUseNewCanvasBlendModes":71}],73:[function(t,e,r){function i(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=3600,this.checkCountMax=600,this.mode=n.GC_MODES.DEFAULT}var n=t("../../const");i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.count++,this.mode!==n.GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run()))},i.prototype.run=function(){var t,e,r=this.renderer.textureManager,i=r._managedTextures,n=!1;for(t=0;tthis.maxIdle&&(r.destroyTexture(o,!0),i[t]=null,n=!0)}if(n){for(e=0,t=0;t=0;r--)this.unload(t.children[r])}},{"../../const":39}],74:[function(t,e,r){var i=t("pixi-gl-core").GLTexture,n=t("../../const"),o=t("./utils/RenderTarget"),s=t("../../utils"),a=function(t){this.renderer=t,this.gl=t.gl,this._managedTextures=[]};a.prototype.bindTexture=function(){},a.prototype.getTexture=function(){},a.prototype.updateTexture=function(t){t=t.baseTexture||t;var e=!!t._glRenderTargets;if(t.hasLoaded){var r=t._glTextures[this.renderer.CONTEXT_UID];if(r)e?t._glRenderTargets[this.renderer.CONTEXT_UID].resize(t.width,t.height):r.upload(t.source);else{if(e){var s=new o(this.gl,t.width,t.height,t.scaleMode,t.resolution);s.resize(t.width,t.height),t._glRenderTargets[this.renderer.CONTEXT_UID]=s,r=s.texture}else r=new i(this.gl),r.premultiplyAlpha=!0,r.upload(t.source);t._glTextures[this.renderer.CONTEXT_UID]=r,t.on("update",this.updateTexture,this),t.on("dispose",this.destroyTexture,this),this._managedTextures.push(t),t.isPowerOfTwo?(t.mipmap&&r.enableMipmap(),t.wrapMode===n.WRAP_MODES.CLAMP?r.enableWrapClamp():t.wrapMode===n.WRAP_MODES.REPEAT?r.enableWrapRepeat():r.enableWrapMirrorRepeat()):r.enableWrapClamp(),t.scaleMode===n.SCALE_MODES.NEAREST?r.enableNearestScaling():r.enableLinearScaling()}return r}},a.prototype.destroyTexture=function(t,e){if(t=t.baseTexture||t,t.hasLoaded&&t._glTextures[this.renderer.CONTEXT_UID]&&(t._glTextures[this.renderer.CONTEXT_UID].destroy(),t.off("update",this.updateTexture,this),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.renderer.CONTEXT_UID],!e)){var r=this._managedTextures.indexOf(t);-1!==r&&s.removeItems(this._managedTextures,r,1)}},a.prototype.removeAll=function(){for(var t=0;t 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")},{"../../../utils":108,"./extractUniformsFromSrc":78}],78:[function(t,e,r){function i(t,e,r){var i=n(t,r),o=n(e,r);return Object.assign(i,o)}function n(t){for(var e,r=new RegExp("^(projectionMatrix|uSampler|filterArea)$"),i={},n=t.replace(/\s+/g," ").split(/\s*;\s*/),a=0;a-1){var u=h.split(" "),l=u[1],c=u[2],p=s(l);c.indexOf("[")>-1&&(e=c.split(/\[|\]/),c=e[0],p*=Number(e[1])),c.match(r)||(i[c]={value:o(l,p),name:c,type:l})}}return i}var o=t("pixi-gl-core/lib/shader/defaultValue"),s=t("pixi-gl-core/lib/shader/mapSize");e.exports=i},{"pixi-gl-core/lib/shader/defaultValue":10,"pixi-gl-core/lib/shader/mapSize":14}],79:[function(t,e,r){var i=t("../../../math"),n=function(t,e,r){var i=t.identity();return i.translate(e.x/r.width,e.y/r.height),i.scale(r.width,r.height),i},o=function(t,e,r){var i={width:800,height:600},n=t.identity(),o=r.height/r.width;n.translate(e.x/r.width,e.y/r.height),n.scale(1,o);var s=r.width/i.width,a=r.height/i.height;return n.scale(1,1/o),n.scale(s,a),n},s=function(t,e,r,n){var o=n.worldTransform.copy(i.Matrix.TEMP_MATRIX),s=n._texture.baseTexture,a=t.identity(),h=r.height/r.width;a.translate(e.x/r.width,e.y/r.height),a.scale(1,h);var u=r.width/s.width,l=r.height/s.height;return o.tx/=s.width*u,o.ty/=s.width*u,o.invert(),a.prepend(o),a.scale(1,1/h),a.scale(u,l),a.translate(n.anchor.x,n.anchor.y),a};e.exports={calculateScreenSpaceMatrix:n,calculateNormalisedScreenSpaceMatrix:o,calculateSpriteMatrix:s}},{"../../../math":61}],80:[function(t,e,r){function i(t){var e=new o.Matrix;n.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n}\n","precision lowp float;\n#define GLSLIFY 1\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n"),t.renderable=!1,this.maskSprite=t,this.maskMatrix=e}var n=t("../Filter"),o=t("../../../../math");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=this.maskSprite;this.uniforms.mask=i._texture,this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,i),this.uniforms.alpha=i.worldAlpha,t.applyFilter(this,e,r)}},{"../../../../math":61,"../Filter":77}],81:[function(t,e,r){function i(t){n.call(this,t),this.gl=this.renderer.gl,this.quad=new s(this.gl,t.state.attribState);var e=new c;e.sourceFrame=e.destinationFrame=this.renderer.rootRenderTarget.size,e.renderTarget=t.rootRenderTarget,this.stack=[e],this.stackIndex=0,this.shaderCache={}}var n=t("./WebGLManager"),o=t("../utils/RenderTarget"),s=t("../utils/Quad"),a=t("../../../math"),h=t("pixi-gl-core").GLShader,u=t("../filters/filterTransforms"),l=t("bit-twiddle"),c=function(){this.renderTarget=null,this.sourceFrame=new a.Rectangle,this.destinationFrame=new a.Rectangle,this.filters=[],this.target=null,this.resolution=1};i.pool={},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.pushFilter=function(t,e){var r=this.renderer,n=this.stack[++this.stackIndex];n||(n=this.stack[this.stackIndex]=new c);var o=e[0].resolution,s=e[0].padding,a=t.filterArea||t.getBounds(),h=n.sourceFrame,u=n.destinationFrame;h.x=((a.x+s)*o|0)/o,h.y=((a.y+s)*o|0)/o,h.width=((a.width+2*s)*o|0)/o,h.height=((a.height+2*s)*o|0)/o,h.fit(this.stack[0].destinationFrame),u.width=h.width,u.height=h.height;var l=i.getPotRenderTarget(r.gl,h.width,h.height,o);n.target=t,n.filters=e,n.resolution=o,n.renderTarget=l,l.setFrame(u,h),r.bindRenderTarget(l),r.clear()},i.prototype.popFilter=function(){var t=this.stack[this.stackIndex-1],e=this.stack[this.stackIndex];this.quad.map(e.renderTarget.size,e.sourceFrame).upload();var r=e.filters;if(1===r.length)r[0].apply(this,e.renderTarget,t.renderTarget,!1),i.freePotRenderTarget(e.renderTarget);else{var n=e.renderTarget,o=i.getPotRenderTarget(this.renderer.gl,e.sourceFrame.width,e.sourceFrame.height,1);o.setFrame(e.destinationFrame,e.sourceFrame);for(var s=0;sr;r++)this.interleaved[4*r]=this.vertices[2*r],this.interleaved[4*r+1]=this.vertices[2*r+1],this.interleaved[4*r+2]=this.uvs[2*r],this.interleaved[4*r+3]=this.uvs[2*r+1];this.indices=o(1),this.vertexBuffer=n.GLBuffer.createVertexBuffer(t,this.interleaved,t.STATIC_DRAW),this.indexBuffer=n.GLBuffer.createIndexBuffer(t,this.indices,t.STATIC_DRAW),this.vao=new n.VertexArrayObject(t,e)}var n=t("pixi-gl-core"),o=t("../../../utils/createIndicesForQuads");i.prototype.constructor=i,i.prototype.initVao=function(t){this.vao.clear().addIndex(this.indexBuffer).addAttribute(this.vertexBuffer,t.attributes.aVertexPosition,this.gl.FLOAT,!1,16,0).addAttribute(this.vertexBuffer,t.attributes.aTextureCoord,this.gl.FLOAT,!1,16,8)},i.prototype.map=function(t,e){var r=0,i=0;return this.uvs[0]=r,this.uvs[1]=i,this.uvs[2]=r+e.width/t.width,this.uvs[3]=i,this.uvs[4]=r+e.width/t.width,this.uvs[5]=i+e.height/t.height,this.uvs[6]=r,this.uvs[7]=i+e.height/t.height,r=e.x,i=e.y,this.vertices[0]=r,this.vertices[1]=i,this.vertices[2]=r+e.width,this.vertices[3]=i,this.vertices[4]=r+e.width,this.vertices[5]=i+e.height,this.vertices[6]=r,this.vertices[7]=i+e.height,this},i.prototype.draw=function(){return this.vao.bind().draw(this.gl.TRIANGLES,6,0).unbind(),this},i.prototype.upload=function(){for(var t=0;4>t;t++)this.interleaved[4*t]=this.vertices[2*t],this.interleaved[4*t+1]=this.vertices[2*t+1],this.interleaved[4*t+2]=this.uvs[2*t],this.interleaved[4*t+3]=this.uvs[2*t+1];return this.vertexBuffer.upload(this.interleaved),this},i.prototype.destroy=function(){var t=this.gl;t.deleteBuffer(this.vertexBuffer),t.deleteBuffer(this.indexBuffer)},e.exports=i},{"../../../utils/createIndicesForQuads":106,"pixi-gl-core":1}],87:[function(t,e,r){var i=t("../../../math"),n=t("../../../const"),o=t("pixi-gl-core").GLFramebuffer,s=function(t,e,r,s,a,h){this.gl=t,this.frameBuffer=null,this.texture=null,this.clearColor=[0,0,0,0],this.size=new i.Rectangle(0,0,1,1),this.resolution=a||n.RESOLUTION,this.projectionMatrix=new i.Matrix,this.transform=null,this.frame=null,this.defaultFrame=new i.Rectangle,this.destinationFrame=null,this.sourceFrame=null,this.stencilBuffer=null,this.stencilMaskStack=[],this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=s||n.SCALE_MODES.DEFAULT,this.root=h,this.root?(this.frameBuffer=new o(t,100,100),this.frameBuffer.framebuffer=null):(this.frameBuffer=o.createRGBA(t,100,100),this.scaleMode===n.SCALE_MODES.NEAREST?this.frameBuffer.texture.enableNearestScaling():this.frameBuffer.texture.enableLinearScaling(),this.texture=this.frameBuffer.texture),this.setFrame(),this.resize(e,r)};s.prototype.constructor=s,e.exports=s,s.prototype.clear=function(t){var e=t||this.clearColor;this.frameBuffer.clear(e[0],e[1],e[2],e[3])},s.prototype.attachStencilBuffer=function(){this.root||this.frameBuffer.enableStencil()},s.prototype.setFrame=function(t,e){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t},s.prototype.activate=function(){var t=this.gl;this.frameBuffer.bind(),this.calculateProjection(this.destinationFrame,this.sourceFrame),this.transform&&this.projectionMatrix.append(this.transform),this.destinationFrame!==this.sourceFrame?(t.enable(t.SCISSOR_TEST),t.scissor(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)):t.disable(t.SCISSOR_TEST),t.viewport(0|this.destinationFrame.x,0|this.destinationFrame.y,this.destinationFrame.width*this.resolution|0,this.destinationFrame.height*this.resolution|0)},s.prototype.calculateProjection=function(t,e){var r=this.projectionMatrix;e=e||t,r.identity(),this.root?(r.a=1/t.width*2,r.d=-1/t.height*2,r.tx=-1-e.x*r.a,r.ty=1-e.y*r.d):(r.a=1/t.width*2,r.d=1/t.height*2,r.tx=-1-e.x*r.a,r.ty=-1-e.y*r.d)},s.prototype.resize=function(t,e){if(t=0|t,e=0|e,this.size.width!==t||this.size.height!==e){this.size.width=t,this.size.height=e,this.defaultFrame.width=t,this.defaultFrame.height=e,this.frameBuffer.resize(t*this.resolution,e*this.resolution);var r=this.frame||this.size;this.calculateProjection(r)}},s.prototype.destroy=function(){this.frameBuffer.destroy(),this.frameBuffer=null,this.texture=null}},{"../../../const":39,"../../../math":61,"pixi-gl-core":1}],88:[function(t,e,r){function i(t){for(var e="",r=0;t>r;r++)r>0&&(e+="\nelse "),t-1>r&&(e+="if(test == "+r+".0){}");return e}var n=t("pixi-gl-core"),o=["precision lowp float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n"),s=function(t,e){var r=!e;if(r){var s=document.createElement("canvas");s.width=1,s.height=1,e=n.createContext(s)}for(var a=e.createShader(e.FRAGMENT_SHADER);;){var h=o.replace(/\%forloop\%/gi,i(t));if(e.shaderSource(a,h),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))break;t=t/2|0}return r&&e.getExtension("WEBGL_lose_context")&&e.getExtension("WEBGL_lose_context").loseContext(),t};e.exports=s},{"pixi-gl-core":1}],89:[function(t,e,r){function i(t,e){return e=e||[],e[n.BLEND_MODES.NORMAL]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.ADD]=[t.ONE,t.DST_ALPHA],e[n.BLEND_MODES.MULTIPLY]=[t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SCREEN]=[t.ONE,t.ONE_MINUS_SRC_COLOR],e[n.BLEND_MODES.OVERLAY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DARKEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LIGHTEN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_DODGE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR_BURN]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HARD_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SOFT_LIGHT]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.DIFFERENCE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.EXCLUSION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.HUE]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.SATURATION]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.COLOR]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e[n.BLEND_MODES.LUMINOSITY]=[t.ONE,t.ONE_MINUS_SRC_ALPHA],e}var n=t("../../../const");e.exports=i},{"../../../const":39}],90:[function(t,e,r){function i(t,e){e=e||{},e[n.DRAW_MODES.POINTS]=t.POINTS,e[n.DRAW_MODES.LINES]=t.LINES,e[n.DRAW_MODES.LINE_LOOP]=t.LINE_LOOP,e[n.DRAW_MODES.LINE_STRIP]=t.LINE_STRIP,e[n.DRAW_MODES.TRIANGLES]=t.TRIANGLES,e[n.DRAW_MODES.TRIANGLE_STRIP]=t.TRIANGLE_STRIP,e[n.DRAW_MODES.TRIANGLE_FAN]=t.TRIANGLE_FAN}var n=t("../../../const");e.exports=i},{"../../../const":39}],91:[function(t,e,r){function i(t){s.call(this),this.anchor=new n.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=h.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=t||o.EMPTY,this.textureDirty=!0,this.vertexData=new Float32Array(8)}var n=t("../math"),o=t("../textures/Texture"),s=t("../display/Container"),a=t("../utils"),h=t("../const"),u=new n.Point;i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{width:{get:function(){return Math.abs(this.scale.x)*this.texture.orig.width},set:function(t){var e=a.sign(this.scale.x)||1;this.scale.x=e*t/this.texture.orig.width,this._width=t}},height:{get:function(){return Math.abs(this.scale.y)*this.texture.orig.height},set:function(t){var e=a.sign(this.scale.y)||1;this.scale.y=e*t/this.texture.orig.height,this._height=t}},texture:{get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t,this.cachedTint=16777215,this.textureDirty=!0,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}}),i.prototype._onTextureUpdate=function(){this.textureDirty=!0,this._width&&(this.scale.x=a.sign(this.scale.x)*this._width/this.texture.orig.width),this._height&&(this.scale.y=a.sign(this.scale.y)*this._height/this.texture.orig.height)},i.prototype.caclulateVertices=function(){var t,e,r,i,n=this._texture,o=this.transform.worldTransform,s=o.a,a=o.b,h=o.c,u=o.d,l=o.tx,c=o.ty,p=this.vertexData,d=n.trim,f=n.orig;d?(e=d.x-this.anchor.x*f.width,t=e+d.width,i=d.y-this.anchor.y*f.height,r=i+d.height):(t=f.width*(1-this.anchor.x),e=f.width*-this.anchor.x,r=f.height*(1-this.anchor.y),i=f.height*-this.anchor.y),p[0]=s*e+h*i+l,p[1]=u*i+a*e+c,p[2]=s*t+h*i+l,p[3]=u*i+a*t+c,p[4]=s*t+h*r+l,p[5]=u*r+a*t+c,p[6]=s*e+h*r+l,p[7]=u*r+a*e+c},i.prototype._renderWebGL=function(t){(this.transform.updated||this.textureDirty)&&(this.textureDirty=!1,this.caclulateVertices()),t.setObjectRenderer(t.plugins.sprite),t.plugins.sprite.render(this)},i.prototype._renderCanvas=function(t){t.plugins.sprite.render(this)},i.prototype.getBounds=function(){if(!this._currentBounds){this.vertexDirty=!1,this.caclulateVertices();var t,e,r,i,n,o,s,a,h=this.vertexData,u=h[0],l=h[1],c=h[2],p=h[3],d=h[4],f=h[5],v=h[6],g=h[7];if(t=u,t=t>c?c:t,t=t>d?d:t,t=t>v?v:t,r=l,r=r>p?p:r,r=r>f?f:r,r=r>g?g:r,e=u,e=c>e?c:e,e=d>e?d:e,e=v>e?v:e,i=l,i=p>i?p:i,i=f>i?f:i,i=g>i?g:i,this.children.length){var y=this.containerGetBounds();n=y.x,o=y.x+y.width,s=y.y,a=y.y+y.height,t=n>t?t:n,r=s>r?r:s,e=e>o?e:o,i=i>a?i:a}var x=this._bounds;x.x=t,x.width=e-t,x.y=r,x.height=i-r,this._currentBounds=x}return this._currentBounds},i.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture.orig.width*this.anchor.x,this._bounds.y=-this._texture.orig.height*this.anchor.y,this._bounds.width=this._texture.orig.width,this._bounds.height=this._texture.orig.height,this._bounds},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,u);var e,r=this._texture.orig.width,i=this._texture.orig.height,n=-r*this.anchor.x;return u.x>n&&u.xe&&u.y=this.size&&this.flush(),t.texture._uvs&&(this.sprites[this.currentIndex++]=t)},i.prototype.flush=function(){if(0!==this.currentIndex){var t,e,r,i,n,o,s=this.renderer.gl,a=p.nextPow2(this.currentIndex),h=p.log2(a),u=this.buffers[h],l=this.sprites,d=this.groups,f=u.float32View,v=u.uint32View,g=0,y=1,x=0,m=d[0],T=l[0].blendMode;m.textureCount=0,m.start=0,m.blend=T,this.tick++;for(var b=0;b>16)+(65280&_.tint)+((255&_.tint)<<16)+(255*_.worldAlpha<<24),n=_._texture._uvs.uvsUint32,o=t._id,f[g++]=r[0],f[g++]=r[1],v[g++]=n[0],v[g++]=i,f[g++]=o,f[g++]=r[2],f[g++]=r[3],v[g++]=n[1],v[g++]=i,f[g++]=o,f[g++]=r[4],f[g++]=r[5],v[g++]=n[2],v[g++]=i,f[g++]=o,f[g++]=r[6],f[g++]=r[7],v[g++]=n[3],v[g++]=i,f[g++]=o}for(m.size=b-m.start,this.vertexCount++,this.vaoMax<=this.vertexCount&&(this.vaoMax++,this.vertexBuffers[this.vertexCount]=c.GLBuffer.createVertexBuffer(s,null,s.STREAM_DRAW),this.vaos[this.vertexCount]=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aVertexPosition,s.FLOAT,!1,this.vertByteSize,0).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aTextureCoord,s.UNSIGNED_SHORT,!0,this.vertByteSize,8).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aColor,s.UNSIGNED_BYTE,!0,this.vertByteSize,12).addAttribute(this.vertexBuffers[this.vertexCount],this.shader.attributes.aTextureId,s.FLOAT,!1,this.vertByteSize,16)),this.vertexBuffers[this.vertexCount].upload(u.vertices,0),this.vao=this.vaos[this.vertexCount].bind(),b=0;y>b;b++){for(var w=d[b],E=0;Eu;u++)h[u]=u;return a.bind(),a.uniforms.uSamplers=h,a}function n(t){var e="";e+="\n",e+="\n";for(var r=0;t>r;r++)r>0&&(e+="\nelse "),t-1>r&&(e+="if(vTextureId == "+r+".0)"),e+="\n{",e+="\n color = texture2D(uSamplers["+r+"], vTextureCoord);",e+="\n}";return e+="\n",e+="\n"}var o=t("pixi-gl-core").GLShader,s=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","varying float vTextureId;","uniform sampler2D uSamplers[%count%];","void main(void){","vec4 color;","%forloop%","gl_FragColor = color * vColor;","}"].join("\n");e.exports=i},{"pixi-gl-core":1}],97:[function(t,e,r){function i(t,e,r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=r||h.RESOLUTION,this._text=null,this._style=null;var i=o.fromCanvas(this.canvas);i.trim=new s.Rectangle,n.call(this,i),this.text=t,this.style=e}var n=t("../sprites/Sprite"),o=t("../textures/Texture"),s=t("../math"),a=t("../utils"),h=t("../const");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.fontPropertiesCache={},i.fontPropertiesCanvas=document.createElement("canvas"),i.fontPropertiesContext=i.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(i.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(t){this.scale.x=t/this._texture._frame.width,this._width=t}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(t){this.scale.y=t/this._texture._frame.height,this._height=t}},style:{get:function(){return this._style},set:function(t){t=t||{},"number"==typeof t.fill&&(t.fill=a.hex2string(t.fill)),"number"==typeof t.stroke&&(t.stroke=a.hex2string(t.stroke)),"number"==typeof t.dropShadowColor&&(t.dropShadowColor=a.hex2string(t.dropShadowColor)),t.font=t.font||"bold 20pt Arial",t.fill=t.fill||"black",t.align=t.align||"left",t.stroke=t.stroke||"black",t.strokeThickness=t.strokeThickness||0,t.wordWrap=t.wordWrap||!1,t.wordWrapWidth=t.wordWrapWidth||100,t.breakWords=t.breakWords||!1,t.letterSpacing=t.letterSpacing||0,t.dropShadow=t.dropShadow||!1,t.dropShadowColor=t.dropShadowColor||"#000000",t.dropShadowAngle=void 0!==t.dropShadowAngle?t.dropShadowAngle:Math.PI/6,t.dropShadowDistance=void 0!==t.dropShadowDistance?t.dropShadowDistance:5,t.dropShadowBlur=void 0!==t.dropShadowBlur?t.dropShadowBlur:0,t.padding=t.padding||0,t.textBaseline=t.textBaseline||"alphabetic",t.lineJoin=t.lineJoin||"miter",t.miterLimit=t.miterLimit||10,this._style=t,this.dirty=!0}},text:{get:function(){return this._text},set:function(t){t=t||" ",t=t.toString(),this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){var t=this._style;this.context.font=t.font;for(var e=t.wordWrap?this.wordWrap(this._text):this._text,r=e.split(/(?:\r\n|\r|\n)/),i=new Array(r.length),n=0,o=this.determineFontProperties(t.font),s=0;s0?(this.context.shadowColor=t.dropShadowColor,this.context.shadowBlur=t.dropShadowBlur):this.context.fillStyle=t.dropShadowColor;var d=Math.cos(t.dropShadowAngle)*t.dropShadowDistance,f=Math.sin(t.dropShadowAngle)*t.dropShadowDistance;for(s=0;sh;h++){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d+=p}for(e.ascent=s-h,d=c-p,f=!1,h=a;h>s;h--){for(u=0;p>u;u+=4)if(255!==l[d+u]){f=!0;break}if(f)break;d-=p}e.descent=h-s,e.fontSize=e.ascent+e.descent,i.fontPropertiesCache[t]=e}return e},i.prototype.wordWrap=function(t){for(var e="",r=t.split("\n"),i=this._style.wordWrapWidth,n=0;ni)for(var u=s[a].split(""),l=0;lo?(e+="\n"+u[l],o=i-c):(0===l&&(e+=" "),e+=u[l],o-=c)}else{var p=h+this.context.measureText(" ").width;0===a||p>o?(a>0&&(e+="\n"),e+=s[a],o=i-h):(o-=p,e+=" "+s[a])}}n0&&e>0,this.width=t,this.height=e,this.valid&&(this.emit("update",this),this.filterManager&&this.filterManager.resize(this.width,this.height)))},i.prototype.destroy=function(){n.prototype.destroy.call(this,!0),this.filterManager&&this.filterManager.destroy(),this.renderer=null}},{"../const":39,"./BaseTexture":99}],99:[function(t,e,r){function i(t,e,r){s.call(this),this.uid=n.uid(),this.touched=0,this.resolution=r||1,this.width=100,this.height=100,this.realWidth=100,this.realHeight=100,this.scaleMode=e||o.SCALE_MODES.DEFAULT,this.hasLoaded=!1,this.isLoading=!1,this.source=null,this.premultipliedAlpha=!0,this.imageUrl=null,this.isPowerOfTwo=!1,this.mipmap=o.MIPMAP_TEXTURES,this.wrap=o.MIPMAP_TEXTURES,this._glTextures=[],this._enabled=0,this._id=0,t&&this.loadSource(t)}var n=t("../utils"),o=t("../const"),s=t("eventemitter3"),a=t("../utils/determineCrossOrigin"),h=t("bit-twiddle");i.prototype=Object.create(s.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.update=function(){this.realWidth=this.source.naturalWidth||this.source.videoWidth||this.source.width,this.realHeight=this.source.naturalHeight||this.source.videoHeight||this.source.height,this.width=this.realWidth/this.resolution,this.height=this.realHeight/this.resolution,this.isPowerOfTwo=h.isPow2(this.realWidth)&&h.isPow2(this.realHeight),this.emit("update",this)},i.prototype.loadSource=function(t){var e=this.isLoading;if(this.hasLoaded=!1,this.isLoading=!1,e&&this.source&&(this.source.onload=null,this.source.onerror=null),this.source=t,(this.source.complete||this.source.getContext)&&this.source.width&&this.source.height)this._sourceLoaded();else if(!t.getContext){this.isLoading=!0;var r=this;t.onload=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r._sourceLoaded(),r.emit("loaded",r))},t.onerror=function(){t.onload=null,t.onerror=null,r.isLoading&&(r.isLoading=!1,r.emit("error",r))},t.complete&&t.src&&(this.isLoading=!1,t.onload=null,t.onerror=null,t.width&&t.height?(this._sourceLoaded(),e&&this.emit("loaded",this)):e&&this.emit("error",this))}},i.prototype._sourceLoaded=function(){this.hasLoaded=!0,this.update()},i.prototype.destroy=function(){this.imageUrl?(delete n.BaseTextureCache[this.imageUrl],delete n.TextureCache[this.imageUrl],this.imageUrl=null,navigator.isCocoonJS||(this.source.src="")):this.source&&this.source._pixiId&&delete n.BaseTextureCache[this.source._pixiId],this.source=null,this.dispose()},i.prototype.dispose=function(){this.emit("dispose",this); +},i.prototype.updateSourceImage=function(t){this.source.src=t,this.loadSource(this.source)},i.fromImage=function(t,e,r){var o=n.BaseTextureCache[t];if(!o){var s=new Image;void 0===e&&0!==t.indexOf("data:")&&(s.crossOrigin=a(t)),o=new i(s,r),o.imageUrl=t,s.src=t,n.BaseTextureCache[t]=o,o.resolution=n.getResolutionOfUrl(t)}return o},i.fromCanvas=function(t,e){t._pixiId||(t._pixiId="canvas_"+n.uid());var r=n.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),n.BaseTextureCache[t._pixiId]=r),r}},{"../const":39,"../utils":108,"../utils/determineCrossOrigin":107,"bit-twiddle":17,eventemitter3:26}],100:[function(t,e,r){function i(t,e){if(this.legacyRenderer=null,!(t instanceof n)){var r=arguments[1],i=arguments[2],s=arguments[3]||0,a=arguments[4]||1;console.warn("v4 RenderTexture now expects a new BaseRenderTexture. Please use RenderTexture.create("+r+", "+i+")"),this.legacyRenderer=arguments[0],e=null,t=new n(r,i,s,a)}o.call(this,t,e),this.valid=!0,this._updateUvs()}var n=t("./BaseRenderTexture"),o=t("./Texture");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.resize=function(t,e,r){this.valid=t>0&&e>0,this._frame.width=this.orig.width=t,this._frame.height=this.orig.height=e,r||this.baseTexture.resize(t,e),this._updateUvs()},i.create=function(t,e,r,o){return new i(new n(t,e,r,o))}},{"./BaseRenderTexture":98,"./Texture":101}],101:[function(t,e,r){function i(t,e,r,n,o){if(a.call(this),this.noFrame=!1,e||(this.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof i&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.requiresUpdate=!1,this._uvs=null,this.orig=r||e,this._rotate=+(o||0),o===!0)this._rotate=2;else if(this._rotate%2!==0)throw"attempt to use diamond-shaped UVs. If you are sure, set rotation manually";t.hasLoaded?(this.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",this.onBaseTextureUpdated,this)),this.frame=e):t.once("loaded",this.onBaseTextureLoaded,this)}var n=t("./BaseTexture"),o=t("./VideoBaseTexture"),s=t("./TextureUvs"),a=t("eventemitter3"),h=t("../math"),u=t("../utils");i.prototype=Object.create(a.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{frame:{get:function(){return this._frame},set:function(t){if(this._frame=t,this.noFrame=!1,t.x+t.width>this.baseTexture.width||t.y+t.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.valid=t&&t.width&&t.height&&this.baseTexture.hasLoaded,this.trim||(this.orig=t),this.valid&&this._updateUvs()}},rotate:{get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},width:{get:function(){return this.orig?this.orig.width:0}},height:{get:function(){return this.orig?this.orig.height:0}}}),i.prototype.update=function(){this.baseTexture.update()},i.prototype.onBaseTextureLoaded=function(t){this.noFrame?this.frame=new h.Rectangle(0,0,t.width,t.height):this.frame=this._frame,this.baseTexture.on("update",this.onBaseTextureUpdated,this),this.emit("update",this)},i.prototype.onBaseTextureUpdated=function(t){this._frame.width=t.width,this._frame.height=t.height,this.emit("update",this)},i.prototype.destroy=function(t){this.baseTexture&&(t&&this.baseTexture.destroy(),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture.off("loaded",this.onBaseTextureLoaded,this),this.baseTexture=null),this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,this.off("dispose",this.dispose,this),this.off("update",this.update,this)},i.prototype.clone=function(){return new i(this.baseTexture,this.frame,this.orig,this.trim,this.rotate)},i.prototype._updateUvs=function(){this._uvs||(this._uvs=new s),this._uvs.set(this._frame,this.baseTexture,this.rotate)},i.fromImage=function(t,e,r){var o=u.TextureCache[t];return o||(o=new i(n.fromImage(t,e,r)),u.TextureCache[t]=o),o},i.fromFrame=function(t){var e=u.TextureCache[t];if(!e)throw new Error('The frameId "'+t+'" does not exist in the texture cache');return e},i.fromCanvas=function(t,e){return new i(n.fromCanvas(t,e))},i.fromVideo=function(t,e){return"string"==typeof t?i.fromVideoUrl(t,e):new i(o.fromVideo(t,e))},i.fromVideoUrl=function(t,e){return new i(o.fromUrl(t,e))},i.from=function(t){if("string"==typeof t){var e=u.TextureCache[t];if(!e){var r=null!==t.match(/\.(mp4|webm|ogg|h264|avi|mov)$/);return r?i.fromVideoUrl(t):i.fromImage(t)}return e}return t instanceof HTMLCanvasElement?i.fromCanvas(t):t instanceof HTMLVideoElement?i.fromVideo(t):t instanceof n?new i(n):void 0},i.addTextureToCache=function(t,e){u.TextureCache[e]=t},i.removeTextureFromCache=function(t){var e=u.TextureCache[t];return delete u.TextureCache[t],delete u.BaseTextureCache[t],e},i.EMPTY=new i(new n)},{"../math":61,"../utils":108,"./BaseTexture":99,"./TextureUvs":102,"./VideoBaseTexture":103,eventemitter3:26}],102:[function(t,e,r){function i(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsUint32=new Uint32Array(4)}e.exports=i;var n=t("../math/GroupD8");i.prototype.set=function(t,e,r){var i=e.width,o=e.height;if(r){var s=t.width/2/i,a=t.height/2/o,h=t.x/i+s,u=t.y/o+a;r=n.add(r,n.NW),this.x0=h+s*n.uX(r),this.y0=u+a*n.uY(r),r=n.add(r,2),this.x1=h+s*n.uX(r),this.y1=u+a*n.uY(r),r=n.add(r,2),this.x2=h+s*n.uX(r),this.y2=u+a*n.uY(r),r=n.add(r,2),this.x3=h+s*n.uX(r),this.y3=u+a*n.uY(r)}else this.x0=t.x/i,this.y0=t.y/o,this.x1=(t.x+t.width)/i,this.y1=t.y/o,this.x2=(t.x+t.width)/i,this.y2=(t.y+t.height)/o,this.x3=t.x/i,this.y3=(t.y+t.height)/o;this.uvsUint32[0]=(65535*this.y0&65535)<<16|65535*this.x0&65535,this.uvsUint32[1]=(65535*this.y1&65535)<<16|65535*this.x1&65535,this.uvsUint32[2]=(65535*this.y2&65535)<<16|65535*this.x2&65535,this.uvsUint32[3]=(65535*this.y3&65535)<<16|65535*this.x3&65535}},{"../math/GroupD8":58}],103:[function(t,e,r){function i(t,e){if(!t)throw new Error("No video source element specified.");(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),o.call(this,t,e),this.autoUpdate=!1,this._onUpdate=this._onUpdate.bind(this),this._onCanPlay=this._onCanPlay.bind(this),t.complete||(t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlay),t.addEventListener("play",this._onPlayStart.bind(this)),t.addEventListener("pause",this._onPlayStop.bind(this))),this.__loaded=!1}function n(t,e){e||(e="video/"+t.substr(t.lastIndexOf(".")+1));var r=document.createElement("source");return r.src=t,r.type=e,r}var o=t("./BaseTexture"),s=t("../utils");i.prototype=Object.create(o.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._onUpdate=function(){this.autoUpdate&&(window.requestAnimationFrame(this._onUpdate),this.update())},i.prototype._onPlayStart=function(){this.autoUpdate||(window.requestAnimationFrame(this._onUpdate),this.autoUpdate=!0)},i.prototype._onPlayStop=function(){this.autoUpdate=!1},i.prototype._onCanPlay=function(){this.hasLoaded=!0,this.source&&(this.source.removeEventListener("canplay",this._onCanPlay),this.source.removeEventListener("canplaythrough",this._onCanPlay),this.width=this.source.videoWidth,this.height=this.source.videoHeight,this.source.play(),this.__loaded||(this.__loaded=!0,this.emit("loaded",this)))},i.prototype.destroy=function(){this.source&&this.source._pixiId&&(delete s.BaseTextureCache[this.source._pixiId],delete this.source._pixiId),o.prototype.destroy.call(this)},i.fromVideo=function(t,e){t._pixiId||(t._pixiId="video_"+s.uid());var r=s.BaseTextureCache[t._pixiId];return r||(r=new i(t,e),s.BaseTextureCache[t._pixiId]=r),r},i.fromUrl=function(t,e){var r=document.createElement("video");if(Array.isArray(t))for(var o=0;othis._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*n.TARGET_FPMS*this.speed,this._emitter.emit(s,this.deltaTime),this.lastTime=t},e.exports=i},{"../const":39,eventemitter3:26}],105:[function(t,e,r){var i=t("./Ticker"),n=new i;n.autoStart=!0,e.exports={shared:n,Ticker:i}},{"./Ticker":104}],106:[function(t,e,r){var i=function(t){for(var e=6*t,r=new Uint16Array(e),i=0,n=0;e>i;i+=6,n+=4)r[i+0]=n+0,r[i+1]=n+1,r[i+2]=n+2,r[i+3]=n+0,r[i+4]=n+2,r[i+5]=n+3;return r};e.exports=i},{}],107:[function(t,e,r){var i,n=t("url"),o=function(t,e){if(0===t.indexOf("data:"))return"";e=e||window.location,i||(i=document.createElement("a")),i.href=t,t=n.parse(i.href);var r=!t.port&&""===e.port||t.port===e.port;return t.hostname===e.hostname&&r&&t.protocol===e.protocol?"":"anonymous"};e.exports=o},{url:24}],108:[function(t,e,r){var i=t("../const"),n=e.exports={_uid:0,_saidHello:!1,EventEmitter:t("eventemitter3"),pluginTarget:t("./pluginTarget"),uid:function(){return++n._uid},hex2rgb:function(t,e){return e=e||[],e[0]=(t>>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},hex2string:function(t){return t=t.toString(16),t="000000".substr(0,6-t.length)+t,"#"+t},rgb2hex:function(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]},getResolutionOfUrl:function(t){var e=i.RETINA_PREFIX.exec(t);return e?parseFloat(e[1]):1},sayHello:function(t){if(!n._saidHello){if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var e=["\n %c %c %c Pixi.js "+i.VERSION+" - ✰ "+t+" ✰ %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ \n\n","background: #ff66a5; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff66a5; background: #030307; padding:5px 0;","background: #ff66a5; padding:5px 0;","background: #ffc3dc; padding:5px 0;","background: #ff66a5; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;","color: #ff2424; background: #fff; padding:5px 0;"];window.console.log.apply(console,e)}else window.console&&window.console.log("Pixi.js "+i.VERSION+" - "+t+" - http://www.pixijs.com/");n._saidHello=!0}},isWebGLSupported:function(){var t={stencil:!0};try{if(!window.WebGLRenderingContext)return!1;var e=document.createElement("canvas"),r=e.getContext("webgl",t)||e.getContext("experimental-webgl",t);return!(!r||!r.getContextAttributes().stencil)}catch(i){return!1}},sign:function(t){return t?0>t?-1:1:0},removeItems:function(t,e,r){var i=t.length;if(!(e>=i||0===r)){r=e+r>i?i-e:r;for(var n=e,o=i-r;o>n;++n)t[n]=t[n+r];t.length=o}},TextureCache:{},BaseTextureCache:{}}},{"../const":39,"./pluginTarget":110,eventemitter3:26}],109:[function(t,e,r){var i=t("ismobilejs"),n=function(t){return i.tablet||i.phone?2:t};e.exports=n},{ismobilejs:27}],110:[function(t,e,r){function i(t){t.__plugins={},t.registerPlugin=function(e,r){t.__plugins[e]=r},t.prototype.initPlugins=function(){this.plugins=this.plugins||{};for(var e in t.__plugins)this.plugins[e]=new t.__plugins[e](this)},t.prototype.destroyPlugins=function(){for(var t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null;this.plugins=null}}e.exports={mixin:function(t){i(t)}}},{}],111:[function(t,e,r){var i=t("./core"),n=t("./mesh"),o=t("./particles"),s=t("./extras"),a=t("./filters");i.SpriteBatch=function(){throw new ReferenceError("SpriteBatch does not exist any more, please use the new ParticleContainer instead.")},i.AssetLoader=function(){throw new ReferenceError("The loader system was overhauled in pixi v3, please see the new PIXI.loaders.Loader class.")},Object.defineProperties(i,{Stage:{get:function(){return console.warn("You do not need to use a PIXI Stage any more, you can simply render any container."),i.Container}},DisplayObjectContainer:{get:function(){return console.warn("DisplayObjectContainer has been shortened to Container, please use Container from now on."),i.Container}},Strip:{get:function(){return console.warn("The Strip class has been renamed to Mesh and moved to mesh.Mesh, please use mesh.Mesh from now on."),n.Mesh}},Rope:{get:function(){return console.warn("The Rope class has been moved to mesh.Rope, please use mesh.Rope from now on."),n.Rope}},ParticleContainer:{get:function(){return console.warn("The ParticleContainer class has been moved to particles.ParticleContainer, please use particles.ParticleContainer from now on."),o.ParticleContainer}},MovieClip:{get:function(){return console.warn("The MovieClip class has been moved to extras.MovieClip, please use extras.MovieClip from now on."),s.MovieClip}},TilingSprite:{get:function(){return console.warn("The TilingSprite class has been moved to extras.TilingSprite, please use extras.TilingSprite from now on."),s.TilingSprite}},BitmapText:{get:function(){return console.warn("The BitmapText class has been moved to extras.BitmapText, please use extras.BitmapText from now on."),s.BitmapText}},blendModes:{get:function(){return console.warn("The blendModes has been moved to BLEND_MODES, please use BLEND_MODES from now on."),i.BLEND_MODES}},scaleModes:{get:function(){return console.warn("The scaleModes has been moved to SCALE_MODES, please use SCALE_MODES from now on."),i.SCALE_MODES}},BaseTextureCache:{get:function(){return console.warn("The BaseTextureCache class has been moved to utils.BaseTextureCache, please use utils.BaseTextureCache from now on."),i.utils.BaseTextureCache}},TextureCache:{get:function(){return console.warn("The TextureCache class has been moved to utils.TextureCache, please use utils.TextureCache from now on."),i.utils.TextureCache}},math:{get:function(){return console.warn("The math namespace is deprecated, please access members already accessible on PIXI."),i}},AbstractFilter:{get:function(){return console.warn("AstractFilter has been renamed to Filter, please use PIXI.Filter"),i.Filter}}}),i.DisplayObject.prototype.generateTexture=function(t,e,r){return console.warn("generateTexture has moved to the renderer, please use renderer.generateTexture(displayObject)"),t.generateTexture(t,e,r)},i.Graphics.prototype.generateTexture=function(t,e){return console.warn("graphics generate texture has moved to the renderer. Or to render a graphics to a texture using canvas please use generateCanvasTexture"),this.generateCanvasTexture(t,e)},i.RenderTexture.prototype.render=function(t){this.legacyRenderer.render(t,this),console.warn("RenderTexture.render is now deprecated, please use renderer.render(displayObject, renderTexture)")},i.RenderTexture.prototype.getImage=function(t){return console.warn("RenderTexture.getImage is now deprecated, please use renderer.extract.image(target)"),this.legacyRenderer.extract.image(t)},i.RenderTexture.prototype.getBase64=function(t){console.warn("RenderTexture.getBase64 is now deprecated, please use renderer.extract.base64(target)"),this.legacyRenderer.extract.base64(t)},i.RenderTexture.prototype.getCanvas=function(t){console.warn("RenderTexture.getCanvas is now deprecated, please use renderer.extract.canvas(target)"),this.legacyRenderer.extract.canvas(t)},i.RenderTexture.prototype.getPixels=function(t){console.warn("RenderTexture.getPixels is now deprecated, please use renderer.extract.pixels(target)"),this.legacyRenderer.pixels(t)},i.Sprite.prototype.setTexture=function(t){this.texture=t,console.warn("setTexture is now deprecated, please use the texture property, e.g : sprite.texture = texture;")},s.BitmapText.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myBitmapText.text = 'my text';")},i.Text.prototype.setText=function(t){this.text=t,console.warn("setText is now deprecated, please use the text property, e.g : myText.text = 'my text';")},i.Text.prototype.setStyle=function(t){this.style=t,console.warn("setStyle is now deprecated, please use the style property, e.g : myText.style = style;")},i.Texture.prototype.setFrame=function(t){this.frame=t,console.warn("setFrame is now deprecated, please use the frame property, e.g : myTexture.frame = frame;")},Object.defineProperties(a,{AbstractFilter:{get:function(){return console.warn("AstractFilter has been renamed to Filter, please use PIXI.Filter"),i.AbstractFilter}},FXAAFilter:{get:function(){return console.warn("filters.FXAAFilter is an undocumented alias, please use FXAAFilter from now on."),i.FXAAFilter}},SpriteMaskFilter:{get:function(){return console.warn("filters.SpriteMaskFilter is an undocumented alias, please use SpriteMaskFilter from now on."),i.SpriteMaskFilter}}}),i.utils.uuid=function(){return console.warn("utils.uuid() is deprecated, please use utils.uid() from now on."),i.utils.uid()},i.utils.canUseNewCanvasBlendModes=function(){return console.warn("utils.canUseNewCanvasBlendModes() is deprecated, please use CanvasTinter.canUseMultiply from now on"),i.CanvasTinter.canUseMultiply}},{"./core":57,"./extras":121,"./filters":133,"./mesh":148,"./particles":151}],112:[function(t,e,r){function i(t){this.renderer=t,t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer;t&&(s=t instanceof n.RenderTexture?t:a.generateTexture(t)),s?(e=s.baseTexture._canvasRenderTarget.context,r=s.baseTexture._canvasRenderTarget.resolution,i=s.frame):(e=a.rootContext,r=a.rootResolution,i=o,i.width=this.renderer.width,i.height=this.renderer.height);var h=i.width*r,u=i.height*r,l=new n.CanvasRenderTarget(h,u),c=e.getImageData(i.x*r,i.y*r,h,u);return l.context.putImageData(c,0,0),l.canvas},i.prototype.pixels=function(t){var e,r,i,n=this.renderer;return t?(e=t.baseTexture._canvasRenderTarget.context,r=t.baseTexture._canvasRenderTarget.resolution,i=t.frame):(e=n.rootContext,r=n.rootResolution,i=o,i.width=n.width,i.height=n.height),e.getImageData(0,0,i.width*r,i.height*r).data},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.CanvasRenderer.registerPlugin("extract",i)},{"../../core":57}],113:[function(t,e,r){e.exports={webGL:t("./webgl/WebGLExtract"),canvas:t("./canvas/CanvasExtract")}},{"./canvas/CanvasExtract":112,"./webgl/WebGLExtract":114}],114:[function(t,e,r){function i(t){this.renderer=t,t.extract=this}var n=t("../../core"),o=new n.Rectangle;i.prototype.constructor=i,e.exports=i,i.prototype.image=function(t){var e=new Image;return e.src=this.base64(t),e},i.prototype.base64=function(t){return this.canvas(t).toDataURL()},i.prototype.canvas=function(t){var e,r,i,s,a=this.renderer,h=!1;t&&(s=t instanceof n.RenderTexture?t:this.renderer.generateTexture(t)),s?(e=s.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=s.frame,h=!1):(e=this.renderer.rootRenderTarget,r=e.resolution,h=!0,i=o,i.width=e.size.width,i.height=e.size.height);var u=i.width*r,l=i.height*r,c=new n.CanvasRenderTarget(u,l);if(e){a.bindRenderTarget(e);var p=new Uint8Array(4*u*l),d=a.gl;d.readPixels(i.x*r,i.y*r,u,l,d.RGBA,d.UNSIGNED_BYTE,p);var f=c.context.getImageData(0,0,u,l);f.data.set(p),c.context.putImageData(f,0,0),h&&(c.context.scale(1,-1),c.context.drawImage(c.canvas,0,-l))}return c.canvas},i.prototype.pixels=function(t){var e,r,i,n=this.renderer;t?(e=t.baseTexture._glRenderTargets[this.renderer.CONTEXT_UID],r=e.resolution,i=t.frame):(e=this.renderer.rootRenderTarget,r=e.resolution,i=o,i.width=e.size.width,i.height=e.size.height);var s=i.width*r,a=i.height*r,h=new Uint8Array(4*s*a);if(e){n.bindRenderTarget(e);var u=n.gl;u.readPixels(i.x*r,i.y*r,s,a,u.RGBA,u.UNSIGNED_BYTE,h)}return h},i.prototype.destroy=function(){this.renderer.extract=null,this.renderer=null},n.WebGLRenderer.registerPlugin("extract",i)},{"../../core":57}],115:[function(t,e,r){function i(t,e){n.Container.call(this),e=e||{},this.textWidth=0,this.textHeight=0,this._glyphs=[],this._font={tint:void 0!==e.tint?e.tint:16777215,align:e.align||"left",name:null,size:0},this.font=e.font,this._text=t,this.maxWidth=0,this.maxLineHeight=0,this.dirty=!1,this.updateText()}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{tint:{get:function(){return this._font.tint},set:function(t){this._font.tint="number"==typeof t&&t>=0?t:16777215,this.dirty=!0}},align:{get:function(){return this._font.align},set:function(t){this._font.align=t||"left",this.dirty=!0}},font:{get:function(){return this._font},set:function(t){t&&("string"==typeof t?(t=t.split(" "),this._font.name=1===t.length?t[0]:t.slice(1).join(" "),this._font.size=t.length>=2?parseInt(t[0],10):i.fonts[this._font.name].size):(this._font.name=t.name,this._font.size="number"==typeof t.size?t.size:parseInt(t.size,10)),this.dirty=!0)}},text:{get:function(){return this._text},set:function(t){t=t.toString()||" ",this._text!==t&&(this._text=t,this.dirty=!0)}}}),i.prototype.updateText=function(){for(var t=i.fonts[this._font.name],e=new n.Point,r=null,o=[],s=0,a=0,h=[],u=0,l=this._font.size/t.size,c=-1,p=0,d=0;d0&&e.x*l>this.maxWidth)n.utils.removeItems(o,c,d-c),d=c,c=-1,h.push(s),a=Math.max(a,s),u++,e.x=0,e.y+=t.lineHeight,r=null;else{var v=t.chars[f];v&&(r&&v.kerning[r]&&(e.x+=v.kerning[r]),o.push({texture:v.texture,line:u,charCode:f,position:new n.Point(e.x+v.xOffset,e.y+v.yOffset)}),s=e.x+(v.texture.width+v.xOffset),e.x+=v.xAdvance,p=Math.max(p,v.yOffset+v.texture.height),r=f)}}h.push(s),a=Math.max(a,s);var g=[];for(d=0;u>=d;d++){var y=0;"right"===this._font.align?y=a-h[d]:"center"===this._font.align&&(y=(a-h[d])/2),g.push(y)}var x=o.length,m=this.tint;for(d=0;x>d;d++){var T=this._glyphs[d];T?T.texture=o[d].texture:(T=new n.Sprite(o[d].texture),this._glyphs.push(T)),T.position.x=(o[d].position.x+g[o[d].line])*l,T.position.y=o[d].position.y*l,T.scale.x=T.scale.y=l,T.tint=m,T.parent||this.addChild(T)}for(d=x;dt&&(t+=this._textures.length),t}}}),i.prototype.stop=function(){this.playing&&(this.playing=!1,n.ticker.shared.remove(this.update,this))},i.prototype.play=function(){this.playing||(this.playing=!0,n.ticker.shared.add(this.update,this))},i.prototype.gotoAndStop=function(t){this.stop(),this._currentTime=t,this._texture=this._textures[this.currentFrame]},i.prototype.gotoAndPlay=function(t){this._currentTime=t,this.play()},i.prototype.update=function(t){var e=this.animationSpeed*t;if(null!==this._durations){var r=this._currentTime%1*this._durations[this.currentFrame];for(r+=e/60*1e3;0>r;)this._currentTime--,r+=this._durations[this.currentFrame];var i=Math.sign(this.animationSpeed*t);for(this._currentTime=Math.floor(this._currentTime);r>=this._durations[this.currentFrame];)r-=this._durations[this.currentFrame]*i,this._currentTime+=i;this._currentTime+=r/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):this._texture=this._textures[this.currentFrame]},i.prototype.destroy=function(){this.stop(),n.Sprite.prototype.destroy.call(this)},i.fromFrames=function(t){for(var e=[],r=0;rm?m:t,t=t>b?b:t,t=t>w?w:t,r=x,r=r>T?T:r,r=r>_?_:r,r=r>E?E:r,e=y,e=m>e?m:e,e=b>e?b:e,e=w>e?w:e,i=x,i=T>i?T:i,i=_>i?_:i,i=E>i?E:i;var S=this._bounds;return S.x=t,S.width=e-t,S.y=r,S.height=i-r,this._currentBounds=S,S},i.prototype.containsPoint=function(t){this.worldTransform.applyInverse(t,o);var e,r=this._width,i=this._height,n=-r*this.anchor.x;return o.x>n&&o.xe&&o.yu;u++){var l=h.replace("%index%",u);e=u,u>=o&&(e=t-u-1),l=l.replace("%value%",r[e]),a+=l,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=o},{}],127:[function(t,e,r){var i=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform float strength;","uniform mat3 projectionMatrix;","varying vec2 vBlurTexCoords[%size%];","void main(void)","{","gl_Position = vec4((projectionMatrix * vec3((aVertexPosition), 1.0)).xy, 0.0, 1.0);","%blur%","}"].join("\n"),n=function(t,e){var r,n,o=Math.ceil(t/2),s=i,a="";r=e?"vBlurTexCoords[%index%] = aTextureCoord + vec2(%samlpeIndex% * strength, 0.0);":"vBlurTexCoords[%index%] = aTextureCoord + vec2(0.0, %samlpeIndex% * strength);";for(var h=0;t>h;h++){var u=r.replace("%index%",h);n=h,h>=o&&(n=t-h-1),u=u.replace("%samlpeIndex%",h-(o-1)+".0"),a+=u,a+="\n"}return s=s.replace("%blur%",a),s=s.replace("%size%",t)};e.exports=n},{}],128:[function(t,e,r){var i=function(t){for(var e=t.getParameter(t.MAX_VARYING_VECTORS)/2|0,r=15;r>e;)r-=2;return r};e.exports=i},{}],129:[function(t,e,r){function i(){n.Filter.call(this,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\n\nvoid main(void)\n{\n\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n gl_FragColor.r = (m[0] * c.r);\n gl_FragColor.r += (m[1] * c.g);\n gl_FragColor.r += (m[2] * c.b);\n gl_FragColor.r += (m[3] * c.a);\n gl_FragColor.r += m[4] * c.a;\n\n gl_FragColor.g = (m[5] * c.r);\n gl_FragColor.g += (m[6] * c.g);\n gl_FragColor.g += (m[7] * c.b);\n gl_FragColor.g += (m[8] * c.a);\n gl_FragColor.g += m[9] * c.a;\n\n gl_FragColor.b = (m[10] * c.r);\n gl_FragColor.b += (m[11] * c.g);\n gl_FragColor.b += (m[12] * c.b);\n gl_FragColor.b += (m[13] * c.a);\n gl_FragColor.b += m[14] * c.a;\n\n gl_FragColor.a = (m[15] * c.r);\n gl_FragColor.a += (m[16] * c.g);\n gl_FragColor.a += (m[17] * c.b);\n gl_FragColor.a += (m[18] * c.a);\n gl_FragColor.a += m[19] * c.a;\n\n// gl_FragColor = vec4(m[0]);\n}\n"),this.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype._loadMatrix=function(t,e){e=!!e;var r=t;e&&(this._multiply(r,this.uniforms.m,t),r=this._colorMatrix(r)),this.uniforms.m=r},i.prototype._multiply=function(t,e,r){return t[0]=e[0]*r[0]+e[1]*r[5]+e[2]*r[10]+e[3]*r[15],t[1]=e[0]*r[1]+e[1]*r[6]+e[2]*r[11]+e[3]*r[16],t[2]=e[0]*r[2]+e[1]*r[7]+e[2]*r[12]+e[3]*r[17],t[3]=e[0]*r[3]+e[1]*r[8]+e[2]*r[13]+e[3]*r[18],t[4]=e[0]*r[4]+e[1]*r[9]+e[2]*r[14]+e[3]*r[19],t[5]=e[5]*r[0]+e[6]*r[5]+e[7]*r[10]+e[8]*r[15],t[6]=e[5]*r[1]+e[6]*r[6]+e[7]*r[11]+e[8]*r[16],t[7]=e[5]*r[2]+e[6]*r[7]+e[7]*r[12]+e[8]*r[17],t[8]=e[5]*r[3]+e[6]*r[8]+e[7]*r[13]+e[8]*r[18],t[9]=e[5]*r[4]+e[6]*r[9]+e[7]*r[14]+e[8]*r[19],t[10]=e[10]*r[0]+e[11]*r[5]+e[12]*r[10]+e[13]*r[15],t[11]=e[10]*r[1]+e[11]*r[6]+e[12]*r[11]+e[13]*r[16],t[12]=e[10]*r[2]+e[11]*r[7]+e[12]*r[12]+e[13]*r[17],t[13]=e[10]*r[3]+e[11]*r[8]+e[12]*r[13]+e[13]*r[18],t[14]=e[10]*r[4]+e[11]*r[9]+e[12]*r[14]+e[13]*r[19],t[15]=e[15]*r[0]+e[16]*r[5]+e[17]*r[10]+e[18]*r[15],t[16]=e[15]*r[1]+e[16]*r[6]+e[17]*r[11]+e[18]*r[16],t[17]=e[15]*r[2]+e[16]*r[7]+e[17]*r[12]+e[18]*r[17],t[18]=e[15]*r[3]+e[16]*r[8]+e[17]*r[13]+e[18]*r[18],t[19]=e[15]*r[4]+e[16]*r[9]+e[17]*r[14]+e[18]*r[19],t},i.prototype._colorMatrix=function(t){var e=new Float32Array(t);return e[4]/=255,e[9]/=255,e[14]/=255,e[19]/=255,e},i.prototype.brightness=function(t,e){var r=[t,0,0,0,0,0,t,0,0,0,0,0,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.greyscale=function(t,e){var r=[t,t,t,0,0,t,t,t,0,0,t,t,t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.grayscale=i.prototype.greyscale,i.prototype.blackAndWhite=function(t){var e=[.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.hue=function(t,e){t=(t||0)/180*Math.PI;var r=Math.cos(t),i=Math.sin(t),n=.213,o=.715,s=.072,a=[n+r*(1-n)+i*-n,o+r*-o+i*-o,s+r*-s+i*(1-s),0,0,n+r*-n+.143*i,o+r*(1-o)+.14*i,s+r*-s+i*-.283,0,0,n+r*-n+i*-(1-n),o+r*-o+i*o,s+r*(1-s)+i*s,0,0,0,0,0,1,0];this._loadMatrix(a,e)},i.prototype.contrast=function(t,e){var r=(t||0)+1,i=-128*(r-1),n=[r,0,0,0,i,0,r,0,0,i,0,0,r,0,i,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.saturate=function(t,e){var r=2*(t||0)/3+1,i=(r-1)*-.5,n=[r,i,i,0,0,i,r,i,0,0,i,i,r,0,0,0,0,0,1,0];this._loadMatrix(n,e)},i.prototype.desaturate=function(t){this.saturate(-1)},i.prototype.negative=function(t){var e=[0,1,1,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.sepia=function(t){var e=[.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.technicolor=function(t){var e=[1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.polaroid=function(t){var e=[1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.toBGR=function(t){var e=[0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.kodachrome=function(t){var e=[1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.browni=function(t){var e=[.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.vintage=function(t){var e=[.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.colorTone=function(t,e,r,i,n){t=t||.2,e=e||.15,r=r||16770432,i=i||3375104;var o=(r>>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,h=(i>>16&255)/255,u=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t,0,h,u,l,e,0,o-h,s-u,a-l,0,0];this._loadMatrix(c,n)},i.prototype.night=function(t,e){t=t||.1;var r=[-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},i.prototype.lsd=function(t){var e=[2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0];this._loadMatrix(e,t)},i.prototype.reset=function(){var t=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0];this._loadMatrix(t,!1)},Object.defineProperties(i.prototype,{matrix:{get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}}})},{"../../core":57}],130:[function(t,e,r){function i(t,e){var r=new n.Matrix;t.renderable=!1,n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMapCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vMapCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec2 scale;\n\nuniform sampler2D uSampler;\nuniform sampler2D mapSampler;\n\nvoid main(void)\n{\n vec4 map = texture2D(mapSampler, vMapCoord);\n\n map -= 0.5;\n map.xy *= scale;\n\n gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x + map.x, vTextureCoord.y + map.y));\n}\n"),this.maskSprite=t,this.maskMatrix=r,this.uniforms.mapSampler=t.texture,this.uniforms.otherMatrix=r.toArray(!0),this.uniforms.scale={x:1,y:1},null!==e&&void 0!==e||(e=20),this.scale=new n.Point(e,e)}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r){var i=1/r.destinationFrame.width*(r.size.width/e.size.width);this.uniforms.otherMatrix=t.calculateSpriteMatrix(this.maskMatrix,this.maskSprite),this.uniforms.scale.x=this.scale.x*i,this.uniforms.scale.y=this.scale.y*i,t.applyFilter(this,e,r)},Object.defineProperties(i.prototype,{map:{get:function(){return this.uniforms.mapSampler},set:function(t){this.uniforms.mapSampler=t}}})},{"../../core":57}],131:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\nuniform float exposure;\nuniform float decay;\nuniform float density;\nuniform float weight;\nuniform vec2 lightPositionOnScreen;\nuniform sampler2D uSampler;\n\nconst int NUM_SAMPLES = 100;\n\nvoid main()\n{\n vec2 deltaTextCoord = vec2( vTextureCoord - lightPositionOnScreen.xy );\n vec2 textCoo = vTextureCoord;\n deltaTextCoord *= 1.0 / float(NUM_SAMPLES) * density;\n float illuminationDecay = 1.0;\n \n for(int i=0; i < NUM_SAMPLES ; i++)\n {\n textCoo -= deltaTextCoord;\n vec4 sample = texture2D(uSampler, textCoo );\n\n sample *= illuminationDecay * weight;\n\n gl_FragColor += sample;\n\n illuminationDecay *= decay;\n }\n \n gl_FragColor *= exposure;\n}"),this.uniforms.exposure=.0034,this.uniforms.decay=1,this.uniforms.density=.84,this.uniforms.weight=5.65,this.uniforms.lightPositionOnScreen[0]=.5,this.uniforms.lightPositionOnScreen[1]=.5}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":57}],132:[function(t,e,r){function i(){n.Filter.call(this,"precision lowp float;\n#define GLSLIFY 1\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float gray;\n\nvoid main(void)\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(0.2126*gl_FragColor.r + 0.7152*gl_FragColor.g + 0.0722*gl_FragColor.b), gray);\n}\n"),this.uniforms.gray=1,this.glShaderKey="gray"}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,Object.defineProperties(i.prototype,{gray:{get:function(){return this.uniforms.gray},set:function(t){this.uniforms.gray=t}}})},{"../../core":57}],133:[function(t,e,r){e.exports={DisplacementFilter:t("./displacement/DisplacementFilter"),BlurFilter:t("./blur/BlurFilter"),BlurXFilter:t("./blur/BlurXFilter"),BlurYFilter:t("./blur/BlurYFilter"),ColorMatrixFilter:t("./colormatrix/ColorMatrixFilter"),TwistFilter:t("./twist/TwistFilter"),GrayFilter:t("./gray/GrayFilter"),GodrayFilter:t("./godray/GodrayFilter")}},{"./blur/BlurFilter":123,"./blur/BlurXFilter":124,"./blur/BlurYFilter":125,"./colormatrix/ColorMatrixFilter":129,"./displacement/DisplacementFilter":130,"./godray/GodrayFilter":131,"./gray/GrayFilter":132,"./twist/TwistFilter":134}],134:[function(t,e,r){function i(){n.Filter.call(this,"#define GLSLIFY 1\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}\n\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.uniforms.radius=400,this.uniforms.angle=3,this.uniforms.offset=[400,300],this.transform=new n.math.Matrix,this.padding=200}var n=t("../../core");i.prototype=Object.create(n.Filter.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.apply=function(t,e,r,i){t.applyFilter(this,e,r,i)},Object.defineProperties(i.prototype,{offset:{get:function(){return this.uniforms.offset},set:function(t){this.uniforms.offset=t}},radius:{get:function(){return this.uniforms.radius},set:function(t){this.uniforms.radius=t}},angle:{get:function(){return this.uniforms.angle},set:function(t){this.uniforms.angle=t}}})},{"../../core":57}],135:[function(t,e,r){(function(r){t("./polyfill");var i=e.exports=t("./core");i.extras=t("./extras"),i.filters=t("./filters"),i.interaction=t("./interaction"),i.loaders=t("./loaders"),i.mesh=t("./mesh"),i.particles=t("./particles"),i.accessibility=t("./accessibility"),i.extract=t("./extract"),i.loader=new i.loaders.Loader,Object.assign(i,t("./deprecation")),r.PIXI=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":38,"./core":57,"./deprecation":111,"./extract":113,"./extras":121,"./filters":133,"./interaction":138,"./loaders":141,"./mesh":148,"./particles":151,"./polyfill":157}],136:[function(t,e,r){function i(){this.global=new n.Point,this.target=null,this.originalEvent=null}var n=t("../core");i.prototype.constructor=i,e.exports=i,i.prototype.getLocalPosition=function(t,e,r){return t.worldTransform.applyInverse(r||this.global,e)}},{"../core":57}],137:[function(t,e,r){function i(t,e){e=e||{},this.renderer=t,this.autoPreventDefault=void 0!==e.autoPreventDefault?e.autoPreventDefault:!0,this.interactionFrequency=e.interactionFrequency||10,this.mouse=new o,this.eventData={stopped:!1,target:null,type:null,data:this.mouse,stopPropagation:function(){this.stopped=!0}},this.interactiveDataPool=[],this.interactionDOMElement=null,this.moveWhenInside=!1,this.eventsAdded=!1,this.onMouseUp=this.onMouseUp.bind(this),this.processMouseUp=this.processMouseUp.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.processMouseDown=this.processMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.processMouseMove=this.processMouseMove.bind(this),this.onMouseOut=this.onMouseOut.bind(this),this.processMouseOverOut=this.processMouseOverOut.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.processTouchStart=this.processTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.processTouchEnd=this.processTouchEnd.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.processTouchMove=this.processTouchMove.bind(this),this.last=0,this.defaultCursorStyle="inherit",this.currentCursorStyle="inherit",this._tempPoint=new n.Point,this.resolution=1,this.setTargetElement(this.renderer.view,this.renderer.resolution)}var n=t("../core"),o=t("./InteractionData");Object.assign(n.DisplayObject.prototype,t("./interactiveTarget")),i.prototype.constructor=i,e.exports=i,i.prototype.setTargetElement=function(t,e){this.removeEvents(),this.interactionDOMElement=t,this.resolution=e||1,this.addEvents()},i.prototype.addEvents=function(){this.interactionDOMElement&&(n.ticker.shared.add(this.update,this),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="none",this.interactionDOMElement.style["-ms-touch-action"]="none"),window.document.addEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.addEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.addEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.addEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.addEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.addEventListener("touchmove",this.onTouchMove,!0),window.addEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!0)},i.prototype.removeEvents=function(){this.interactionDOMElement&&(n.ticker.shared.remove(this.update),window.navigator.msPointerEnabled&&(this.interactionDOMElement.style["-ms-content-zooming"]="",this.interactionDOMElement.style["-ms-touch-action"]=""),window.document.removeEventListener("mousemove",this.onMouseMove,!0),this.interactionDOMElement.removeEventListener("mousedown",this.onMouseDown,!0),this.interactionDOMElement.removeEventListener("mouseout",this.onMouseOut,!0),this.interactionDOMElement.removeEventListener("touchstart",this.onTouchStart,!0),this.interactionDOMElement.removeEventListener("touchend",this.onTouchEnd,!0),this.interactionDOMElement.removeEventListener("touchmove",this.onTouchMove,!0),this.interactionDOMElement=null,window.removeEventListener("mouseup",this.onMouseUp,!0),this.eventsAdded=!1)},i.prototype.update=function(t){if(this._deltaTime+=t,!(this._deltaTime=0;h--){var u=a[h];if(this.processInteractive(t,u,r,i,s)){if(!u.parent)continue;o=!0,s=!1,i=!1}}return n&&(i&&!o&&(e.hitArea?(e.worldTransform.applyInverse(t,this._tempPoint),o=e.hitArea.contains(this._tempPoint.x,this._tempPoint.y)):e.containsPoint&&(o=e.containsPoint(t))),e.interactive&&r(e,o)),o},i.prototype.onMouseDown=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.autoPreventDefault&&this.mouse.originalEvent.preventDefault(),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseDown,!0)},i.prototype.processMouseDown=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which;e&&(t[i?"_isRightDown":"_isLeftDown"]=!0,this.dispatchEvent(t,i?"rightdown":"mousedown",this.eventData))},i.prototype.onMouseUp=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseUp,!0)},i.prototype.processMouseUp=function(t,e){var r=this.mouse.originalEvent,i=2===r.button||3===r.which,n=i?"_isRightDown":"_isLeftDown";e?(this.dispatchEvent(t,i?"rightup":"mouseup",this.eventData),t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightclick":"click",this.eventData))):t[n]&&(t[n]=!1,this.dispatchEvent(t,i?"rightupoutside":"mouseupoutside",this.eventData))},i.prototype.onMouseMove=function(t){this.mouse.originalEvent=t,this.eventData.data=this.mouse,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.didMove=!0,this.cursor=this.defaultCursorStyle,this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseMove,!0),this.currentCursorStyle!==this.cursor&&(this.currentCursorStyle=this.cursor,this.interactionDOMElement.style.cursor=this.cursor)},i.prototype.processMouseMove=function(t,e){this.processMouseOverOut(t,e),this.moveWhenInside&&!e||this.dispatchEvent(t,"mousemove",this.eventData)},i.prototype.onMouseOut=function(t){this.mouse.originalEvent=t,this.eventData.stopped=!1,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.interactionDOMElement.style.cursor=this.defaultCursorStyle,this.mapPositionToPoint(this.mouse.global,t.clientX,t.clientY),this.processInteractive(this.mouse.global,this.renderer._lastObjectRendered,this.processMouseOverOut,!1)},i.prototype.processMouseOverOut=function(t,e){e?(t._over||(t._over=!0,this.dispatchEvent(t,"mouseover",this.eventData)),t.buttonMode&&(this.cursor=t.defaultCursor)):t._over&&(t._over=!1,this.dispatchEvent(t,"mouseout",this.eventData))},i.prototype.onTouchStart=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchStart,!0),this.returnTouchData(o)}},i.prototype.processTouchStart=function(t,e){e&&(t._touchDown=!0,this.dispatchEvent(t,"touchstart",this.eventData))},i.prototype.onTouchEnd=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchEnd,!0),this.returnTouchData(o)}},i.prototype.processTouchEnd=function(t,e){e?(this.dispatchEvent(t,"touchend",this.eventData),t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"tap",this.eventData))):t._touchDown&&(t._touchDown=!1,this.dispatchEvent(t,"touchendoutside",this.eventData)); +},i.prototype.onTouchMove=function(t){this.autoPreventDefault&&t.preventDefault();for(var e=t.changedTouches,r=e.length,i=0;r>i;i++){var n=e[i],o=this.getTouchData(n);o.originalEvent=t,this.eventData.data=o,this.eventData.stopped=!1,this.processInteractive(o.global,this.renderer._lastObjectRendered,this.processTouchMove,this.moveWhenInside),this.returnTouchData(o)}},i.prototype.processTouchMove=function(t,e){this.moveWhenInside&&!e||this.dispatchEvent(t,"touchmove",this.eventData)},i.prototype.getTouchData=function(t){var e=this.interactiveDataPool.pop();return e||(e=new o),e.identifier=t.identifier,this.mapPositionToPoint(e.global,t.clientX,t.clientY),navigator.isCocoonJS&&(e.global.x=e.global.x/this.resolution,e.global.y=e.global.y/this.resolution),t.globalX=e.global.x,t.globalY=e.global.y,e},i.prototype.returnTouchData=function(t){this.interactiveDataPool.push(t)},i.prototype.destroy=function(){this.removeEvents(),this.renderer=null,this.mouse=null,this.eventData=null,this.interactiveDataPool=null,this.interactionDOMElement=null,this.onMouseUp=null,this.processMouseUp=null,this.onMouseDown=null,this.processMouseDown=null,this.onMouseMove=null,this.processMouseMove=null,this.onMouseOut=null,this.processMouseOverOut=null,this.onTouchStart=null,this.processTouchStart=null,this.onTouchEnd=null,this.processTouchEnd=null,this.onTouchMove=null,this.processTouchMove=null,this._tempPoint=null},n.WebGLRenderer.registerPlugin("interaction",i),n.CanvasRenderer.registerPlugin("interaction",i)},{"../core":57,"./InteractionData":136,"./interactiveTarget":139}],138:[function(t,e,r){e.exports={InteractionData:t("./InteractionData"),InteractionManager:t("./InteractionManager"),interactiveTarget:t("./interactiveTarget")}},{"./InteractionData":136,"./InteractionManager":137,"./interactiveTarget":139}],139:[function(t,e,r){var i={interactive:!1,buttonMode:!1,interactiveChildren:!0,defaultCursor:"pointer",_over:!1,_touchDown:!1};e.exports=i},{}],140:[function(t,e,r){function i(t,e){var r={},i=t.data.getElementsByTagName("info")[0],n=t.data.getElementsByTagName("common")[0];r.font=i.getAttribute("face"),r.size=parseInt(i.getAttribute("size"),10),r.lineHeight=parseInt(n.getAttribute("lineHeight"),10),r.chars={};for(var a=t.data.getElementsByTagName("char"),h=0;hn-e&&nn;n++){var o=2*n;this._renderCanvasDrawTriangle(t,e,r,o,o+2,o+4)}},i.prototype._renderCanvasTriangles=function(t){for(var e=this.vertices,r=this.uvs,i=this.indices,n=i.length,o=0;n>o;o+=3){var s=2*i[o],a=2*i[o+1],h=2*i[o+2];this._renderCanvasDrawTriangle(t,e,r,s,a,h)}},i.prototype._renderCanvasDrawTriangle=function(t,e,r,i,n,o){var s=this._texture.baseTexture,a=s.source,h=s.width,u=s.height,l=e[i],c=e[n],p=e[o],d=e[i+1],f=e[n+1],v=e[o+1],g=r[i]*s.width,y=r[n]*s.width,x=r[o]*s.width,m=r[i+1]*s.height,T=r[n+1]*s.height,b=r[o+1]*s.height;if(this.canvasPadding>0){var _=this.canvasPadding/this.worldTransform.a,w=this.canvasPadding/this.worldTransform.d,E=(l+c+p)/3,S=(d+f+v)/3,C=l-E,M=d-S,R=Math.sqrt(C*C+M*M);l=E+C/R*(R+_),d=S+M/R*(R+w),C=c-E,M=f-S,R=Math.sqrt(C*C+M*M),c=E+C/R*(R+_),f=S+M/R*(R+w),C=p-E,M=v-S,R=Math.sqrt(C*C+M*M),p=E+C/R*(R+_),v=S+M/R*(R+w)}t.save(),t.beginPath(),t.moveTo(l,d),t.lineTo(c,f),t.lineTo(p,v),t.closePath(),t.clip();var A=g*T+m*x+y*b-T*x-m*y-g*b,O=l*T+m*p+c*b-T*p-m*c-l*b,P=g*c+l*x+y*p-c*x-l*y-g*p,D=g*T*p+m*c*x+l*y*b-l*T*x-m*y*p-g*c*b,L=d*T+m*v+f*b-T*v-m*f-d*b,I=g*f+d*x+y*v-f*x-d*y-g*v,B=g*T*v+m*f*x+d*y*b-d*T*x-m*y*v-g*f*b;t.transform(O/A,L/A,P/A,I/A,D/A,B/A),t.drawImage(a,0,0,h*s.resolution,u*s.resolution,0,0,h,u),t.restore()},i.prototype.renderMeshFlat=function(t){var e=this.context,r=t.vertices,i=r.length/2;e.beginPath();for(var n=1;i-2>n;n++){var o=2*n,s=r[o],a=r[o+2],h=r[o+4],u=r[o+1],l=r[o+3],c=r[o+5];e.moveTo(s,u),e.lineTo(a,l),e.lineTo(h,c)}e.fillStyle="#FF0000",e.fill(),e.closePath()},i.prototype._onTextureUpdate=function(){this.updateFrame=!0},i.prototype.getBounds=function(t){if(!this._currentBounds){for(var e=t||this.worldTransform,r=e.a,i=e.b,o=e.c,s=e.d,a=e.tx,h=e.ty,u=-(1/0),l=-(1/0),c=1/0,p=1/0,d=this.vertices,f=0,v=d.length;v>f;f+=2){var g=d[f],y=d[f+1],x=r*g+o*y+a,m=s*y+i*g+h;c=c>x?x:c,p=p>m?m:p,u=x>u?x:u,l=m>l?m:l}if(c===-(1/0)||l===1/0)return n.Rectangle.EMPTY;var T=this._bounds;T.x=c,T.width=u-c,T.y=p,T.height=l-p,this._currentBounds=T}return this._currentBounds},i.prototype.containsPoint=function(t){if(!this.getBounds().contains(t.x,t.y))return!1;this.worldTransform.applyInverse(t,a);var e,r,n=this.vertices,o=h.points;if(this.drawMode===i.DRAW_MODES.TRIANGLES){var s=this.indices;for(r=this.indices.length,e=0;r>e;e+=3){var u=2*s[e],l=2*s[e+1],c=2*s[e+2];if(o[0]=n[u],o[1]=n[u+1],o[2]=n[l],o[3]=n[l+1],o[4]=n[c],o[5]=n[c+1],h.contains(a.x,a.y))return!0}}else for(r=n.length,e=0;r>e;e+=6)if(o[0]=n[e],o[1]=n[e+1],o[2]=n[e+2],o[3]=n[e+3],o[4]=n[e+4],o[5]=n[e+5],h.contains(a.x,a.y))return!0;return!1},i.DRAW_MODES={TRIANGLE_MESH:0,TRIANGLES:1}},{"../core":57,"./webgl/MeshShader":149,"pixi-gl-core":1}],146:[function(t,e,r){function i(t,e,r){n.call(this,t),this._ready=!0,this.segmentsX=e||10,this.segmentsY=r||10,this.drawMode=n.DRAW_MODES.TRIANGLES,this.refresh()}var n=t("./Mesh");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.segmentsX*this.segmentsY,e=[],r=[],i=[],n=[],o=this.texture,s=this.segmentsX-1,a=this.segmentsY-1,h=0,u=o.width/s,l=o.height/a;for(h=0;t>h;h++){var c=h%this.segmentsX,p=h/this.segmentsX|0;e.push(c*u,p*l),i.push(o._uvs.x0+(o._uvs.x1-o._uvs.x0)*(c/(this.segmentsX-1)),o._uvs.y0+(o._uvs.y3-o._uvs.y0)*(p/(this.segmentsY-1)))}var d=s*a;for(h=0;d>h;h++){var f=h%s,v=h/s|0,g=v*this.segmentsX+f,y=v*this.segmentsX+f+1,x=(v+1)*this.segmentsX+f,m=(v+1)*this.segmentsX+f+1;n.push(g,y,x),n.push(y,m,x)}this.vertices=new Float32Array(e),this.uvs=new Float32Array(i),this.colors=new Float32Array(r),this.indices=new Uint16Array(n),this.indexDirty=!0},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()}},{"./Mesh":145}],147:[function(t,e,r){function i(t,e){n.call(this,t),this.points=e,this.vertices=new Float32Array(4*e.length),this.uvs=new Float32Array(4*e.length),this.colors=new Float32Array(2*e.length),this.indices=new Uint16Array(2*e.length),this._ready=!0,this.refresh()}var n=t("./Mesh"),o=t("../core");i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.refresh=function(){var t=this.points;if(!(t.length<1)&&this._texture._uvs){var e=this.uvs,r=this.indices,i=this.colors,n=this._texture._uvs,s=new o.Point(n.x0,n.y0),a=new o.Point(n.x2-n.x0,n.y2-n.y0);e[0]=0+s.x,e[1]=0+s.y,e[2]=0+s.x,e[3]=1*a.y+s.y,i[0]=1,i[1]=1,r[0]=0,r[1]=1;for(var h,u,l,c=t.length,p=1;c>p;p++)h=t[p],u=4*p,l=p/(c-1),e[u]=l*a.x+s.x,e[u+1]=0+s.y,e[u+2]=l*a.x+s.x,e[u+3]=1*a.y+s.y,u=2*p,i[u]=1,i[u+1]=1,u=2*p,r[u]=u,r[u+1]=u+1;this.dirty=!0,this.indexDirty=!0}},i.prototype._onTextureUpdate=function(){n.prototype._onTextureUpdate.call(this),this._ready&&this.refresh()},i.prototype.updateTransform=function(){var t=this.points;if(!(t.length<1)){for(var e,r,i,n,o,s,a=t[0],h=0,u=0,l=this.vertices,c=t.length,p=0;c>p;p++)r=t[p],i=4*p,e=p1&&(n=1),o=Math.sqrt(h*h+u*u),s=this._texture.height/2,h/=o,u/=o,h*=s,u*=s,l[i]=r.x+h,l[i+1]=r.y+u,l[i+2]=r.x-h,l[i+3]=r.y-u,a=r;this.containerUpdateTransform()}}},{"../core":57,"./Mesh":145}],148:[function(t,e,r){e.exports={Mesh:t("./Mesh"),Plane:t("./Plane"),Rope:t("./Rope"),MeshShader:t("./webgl/MeshShader")}},{"./Mesh":145,"./Plane":146,"./Rope":147,"./webgl/MeshShader":149}],149:[function(t,e,r){function i(t){n.call(this,t,["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","uniform mat3 translationMatrix;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","void main(void){"," gl_Position = vec4((projectionMatrix * translationMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","uniform float alpha;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * alpha ;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],150:[function(t,e,r){function i(t,e,r){n.Container.call(this),r=r||15e3,t=t||15e3;var i=16384;r>i&&(r=i),r>t&&(r=t),this._properties=[!1,!0,!1,!1,!1],this._maxSize=t,this._batchSize=r,this._glBuffers=[],this._bufferToUpdate=0,this.interactiveChildren=!1,this.blendMode=n.BLEND_MODES.NORMAL,this.roundPixels=!0,this.baseTexture=null,this.setProperties(e)}var n=t("../core");i.prototype=Object.create(n.Container.prototype),i.prototype.constructor=i,e.exports=i,i.prototype.setProperties=function(t){t&&(this._properties[0]="scale"in t?!!t.scale:this._properties[0],this._properties[1]="position"in t?!!t.position:this._properties[1],this._properties[2]="rotation"in t?!!t.rotation:this._properties[2],this._properties[3]="uvs"in t?!!t.uvs:this._properties[3],this._properties[4]="alpha"in t?!!t.alpha:this._properties[4])},i.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},i.prototype.renderWebGL=function(t){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(this.baseTexture||(this.baseTexture=this.children[0]._texture.baseTexture,this.baseTexture.hasLoaded||this.baseTexture.once("update",function(){this.onChildrenChange(0)},this)),t.setObjectRenderer(t.plugins.particle),t.plugins.particle.render(this))},i.prototype.onChildrenChange=function(t){var e=Math.floor(t/this._batchSize);ei&&(r=i);var o=t._glBuffers[this.renderer.CONTEXT_UID];o||(o=t._glBuffers[this.renderer.CONTEXT_UID]=this.generateBuffers(t)),this.renderer.setBlendMode(t.blendMode);var s=this.renderer.gl,a=t.worldTransform.copy(this.tempMatrix);a.prepend(this.renderer._activeRenderTarget.projectionMatrix),this.shader.uniforms.projectionMatrix=a.toArray(!0),this.shader.uniforms.uAlpha=t.worldAlpha;var h=e[0]._texture.baseTexture;this.renderer.bindTexture(h);for(var u=0,l=0;r>u;u+=n,l+=1){var c=r-u;c>n&&(c=n);var p=o[l];p.uploadDynamic(e,u,c),t._bufferToUpdate===l&&(p.uploadStatic(e,u,c),t._bufferToUpdate=l+1),p.vao.bind().draw(s.TRIANGLES,6*c).unbind()}}},i.prototype.generateBuffers=function(t){var e,r=this.renderer.gl,i=[],n=t._maxSize,o=t._batchSize,a=t._properties;for(e=0;n>e;e+=o)i.push(new s(r,this.properties,a,o));return i},i.prototype.uploadVertices=function(t,e,r,i,n,o){for(var s,a,h,u,l,c,p,d,f,v,g=0;r>g;g++)s=t[e+g],a=s._texture,l=s.scale.x,c=s.scale.y,h=a.trim,u=a.orig,h?(d=h.x-s.anchor.x*u.width,p=d+h.width,v=h.y-s.anchor.y*u.height,f=v+h.height):(p=u.width*(1-s.anchor.x),d=u.width*-s.anchor.x,f=u.height*(1-s.anchor.y),v=u.height*-s.anchor.y),i[o]=d*l,i[o+1]=v*c,i[o+n]=p*l,i[o+n+1]=v*c,i[o+2*n]=p*l,i[o+2*n+1]=f*c,i[o+3*n]=d*l,i[o+3*n+1]=f*c,o+=4*n},i.prototype.uploadPosition=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].position;i[o]=a.x,i[o+1]=a.y,i[o+n]=a.x,i[o+n+1]=a.y,i[o+2*n]=a.x,i[o+2*n+1]=a.y,i[o+3*n]=a.x,i[o+3*n+1]=a.y,o+=4*n}},i.prototype.uploadRotation=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].rotation;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.uploadUvs=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s]._texture._uvs;a?(i[o]=a.x0,i[o+1]=a.y0,i[o+n]=a.x1,i[o+n+1]=a.y1,i[o+2*n]=a.x2,i[o+2*n+1]=a.y2,i[o+3*n]=a.x3,i[o+3*n+1]=a.y3,o+=4*n):(i[o]=0,i[o+1]=0,i[o+n]=0,i[o+n+1]=0,i[o+2*n]=0,i[o+2*n+1]=0,i[o+3*n]=0,i[o+3*n+1]=0,o+=4*n)}},i.prototype.uploadAlpha=function(t,e,r,i,n,o){for(var s=0;r>s;s++){var a=t[e+s].alpha;i[o]=a,i[o+n]=a,i[o+2*n]=a,i[o+3*n]=a,o+=4*n}},i.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),n.ObjectRenderer.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../core":57,"./ParticleBuffer":152,"./ParticleShader":154}],154:[function(t,e,r){function i(t){n.call(this,t,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"))}var n=t("pixi-gl-core").GLShader;i.prototype=Object.create(n.prototype),i.prototype.constructor=i,e.exports=i},{"pixi-gl-core":1}],155:[function(t,e,r){Math.sign||(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1})},{}],156:[function(t,e,r){Object.assign||(Object.assign=t("object-assign"))},{"object-assign":28}],157:[function(t,e,r){t("./Object.assign"),t("./requestAnimationFrame"),t("./Math.sign"),window.ArrayBuffer||(window.ArrayBuffer=Array),window.Float32Array||(window.Float32Array=Array),window.Uint32Array||(window.Uint32Array=Array),window.Uint16Array||(window.Uint16Array=Array)},{"./Math.sign":155,"./Object.assign":156,"./requestAnimationFrame":158}],158:[function(t,e,r){(function(t){if(Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),!t.performance||!t.performance.now){var e=Date.now();t.performance||(t.performance={}),t.performance.now=function(){return Date.now()-e}}for(var r=Date.now(),i=["ms","moz","webkit","o"],n=0;ni&&(i=0),r=e,setTimeout(function(){r=Date.now(),t(performance.now())},i)}),t.cancelAnimationFrame||(t.cancelAnimationFrame=function(t){clearTimeout(t)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[135])(135)}); //# sourceMappingURL=pixi.min.js.map \ No newline at end of file diff --git a/samples/_output/loader.js b/samples/_output/loader.js index fd8e12e3..4934ab78 100644 --- a/samples/_output/loader.js +++ b/samples/_output/loader.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/loader.js.map b/samples/_output/loader.js.map index f7bad85a..bb8847fc 100644 --- a/samples/_output/loader.js.map +++ b/samples/_output/loader.js.map @@ -3,7 +3,7 @@ "file":"loader.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/loader/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.loader;\n\nimport pixi.loaders.Loader;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _img:Sprite;\n\tvar _baseURL:String;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tsuper.start();\n\t\t_baseURL = \"assets/loader/\";\n\n\t\t_loader = new Loader();\n\t\t_loader.baseUrl = _baseURL;\n\n\t\tfor (i in 1 ... 10) _loader.add(\"img\" + i, i + \".png\");\n\t\t_loader.on(\"progress\", _onLoadProgress);\n\t\t_loader.load(_onLoaded);\n\t}\n\n\tfunction _onLoadProgress() {\n\t\ttrace(\"Loaded: \" + Math.round(_loader.progress));\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar _container:Container = new Container();\n\t\tstage.addChild(_container);\n\t\tfor (i in 1 ... 11) {\n\t\t\t_img = new Sprite(Texture.fromImage(_baseURL + i + \".png\"));\n\t\t\t_img.name = \"img\" + i;\n\t\t\tif (i < 6) _img.position.set(128 * (i - 1), 0);\n\t\t\telse _img.position.set(128 * (i - 6), 128);\n\t\t\t_container.addChild(_img);\n\t\t}\n\t\t_container.position.set((Browser.window.innerWidth - _container.width) / 2, (Browser.window.innerHeight - _container.height) / 2);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.loader;\n\nimport pixi.loaders.Loader;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _img:Sprite;\n\tvar _baseURL:String;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tsuper.start();\n\t\t_baseURL = \"assets/loader/\";\n\n\t\t_loader = new Loader();\n\t\t_loader.baseUrl = _baseURL;\n\n\t\tfor (i in 1 ... 10) _loader.add(\"img\" + i, i + \".png\");\n\t\t_loader.on(\"progress\", _onLoadProgress);\n\t\t_loader.load(_onLoaded);\n\t}\n\n\tfunction _onLoadProgress() {\n\t\ttrace(\"Loaded: \" + Math.round(_loader.progress));\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar _container:Container = new Container();\n\t\tstage.addChild(_container);\n\t\tfor (i in 1 ... 11) {\n\t\t\t_img = new Sprite(Texture.fromImage(_baseURL + i + \".png\"));\n\t\t\t_img.name = \"img\" + i;\n\t\t\tif (i < 6) _img.position.set(128 * (i - 1), 0);\n\t\t\telse _img.position.set(128 * (i - 6), 128);\n\t\t\t_container.addChild(_img);\n\t\t}\n\t\t_container.position.set((Browser.window.innerWidth - _container.width) / 2, (Browser.window.innerHeight - _container.height) / 2);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,AAAU,FAAS,AAAS;IACrC,DAAU,FAAS,AAAS;IAC5B,DAAS,FAAW,EAAY;;GAGjC,AAAiB,AAAU,AAAa,AAAO,AAAU,AAAM,AAAU;GAEzE,DAAI,EAAc,HAAI,EAA4B,GAC7C,JAAI,EAAc,H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AAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;sBC1OtE,XAAe;CACrB;CACA;;2BAgCM,hBACN;;;;;OA9BD,IAAiB;EAChB;EACA,CAAW;EAEX,CAAU;EACV,CAAkB;EAER;EAAV,CAAgB,FAAhB;;GAAoB,FAAY,EAAQ,FAAG,EAAI;;EAC/C,DAAW,AAAY;EACvB,DAAa;;iBAGd,NACC;YAAM,TAAa,FAAW;;WAG/B,AAAqB;EACO;EAC3B,DAAe;EACL;EAAV,CAAgB,FAAI;GAApB;GACC,AAAO,SAAW,XAAkB,EAAW,AAAI;GACnD,AAAY,AAAQ;GACpB,DAAI,CAAI,FAAG,AAAkB,EAAM,FAAC,EAAI,FAAI,KACvC,LAAkB,EAAM,FAAC,EAAI,FAAI;GACtC,FAAoB;;EAErB,DAAwB,AAAC,EAA4B,AAAoB,FAAG,AAAC,EAA6B,AAAqB;;;;;4BHxCnF;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/mask.js b/samples/_output/mask.js index e30000a7..179edd34 100644 --- a/samples/_output/mask.js +++ b/samples/_output/mask.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/mask.js.map b/samples/_output/mask.js.map index 7cc98465..80982e95 100644 --- a/samples/_output/mask.js.map +++ b/samples/_output/mask.js.map @@ -3,7 +3,7 @@ "file":"mask.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/mask/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.mask;\n\nimport pixi.core.graphics.Graphics;\nimport pixi.core.math.Point;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _cells:Sprite;\n\tvar _mask:Graphics;\n\tvar _target:Point;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.RECOMMENDED);\n\n\t\t_bg = Sprite.fromImage(\"assets/alphamask/bkg.jpg\");\n\n\t\tstage.addChild(_bg);\n\n\t\t_cells = Sprite.fromImage(\"assets/alphamask/cells.png\");\n\t\t_cells.scale.set(1.5);\n\n\t\t_mask = new Graphics();\n\t\t_mask.clear();\n\t\t_mask.beginFill(0x000000);\n\t\t_mask.drawRect(100, 100, 300, 200);\n\t\t_mask.endFill();\n\t\t_mask.cacheAsBitmap = true;\n\n\t\t_cells.mask = _mask;\n\n\t\tstage.addChild(_cells);\n\t\tstage.addChild(_mask);\n\n\t\t_target = new Point();\n\t\t_reset();\n\t}\n\n\tfunction _reset() {\n\t\t_target.x = Math.floor(Math.random() * 550);\n\t\t_target.y = Math.floor(Math.random() * 300);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_mask.position.x += (_target.x - _mask.x) * 0.1;\n\t\t_mask.position.y += (_target.y - _mask.y) * 0.1;\n\t\tif (Math.abs(_mask.x - _target.x) < 1) _reset();\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.mask;\n\nimport pixi.core.graphics.Graphics;\nimport pixi.core.math.Point;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _bg:Sprite;\n\tvar _cells:Sprite;\n\tvar _mask:Graphics;\n\tvar _target:Point;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.RECOMMENDED);\n\n\t\t_bg = Sprite.fromImage(\"assets/alphamask/bkg.jpg\");\n\n\t\tstage.addChild(_bg);\n\n\t\t_cells = Sprite.fromImage(\"assets/alphamask/cells.png\");\n\t\t_cells.scale.set(1.5);\n\n\t\t_mask = new Graphics();\n\t\t_mask.clear();\n\t\t_mask.beginFill(0x000000);\n\t\t_mask.drawRect(100, 100, 300, 200);\n\t\t_mask.endFill();\n\t\t_mask.cacheAsBitmap = true;\n\n\t\t_cells.mask = _mask;\n\n\t\tstage.addChild(_cells);\n\t\tstage.addChild(_mask);\n\n\t\t_target = new Point();\n\t\t_reset();\n\t}\n\n\tfunction _reset() {\n\t\t_target.x = Math.floor(Math.random() * 550);\n\t\t_target.y = Math.floor(Math.random() * 300);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_mask.position.x += (_target.x - _mask.x) * 0.1;\n\t\t_mask.position.y += (_target.y - _mask.y) * 0.1;\n\t\tif (Math.abs(_mask.x - _target.x) < 1) _reset();\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,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AY,FAAW,EAAgB;;WAGxC,WAAsC;EACrC,EAAoB,HAAC,EAAY,AAAW;EAC5C,EAAoB,HAAC,EAAY,AAAW;EAC5C,AAAI,DAAS,EAAU,AAAa,FAAG;;;;;4BHhDK;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/movieclip.js b/samples/_output/movieclip.js index c357ee1f..016d62a1 100644 --- a/samples/_output/movieclip.js +++ b/samples/_output/movieclip.js @@ -200,7 +200,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/movieclip.js.map b/samples/_output/movieclip.js.map index 97f386fc..7d8dde1e 100644 --- a/samples/_output/movieclip.js.map +++ b/samples/_output/movieclip.js.map @@ -3,7 +3,7 @@ "file":"movieclip.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/movieclip/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.movieclip;\n\nimport pixi.extras.MovieClip;\nimport pixi.loaders.Loader;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start(Application.AUTO);\n\n\t\tvar mcloader:Loader = new Loader();\n\t\tmcloader.add(\"mc\", \"assets/movieclip/SpriteSheet.json\");\n\t\tmcloader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar explosionTextures = [];\n\n\t\tvar texture:Texture;\n\t\tfor (i in 0 ... 26) {\n\t\t\ttexture = Texture.fromFrame(\"Explosion_Sequence_A \" + (i + 1) + \".png\");\n\t\t\texplosionTextures.push(texture);\n\t\t}\n\n\t\tvar explosion:MovieClip;\n\t\tfor (i in 0 ... 80) {\n\t\t\texplosion = new MovieClip(explosionTextures);\n\t\t\texplosion.position.x = Math.random() * Browser.window.innerWidth;\n\t\t\texplosion.position.y = Math.random() * Browser.window.innerHeight;\n\t\t\texplosion.anchor.set(0.5, 0.5);\n\n\t\t\texplosion.rotation = Math.random() * Math.PI;\n\t\t\texplosion.scale.x = explosion.scale.y = 0.75 + Math.random() * 0.5;\n\n\t\t\texplosion.gotoAndPlay(Std.random(27));\n\t\t\texplosion.animationSpeed = 0.8;\n\n\t\t\tstage.addChild(explosion);\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.movieclip;\n\nimport pixi.extras.MovieClip;\nimport pixi.loaders.Loader;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start(Application.AUTO);\n\n\t\tvar mcloader:Loader = new Loader();\n\t\tmcloader.add(\"mc\", \"assets/movieclip/SpriteSheet.json\");\n\t\tmcloader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\tvar explosionTextures = [];\n\n\t\tvar texture:Texture;\n\t\tfor (i in 0 ... 26) {\n\t\t\ttexture = Texture.fromFrame(\"Explosion_Sequence_A \" + (i + 1) + \".png\");\n\t\t\texplosionTextures.push(texture);\n\t\t}\n\n\t\tvar explosion:MovieClip;\n\t\tfor (i in 0 ... 80) {\n\t\t\texplosion = new MovieClip(explosionTextures);\n\t\t\texplosion.position.x = Math.random() * Browser.window.innerWidth;\n\t\t\texplosion.position.y = Math.random() * Browser.window.innerHeight;\n\t\t\texplosion.anchor.set(0.5, 0.5);\n\n\t\t\texplosion.rotation = Math.random() * Math.PI;\n\t\t\texplosion.scale.x = explosion.scale.y = 0.75 + Math.random() * 0.5;\n\n\t\t\texplosion.gotoAndPlay(Std.random(27));\n\t\t\texplosion.animationSpeed = 0.8;\n\n\t\t\tstage.addChild(explosion);\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAA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;4BJxC4B;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/nape.js b/samples/_output/nape.js index a6d2d850..24836328 100644 --- a/samples/_output/nape.js +++ b/samples/_output/nape.js @@ -338,7 +338,7 @@ nape_callbacks_BodyCallback.__super__ = nape_callbacks_Callback; nape_callbacks_BodyCallback.prototype = $extend(nape_callbacks_Callback.prototype,{ toString: function() { var ret = "Cb:"; - ret += ["WAKE","SLEEP"][this.zpp_inner.event - zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE]; + ret += ["WAKE","SLEEP"][this.zpp_inner.event - 2]; ret += ":" + this.zpp_inner.body.outer.toString(); ret += " : listener: " + Std.string(this.zpp_inner.listener.outer); return ret; @@ -352,10 +352,10 @@ nape_callbacks_Listener.__name__ = true; nape_callbacks_Listener.prototype = { toString: function() { var event = ["BEGIN","END","WAKE","SLEEP","BREAK","PRE","ONGOING"][this.zpp_inner.event]; - if(this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_BODY) { + if(this.zpp_inner.type == 0) { var body = this.zpp_inner.body; return "BodyListener{" + event + "::" + Std.string(body.outer_zn.zpp_inner_zn.options.outer) + "}"; - } else if(this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_CONSTRAINT) { + } else if(this.zpp_inner.type == 1) { var con = this.zpp_inner.constraint; return "ConstraintListener{" + event + "::" + Std.string(con.outer_zn.zpp_inner_zn.options.outer) + "}"; } else { @@ -375,7 +375,7 @@ nape_callbacks_Listener.prototype = { default: itype = "ALL"; } - return (this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_INTERACTION?"InteractionListener{" + event + "#" + itype + "::" + Std.string(con1.outer_zni.zpp_inner_zn.options1.outer) + ":" + Std.string(con1.outer_zni.zpp_inner_zn.options2.outer) + "}":"PreListener{" + itype + "::" + Std.string(con1.outer_znp.zpp_inner_zn.options1.outer) + ":" + Std.string(con1.outer_znp.zpp_inner_zn.options2.outer) + "}") + " precedence=" + this.zpp_inner.precedence; + return (this.zpp_inner.type == 2?"InteractionListener{" + event + "#" + itype + "::" + Std.string(con1.outer_zni.zpp_inner_zn.options1.outer) + ":" + Std.string(con1.outer_zni.zpp_inner_zn.options2.outer) + "}":"PreListener{" + itype + "::" + Std.string(con1.outer_znp.zpp_inner_zn.options1.outer) + ":" + Std.string(con1.outer_znp.zpp_inner_zn.options2.outer) + "}") + " precedence=" + this.zpp_inner.precedence; } } ,__class__: nape_callbacks_Listener @@ -570,7 +570,7 @@ nape_callbacks_ConstraintCallback.__super__ = nape_callbacks_Callback; nape_callbacks_ConstraintCallback.prototype = $extend(nape_callbacks_Callback.prototype,{ toString: function() { var ret = "Cb:"; - ret += ["WAKE","SLEEP","BREAK"][this.zpp_inner.event - zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE]; + ret += ["WAKE","SLEEP","BREAK"][this.zpp_inner.event - 2]; ret += ":" + this.zpp_inner.constraint.outer.toString(); ret += " : listener: " + Std.string(this.zpp_inner.listener.outer); return ret; @@ -1032,7 +1032,7 @@ nape_dynamics_Arbiter.prototype = { if(!this.zpp_inner.active) throw new js__$Boot_HaxeError("Error: Arbiter not currently in use"); var _g = this.zpp_inner.immState; var x = _g; - if(x == (zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS)) { + if(x == 5) { if(zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT == null) { zpp_$nape_util_ZPP_$Flags.internal = true; zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT = new nape_callbacks_PreFlag(); @@ -1050,7 +1050,7 @@ nape_dynamics_Arbiter.prototype = { } return zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE; default: - if(x1 == (zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS)) { + if(x1 == 6) { if(zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE = new nape_callbacks_PreFlag(); @@ -2260,7 +2260,7 @@ nape_phys_Body.prototype = $extend(nape_phys_Interactor.prototype,{ } $r = zpp_$nape_util_ZPP_$Flags.BodyType_DYNAMIC; return $r; - }(this))) ntype = zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC; else if(type == (function($this) { + }(this))) ntype = 2; else if(type == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.BodyType_KINEMATIC == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -2269,8 +2269,8 @@ nape_phys_Body.prototype = $extend(nape_phys_Interactor.prototype,{ } $r = zpp_$nape_util_ZPP_$Flags.BodyType_KINEMATIC; return $r; - }(this))) ntype = zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC; else ntype = zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC; - if(ntype == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.zpp_inner.space != null) { + }(this))) ntype = 3; else ntype = 1; + if(ntype == 1 && this.zpp_inner.space != null) { this.zpp_inner.velx = 0; this.zpp_inner.vely = 0; this.zpp_inner.angvel = 0; @@ -2307,7 +2307,7 @@ nape_phys_Body.prototype = $extend(nape_phys_Interactor.prototype,{ return this; } ,toString: function() { - return (this.zpp_inner.world?"(space::world":"(" + (this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC?"dynamic":this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC?"static":"kinematic")) + ")#" + this.zpp_inner_i.id; + return (this.zpp_inner.world?"(space::world":"(" + (this.zpp_inner.type == 2?"dynamic":this.zpp_inner.type == 1?"static":"kinematic")) + ")#" + this.zpp_inner_i.id; } ,__class__: nape_phys_Body }); @@ -2887,7 +2887,7 @@ nape_shape_Shape.prototype = $extend(nape_phys_Interactor.prototype,{ } ,toString: function() { var ret; - if(this.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) ret = "Circle"; else ret = "Polygon"; + if(this.zpp_inner.type == 0) ret = "Circle"; else ret = "Polygon"; return ret + "#" + this.zpp_inner_i.id; } ,__class__: nape_shape_Shape @@ -2904,7 +2904,7 @@ var nape_shape_Circle = function(radius,localCOM,material,filter) { this.zpp_inner_i = this.zpp_inner; this.zpp_inner_i.outer_i = this; this.zpp_inner.immutable_midstep("Circle::radius"); - if(this.zpp_inner.body != null && this.zpp_inner.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.zpp_inner.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy radius of Circle contained in static object once added to space"); + if(this.zpp_inner.body != null && this.zpp_inner.body.type == 1 && this.zpp_inner.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy radius of Circle contained in static object once added to space"); if(radius != this.zpp_inner_zn.radius) { if(radius != radius) throw new js__$Boot_HaxeError("Error: Circle::radius cannot be NaN"); if(radius < nape_Config.epsilon) throw new js__$Boot_HaxeError("Error: Circle::radius (" + radius + ") must be > Config.epsilon"); @@ -3578,7 +3578,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } @@ -3684,7 +3684,7 @@ samples_nape_Main.prototype = $extend(pixi_plugins_app_Application.prototype,{ }(this))).setxy(Std.random(800),0); if(pball.zpp_inner.world) throw new js__$Boot_HaxeError("Error: Space::world is immutable"); if(pball.zpp_inner.angvel != 0) { - if(pball.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) throw new js__$Boot_HaxeError("Error: A static object cannot be given a velocity"); + if(pball.zpp_inner.type == 1) throw new js__$Boot_HaxeError("Error: A static object cannot be given a velocity"); pball.zpp_inner.angvel = 0; pball.zpp_inner.wake(); } @@ -5106,7 +5106,7 @@ zpp_$nape_callbacks_ZPP_$InteractionListener.prototype = $extend(zpp_$nape_callb } ,addedToSpace: function() { var _g = this; - var pre = this.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_PRE; + var pre = this.type == 3; this.with_union(function(cb) { cb.addint(_g); if(pre) { @@ -5125,7 +5125,7 @@ zpp_$nape_callbacks_ZPP_$InteractionListener.prototype = $extend(zpp_$nape_callb ,removedFromSpace: function() { var _g = this; this.with_uniquesets(false); - var pre = this.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_PRE; + var pre = this.type == 3; this.with_union(function(cb) { cb.listeners.remove(_g); cb.invalidateint(); @@ -5524,13 +5524,13 @@ zpp_$nape_dynamics_ZPP_$FluidArbiter.prototype = $extend(zpp_$nape_dynamics_ZPP_ buoyy *= t7; this.buoyx = buoyx; this.buoyy = buoyy; - if(this.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(this.b1.type == 2) { var t8 = this.b1.imass; this.b1.velx -= buoyx * t8; this.b1.vely -= buoyy * t8; this.b1.angvel -= (buoyy * this.r1x - buoyx * this.r1y) * this.b1.iinertia; } - if(this.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(this.b2.type == 2) { var t9 = this.b2.imass; this.b2.velx += buoyx * t9; this.b2.vely += buoyy * t9; @@ -5582,7 +5582,7 @@ zpp_$nape_dynamics_ZPP_$FluidArbiter.prototype = $extend(zpp_$nape_dynamics_ZPP_ var tViscosity1 = 0.0; if(this.ws1.fluidEnabled) { var f = -this.ws1.fluidProperties.viscosity * this.overlap / this.ws2.area; - if(this.ws2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) tViscosity1 -= f * this.ws2.circle.radius * nape_Config.fluidLinearDrag / (2 * this.ws2.circle.radius * Math.PI); else { + if(this.ws2.type == 0) tViscosity1 -= f * this.ws2.circle.radius * nape_Config.fluidLinearDrag / (2 * this.ws2.circle.radius * Math.PI); else { var poly = this.ws2.polygon; var bord = 0.0; var acc = 0.0; @@ -5600,7 +5600,7 @@ zpp_$nape_dynamics_ZPP_$FluidArbiter.prototype = $extend(zpp_$nape_dynamics_ZPP_ } if(this.ws2.fluidEnabled) { var f1 = -this.ws2.fluidProperties.viscosity * this.overlap / this.ws1.area; - if(this.ws1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) tViscosity1 -= f1 * this.ws1.circle.radius * nape_Config.fluidLinearDrag / (2 * this.ws1.circle.radius * Math.PI); else { + if(this.ws1.type == 0) tViscosity1 -= f1 * this.ws1.circle.radius * nape_Config.fluidLinearDrag / (2 * this.ws1.circle.radius * Math.PI); else { var poly1 = this.ws1.polygon; var bord1 = 0.0; var acc1 = 0.0; @@ -5937,7 +5937,7 @@ zpp_$nape_dynamics_ZPP_$ColArbiter.prototype = $extend(zpp_$nape_dynamics_ZPP_$A var mass_sum = this.b1.smass + this.b2.smass; this.hc2 = false; var fst = true; - var statType = !(this.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) || !(this.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC); + var statType = !(this.b1.type == 2) || !(this.b2.type == 2); var bias; if(statType) { if(this.continuous) bias = nape_Config.contactContinuousStaticBiasCoef; else bias = nape_Config.contactStaticBiasCoef; @@ -6854,8 +6854,8 @@ zpp_$nape_util_ZNPList_$ZPP_$Vec2.prototype = { var zpp_$nape_geom_ZPP_$Collide = function() { }; zpp_$nape_geom_ZPP_$Collide.__name__ = true; zpp_$nape_geom_ZPP_$Collide.contactCollide = function(s1,s2,arb,rev) { - if(s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s2.type == 1) { + if(s1.type == 1) { var cont = true; var max = -1e+100; var maxmin = -1e+100; @@ -7172,7 +7172,7 @@ zpp_$nape_geom_ZPP_$Collide.contactCollide = function(s1,s2,arb,rev) { } }; zpp_$nape_geom_ZPP_$Collide.testCollide_safe = function(s1,s2) { - if(s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) { + if(s2.type == 0) { var t = s1; s1 = s2; s2 = t; @@ -7180,7 +7180,7 @@ zpp_$nape_geom_ZPP_$Collide.testCollide_safe = function(s1,s2) { return zpp_$nape_geom_ZPP_$Collide.testCollide(s1,s2); }; zpp_$nape_geom_ZPP_$Collide.testCollide = function(s1,s2) { - if(s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s2.type == 1) if(s1.type == 1) { var cont = true; var cx_ite = s1.polygon.edges.head; while(cx_ite != null) { @@ -7277,7 +7277,7 @@ zpp_$nape_geom_ZPP_$Collide.testCollide = function(s1,s2) { } }; zpp_$nape_geom_ZPP_$Collide.flowCollide = function(s1,s2,arb) { - if(s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s2.type == 1) if(s1.type == 1) { var out1 = []; var out2 = []; var cont = true; @@ -8811,7 +8811,7 @@ zpp_$nape_geom_ZPP_$SweepDistance.staticSweep = function(toi,timeStep,lowerBound }; zpp_$nape_geom_ZPP_$SweepDistance.distance = function(s1,s2,w1,w2,axis,upperBound) { if(upperBound == null) upperBound = 1e100; - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE && s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) { + if(s1.type == 0 && s2.type == 0) { var c1 = s1.circle; var c2 = s2.circle; var dist; @@ -8842,7 +8842,7 @@ zpp_$nape_geom_ZPP_$SweepDistance.distance = function(s1,s2,w1,w2,axis,upperBoun return dist; } else { var swapped = false; - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE && s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s1.type == 0 && s2.type == 1) { var tmp = s1; s1 = s2; s2 = tmp; @@ -8851,7 +8851,7 @@ zpp_$nape_geom_ZPP_$SweepDistance.distance = function(s1,s2,w1,w2,axis,upperBoun w2 = tmp2; swapped = true; } - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON && s2.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) { + if(s1.type == 1 && s2.type == 0) { var poly = s1.polygon; var circle = s2.circle; var best = -1e+100; @@ -9598,10 +9598,10 @@ var zpp_$nape_phys_ZPP_$Body = function() { this.aabb._immutable = true; var me = this; this.aabb._validate = $bind(this,this.aabb_validate); - this.massMode = zpp_$nape_util_ZPP_$Flags.id_MassMode_DEFAULT; - this.gravMassMode = zpp_$nape_util_ZPP_$Flags.id_GravMassMode_DEFAULT; + this.massMode = 0; + this.gravMassMode = 0; this.gravMassScale = 1.0; - this.inertiaMode = zpp_$nape_util_ZPP_$Flags.id_InertiaMode_DEFAULT; + this.inertiaMode = 0; this.arbiters = new zpp_$nape_util_ZNPList_$ZPP_$Arbiter(); this.constraints = new zpp_$nape_util_ZNPList_$ZPP_$Constraint(); this.shapes = new zpp_$nape_util_ZNPList_$ZPP_$Shape(); @@ -9646,7 +9646,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot this.invalidate_inertia(); } ,atRest: function(dt) { - if(!(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC)) return this.component.sleeping; else { + if(!(this.type == 2)) return this.component.sleeping; else { var linSq = nape_Config.linearSleepThreshold; linSq *= linSq; var cansleep; @@ -9686,7 +9686,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } } ,sweepValidate: function(s) { - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) { + if(s.type == 0) { s.worldCOMx = this.posx + (this.axisy * s.localCOMx - this.axisx * s.localCOMy); s.worldCOMy = this.posy + (s.localCOMx * this.axisx + s.localCOMy * this.axisy); } else { @@ -9731,7 +9731,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot var cx_ite = this.shapes.head; while(cx_ite != null) { var s = cx_ite.elt; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s.type == 1) { s.polygon.invalidate_gverts(); s.polygon.invalidate_gaxi(); } @@ -9742,7 +9742,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } ,pos_invalidate: function(pos) { this.immutable_midstep("Body::position"); - if(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.space != null) throw new js__$Boot_HaxeError("Error: Cannot move a static object once inside a Space"); + if(this.type == 1 && this.space != null) throw new js__$Boot_HaxeError("Error: Cannot move a static object once inside a Space"); if(!(this.posx == pos.x && this.posy == pos.y)) { this.posx = pos.x; this.posy = pos.y; @@ -9767,7 +9767,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot var cx_ite = this.shapes.head; while(cx_ite != null) { var s = cx_ite.elt; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s.type == 1) { s.polygon.invalidate_gverts(); s.polygon.invalidate_gaxi(); } @@ -9805,9 +9805,9 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } ,validate_mass: function() { var exist = false; - if(this.zip_mass || this.massMode == zpp_$nape_util_ZPP_$Flags.id_MassMode_DEFAULT && exist) { + if(this.zip_mass || this.massMode == 0 && exist) { this.zip_mass = false; - if(this.massMode == zpp_$nape_util_ZPP_$Flags.id_MassMode_DEFAULT) { + if(this.massMode == 0) { this.cmass = 0; var cx_ite = this.shapes.head; while(cx_ite != null) { @@ -9818,7 +9818,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot cx_ite = cx_ite.next; } } - if(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && !this.nomove) { + if(this.type == 2 && !this.nomove) { this.mass = this.cmass; this.imass = this.smass = 1.0 / this.mass; } else { @@ -9829,18 +9829,18 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } } ,invalidate_gravMass: function() { - if(this.gravMassMode != zpp_$nape_util_ZPP_$Flags.id_GravMassMode_FIXED) this.zip_gravMass = true; - if(this.gravMassMode != zpp_$nape_util_ZPP_$Flags.id_GravMassMode_SCALED) this.zip_gravMassScale = true; + if(this.gravMassMode != 1) this.zip_gravMass = true; + if(this.gravMassMode != 2) this.zip_gravMassScale = true; this.wake(); } ,validate_gravMass: function() { if(this.zip_gravMass) { this.zip_gravMass = false; this.validate_mass(); - if(this.gravMassMode == zpp_$nape_util_ZPP_$Flags.id_GravMassMode_DEFAULT) { + if(this.gravMassMode == 0) { this.validate_mass(); this.gravMass = this.cmass; - } else if(this.gravMassMode == zpp_$nape_util_ZPP_$Flags.id_GravMassMode_SCALED) { + } else if(this.gravMassMode == 2) { this.validate_mass(); this.gravMass = this.cmass * this.gravMassScale; } @@ -9852,9 +9852,9 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } ,validate_inertia: function() { var exist = false; - if(this.zip_inertia || this.inertiaMode == zpp_$nape_util_ZPP_$Flags.id_InertiaMode_DEFAULT && exist) { + if(this.zip_inertia || this.inertiaMode == 0 && exist) { this.zip_inertia = false; - if(this.inertiaMode == zpp_$nape_util_ZPP_$Flags.id_InertiaMode_DEFAULT) { + if(this.inertiaMode == 0) { this.cinertia = 0; var cx_ite = this.shapes.head; while(cx_ite != null) { @@ -9865,7 +9865,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot cx_ite = cx_ite.next; } } - if(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && !this.norotate) { + if(this.type == 2 && !this.norotate) { this.inertia = this.cinertia; this.sinertia = this.iinertia = 1.0 / this.inertia; } else { @@ -9889,7 +9889,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot if(s.zip_aabb) { if(s.body != null) { s.zip_aabb = false; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) s.circle.__validate_aabb(); else s.polygon.__validate_aabb(); + if(s.type == 0) s.circle.__validate_aabb(); else s.polygon.__validate_aabb(); } } this.aabb.combine(s.aabb); @@ -9912,7 +9912,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot var s = cx_ite.elt; if(s.zip_localCOM) { s.zip_localCOM = false; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) s.polygon.__validate_localCOM(); + if(s.type == 1) s.polygon.__validate_localCOM(); if(s.wrap_localCOM != null) { s.wrap_localCOM.zpp_inner.x = s.localCOMx; s.wrap_localCOM.zpp_inner.y = s.localCOMy; @@ -9934,10 +9934,10 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot this.wrap_localCOM.zpp_inner.x = this.localCOMx; this.wrap_localCOM.zpp_inner.y = this.localCOMy; } - if(this.zip_mass && this.massMode == zpp_$nape_util_ZPP_$Flags.id_MassMode_DEFAULT) { + if(this.zip_mass && this.massMode == 0) { this.zip_mass = false; this.cmass = msum; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(this.type == 2) { this.mass = this.cmass; this.imass = this.smass = 1.0 / this.mass; } else { @@ -9978,7 +9978,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot s.zpp_inner.body = this; s.zpp_inner.addedToBody(); if(this.space != null) this.space.added_shape(s.zpp_inner,null); - if(s.zpp_inner.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s.zpp_inner.type == 1) { s.zpp_inner.polygon.invalidate_gaxi(); s.zpp_inner.polygon.invalidate_gverts(); } @@ -9995,7 +9995,7 @@ zpp_$nape_phys_ZPP_$Body.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.prot } ,shapes_modifiable: function() { this.immutable_midstep("Body::shapes"); - if(this.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy shapes of static object once added to Space"); + if(this.type == 1 && this.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy shapes of static object once added to Space"); } ,addedToSpace: function() { if(zpp_$nape_space_ZPP_$Component.zpp_pool == null) this.component = new zpp_$nape_space_ZPP_$Component(); else { @@ -10172,20 +10172,20 @@ zpp_$nape_shape_ZPP_$Shape.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.pr validate_sweepRadius: function() { if(this.zip_sweepRadius) { this.zip_sweepRadius = false; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) this.circle.__validate_sweepRadius(); else this.polygon.__validate_sweepRadius(); + if(this.type == 0) this.circle.__validate_sweepRadius(); else this.polygon.__validate_sweepRadius(); } } ,validate_area_inertia: function() { if(this.zip_area_inertia) { this.zip_area_inertia = false; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) this.circle.__validate_area_inertia(); else this.polygon.__validate_area_inertia(); + if(this.type == 0) this.circle.__validate_area_inertia(); else this.polygon.__validate_area_inertia(); } } ,validate_angDrag: function() { if(this.zip_angDrag || this.refmaterial.dynamicFriction != this.material.dynamicFriction) { this.zip_angDrag = false; this.refmaterial.dynamicFriction = this.material.dynamicFriction; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) this.circle.__validate_angDrag(); else this.polygon.__validate_angDrag(); + if(this.type == 0) this.circle.__validate_angDrag(); else this.polygon.__validate_angDrag(); } } ,validate_worldCOM: function() { @@ -10194,7 +10194,7 @@ zpp_$nape_shape_ZPP_$Shape.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.pr this.zip_worldCOM = false; if(this.zip_localCOM) { this.zip_localCOM = false; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) this.polygon.__validate_localCOM(); + if(this.type == 1) this.polygon.__validate_localCOM(); if(this.wrap_localCOM != null) { this.wrap_localCOM.zpp_inner.x = this.localCOMx; this.wrap_localCOM.zpp_inner.y = this.localCOMy; @@ -10220,7 +10220,7 @@ zpp_$nape_shape_ZPP_$Shape.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.pr ,invalidate_localCOM: function() { this.zip_localCOM = true; this.invalidate_area_inertia(); - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) this.zip_sweepRadius = true; + if(this.type == 0) this.zip_sweepRadius = true; this.invalidate_angDrag(); this.invalidate_worldCOM(); if(this.body != null) this.body.invalidate_localCOM(); @@ -10253,7 +10253,7 @@ zpp_$nape_shape_ZPP_$Shape.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.pr if(this.zip_aabb) { if(this.body != null) { this.zip_aabb = false; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) this.circle.__validate_aabb(); else this.polygon.__validate_aabb(); + if(this.type == 0) this.circle.__validate_aabb(); else this.polygon.__validate_aabb(); } } } @@ -10305,7 +10305,7 @@ zpp_$nape_shape_ZPP_$Shape.prototype = $extend(zpp_$nape_phys_ZPP_$Interactor.pr var zpp_$nape_shape_ZPP_$Circle = function() { this.radius = 0.0; this.outer_zn = null; - zpp_$nape_shape_ZPP_$Shape.call(this,zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE); + zpp_$nape_shape_ZPP_$Shape.call(this,0); this.circle = this; this.zip_localCOM = false; }; @@ -10325,7 +10325,7 @@ zpp_$nape_shape_ZPP_$Circle.prototype = $extend(zpp_$nape_shape_ZPP_$Shape.proto this.zip_worldCOM = false; if(this.zip_localCOM) { this.zip_localCOM = false; - if(this.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) this.polygon.__validate_localCOM(); + if(this.type == 1) this.polygon.__validate_localCOM(); if(this.wrap_localCOM != null) { this.wrap_localCOM.zpp_inner.x = this.localCOMx; this.wrap_localCOM.zpp_inner.y = this.localCOMy; @@ -10425,7 +10425,7 @@ var zpp_$nape_shape_ZPP_$Polygon = function() { this.wrap_lverts = null; this.lverts = null; this.outer_zn = null; - zpp_$nape_shape_ZPP_$Shape.call(this,zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON); + zpp_$nape_shape_ZPP_$Shape.call(this,1); this.polygon = this; this.lverts = new zpp_$nape_geom_ZPP_$Vec2(); this.gverts = new zpp_$nape_geom_ZPP_$Vec2(); @@ -10439,7 +10439,7 @@ zpp_$nape_shape_ZPP_$Polygon.prototype = $extend(zpp_$nape_shape_ZPP_$Shape.prot this.invalidate_lverts(); } ,lverts_pa_immutable: function() { - if(this.body != null && this.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modify local vertex of Polygon added to a static body whilst within a Space"); + if(this.body != null && this.body.type == 1 && this.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modify local vertex of Polygon added to a static body whilst within a Space"); } ,gverts_pa_validate: function() { if(this.body == null) throw new js__$Boot_HaxeError("Error: World vertex only makes sense when Polygon is contained in a rigid body"); @@ -10508,7 +10508,7 @@ zpp_$nape_shape_ZPP_$Polygon.prototype = $extend(zpp_$nape_shape_ZPP_$Shape.prot } ,lverts_modifiable: function() { this.immutable_midstep("Polygon::localVerts"); - if(this.body != null && this.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && this.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy shapes of static object once added to Space"); + if(this.body != null && this.body.type == 1 && this.body.space != null) throw new js__$Boot_HaxeError("Error: Cannot modifiy shapes of static object once added to Space"); } ,getlverts: function() { var me = this; @@ -11372,7 +11372,7 @@ zpp_$nape_space_ZPP_$Broadphase.prototype = { if(shape.zip_aabb) { if(shape.body != null) { shape.zip_aabb = false; - if(shape.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); + if(shape.type == 0) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); } } } @@ -11788,12 +11788,12 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(shape.zip_aabb) { if(shape.body != null) { shape.zip_aabb = false; - if(shape.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); + if(shape.type == 0) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); } } } var sync; - sync = node.dyn != (shape.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC?false:!shape.body.component.sleeping) || !node.aabb.contains(shape.aabb); + sync = node.dyn != (shape.body.type == 1?false:!shape.body.component.sleeping) || !node.aabb.contains(shape.aabb); if(sync) { node.synced = true; node.snext = this.syncs; @@ -11815,13 +11815,13 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(shape.zip_aabb) { if(shape.body != null) { shape.zip_aabb = false; - if(shape.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); + if(shape.type == 0) shape.circle.__validate_aabb(); else shape.polygon.__validate_aabb(); } } } aabb.setExpand(shape.aabb,3.0); var tree; - if(shape.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC?node.dyn = false:node.dyn = !shape.body.component.sleeping) tree = this.dtree; else tree = this.stree; + if(shape.body.type == 1?node.dyn = false:node.dyn = !shape.body.component.sleeping) tree = this.dtree; else tree = this.stree; tree.inlined_insertLeaf(node); node.synced = false; node = node.snext; @@ -11852,7 +11852,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(node1 == leaf) continue; if(node1.child1 == null) { var shape1 = node1.shape; - if(shape1.body != lshape.body && !(shape1.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && lshape.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(shape1.body != lshape.body && !(shape1.body.type == 1 && lshape.body.type == 1)) { if(ab.intersect(node1.aabb)) { var id; var di; @@ -11925,7 +11925,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(node2 == leaf) continue; if(node2.child1 == null) { var shape2 = node2.shape; - if(shape2.body != lshape.body && !(shape2.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && lshape.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(shape2.body != lshape.body && !(shape2.body.type == 1 && lshape.body.type == 1)) { if(ab.intersect(node2.aabb)) { var id1; var di1; @@ -12011,7 +12011,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(node3 == leaf1) continue; if(node3.child1 == null) { var shape3 = node3.shape; - if(shape3.body != lshape1.body && !(shape3.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && lshape1.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(shape3.body != lshape1.body && !(shape3.body.type == 1 && lshape1.body.type == 1)) { if(ab1.intersect(node3.aabb)) { var id2; var di2; @@ -12084,7 +12084,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad if(node4 == leaf1) continue; if(node4.child1 == null) { var shape4 = node4.shape; - if(shape4.body != lshape1.body && !(shape4.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && lshape1.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(shape4.body != lshape1.body && !(shape4.body.type == 1 && lshape1.body.type == 1)) { if(ab1.intersect(node4.aabb)) { var id3; var di3; @@ -12168,7 +12168,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad var s21 = cur.n2.shape; var b2 = s21.body; if(!cur.first) { - if((b1.component.sleeping || b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) && (b2.component.sleeping || b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if((b1.component.sleeping || b1.type == 1) && (b2.component.sleeping || b2.type == 1)) { cur.sleeping = true; if(pre == null) this.pairs = cur.next; else pre.next = cur.next; cur = cur.next; @@ -12178,7 +12178,7 @@ zpp_$nape_space_ZPP_$DynAABBPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broad cur.first = false; if(s11.aabb.intersect(s21.aabb)) { var oarb = cur.arb; - if(discrete) cur.arb = space.narrowPhase(s11,s21,!(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) || !(b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC),cur.arb,false); else cur.arb = space.continuousEvent(s11,s21,!(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) || !(b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC),cur.arb,false); + if(discrete) cur.arb = space.narrowPhase(s11,s21,!(b1.type == 2) || !(b2.type == 2),cur.arb,false); else cur.arb = space.continuousEvent(s11,s21,!(b1.type == 2) || !(b2.type == 2),cur.arb,false); if(cur.arb == null) { if(oarb != null) oarb.pair = null; } else cur.arb.pair = cur; @@ -12275,11 +12275,11 @@ zpp_$nape_space_ZPP_$CallbackSet.get = function(i1,i2) { } ret.freed = false; ret.lazydel = false; - ret.COLLISIONstate = zpp_$nape_util_ZPP_$Flags.id_PreFlag_ACCEPT; + ret.COLLISIONstate = 1; ret.COLLISIONstamp = 0; - ret.SENSORstate = zpp_$nape_util_ZPP_$Flags.id_PreFlag_ACCEPT; + ret.SENSORstate = 1; ret.SENSORstamp = 0; - ret.FLUIDstate = zpp_$nape_util_ZPP_$Flags.id_PreFlag_ACCEPT; + ret.FLUIDstate = 1; ret.FLUIDstamp = 0; if(i1.id < i2.id) { ret.int1 = i1; @@ -12658,21 +12658,21 @@ zpp_$nape_space_ZPP_$Space.prototype = { var o = p; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,false); } - if(p.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) this.live.remove(p); else if(p.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) { + if(p.type == 2) this.live.remove(p); else if(p.type == 3) { this.kinematics.remove(p); this.staticsleep.remove(p); - } else if(p.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) this.staticsleep.remove(p); + } else if(p.type == 1) this.staticsleep.remove(p); p.type = new_type; - if(p.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) this.kinematics.add(p); - if(p.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) this.static_validation(p); + if(p.type == 3) this.kinematics.add(p); + if(p.type == 1) this.static_validation(p); p.component.sleeping = true; var o1 = p; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,true); } } @@ -12682,7 +12682,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var o = s.body; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,false); } } @@ -12719,11 +12719,11 @@ zpp_$nape_space_ZPP_$Space.prototype = { var callbackset = [zpp_$nape_phys_ZPP_$Interactor.get(i1,i2)]; callbackset[0].remove_arb(xarb[0]); xarb[0].present--; - cb1.manager.pair(cb1,cb2).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_END,(function(callbackset,xarb) { + cb1.manager.pair(cb1,cb2).forall(1,(function(callbackset,xarb) { return function(listener) { if((listener.itype & xarb[0].type) != 0 && callbackset[0].empty_arb(listener.itype)) { var cb = _g.push_callback(listener); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_END; + cb.event = 1; zpp_$nape_phys_ZPP_$Interactor.int_callback(callbackset[0],listener,cb); cb.set = callbackset[0]; } @@ -12735,19 +12735,19 @@ zpp_$nape_space_ZPP_$Space.prototype = { cx_ite1 = cx_ite1.next; } } - if(xarb[0].b1 != body && xarb[0].b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(xarb[0].b1 != body && xarb[0].b1.type == 2) { var o = xarb[0].b1; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,false); } } - if(xarb[0].b2 != body && xarb[0].b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(xarb[0].b2 != body && xarb[0].b2.type == 2) { var o1 = xarb[0].b2; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,false); } } @@ -12837,7 +12837,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var o = body; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,true); } var cx_ite = body.shapes.head; @@ -12846,37 +12846,37 @@ zpp_$nape_space_ZPP_$Space.prototype = { this.added_shape(shape,true); cx_ite = cx_ite.next; } - if(body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) { + if(body.type == 1) { this.static_validation(body); - } else if(body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + } else if(body.type == 2) { } else { - if(flag != zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) this.kinematics.add(body); + if(flag != 3) this.kinematics.add(body); } } ,remBody: function(body,flag) { if(flag == null) flag = -1; - if(body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) { + if(body.type == 1) { var o = body; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,true); } this.staticsleep.remove(body); - } else if(body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + } else if(body.type == 2) { var o1 = body; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,true); } this.live.remove(body); } else { - if(flag != zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) this.kinematics.remove(body); + if(flag != 3) this.kinematics.remove(body); var o2 = body; if(!o2.world) { o2.component.waket = this.stamp + (this.midstep?0:1); - if(o2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o2.kinematicDelaySleep = true; + if(o2.type == 3) o2.kinematicDelaySleep = true; if(o2.component.sleeping) this.really_wake(o2,true); } this.staticsleep.remove(body); @@ -13014,7 +13014,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite4 = this.staticsleep.head; while(cx_ite4 != null) { var b = cx_ite4.elt; - if(!(b.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) || b.velx == 0 && b.vely == 0 && b.angvel == 0) { + if(!(b.type == 3) || b.velx == 0 && b.vely == 0 && b.angvel == 0) { if(b.kinematicDelaySleep) { b.kinematicDelaySleep = false; cx_ite4 = cx_ite4.next; @@ -13046,11 +13046,11 @@ zpp_$nape_space_ZPP_$Space.prototype = { continue; } var sleeping = [set[0].sleeping()]; - zpp_$nape_callbacks_ZPP_$CbSet.find_all(set[0].int1.cbSet,set[0].int2.cbSet,zpp_$nape_util_ZPP_$Flags.id_CbEvent_ONGOING,(function(sleeping,set) { + zpp_$nape_callbacks_ZPP_$CbSet.find_all(set[0].int1.cbSet,set[0].int2.cbSet,6,(function(sleeping,set) { return function(x) { if((!sleeping[0] || x.allowSleepingCallbacks) && !set[0].empty_arb(x.itype)) { var cb = _g.push_callback(x); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_ONGOING; + cb.event = 6; zpp_$nape_phys_ZPP_$Interactor.int_callback(set[0],x,cb); cb.set = set[0]; } @@ -13061,13 +13061,13 @@ zpp_$nape_space_ZPP_$Space.prototype = { } while(!this.callbacks.empty()) { var cb1 = this.callbacks.pop(); - if(cb1.listener.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_BODY) { + if(cb1.listener.type == 0) { var o1 = cb1.listener.body; o1.handler(cb1.wrapper_body()); - } else if(cb1.listener.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_CONSTRAINT) { + } else if(cb1.listener.type == 1) { var o2 = cb1.listener.constraint; o2.handler(cb1.wrapper_con()); - } else if(cb1.listener.type == zpp_$nape_util_ZPP_$Flags.id_ListenerType_INTERACTION) { + } else if(cb1.listener.type == 2) { var o3 = cb1.listener.interaction; o3.handleri(cb1.wrapper_int()); } @@ -13163,7 +13163,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { minTOI.arbiter.pair = null; } } else if(!this.presteparb(arb,deltaTime,true)) { - if(arb.type == zpp_$nape_dynamics_ZPP_$Arbiter.COL && (arb.active && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0)) { + if(arb.type == zpp_$nape_dynamics_ZPP_$Arbiter.COL && (arb.active && (arb.immState & 1) != 0)) { arb.colarb.warmStart(); arb.colarb.applyImpulseVel(); arb.colarb.applyImpulseVel(); @@ -13173,12 +13173,12 @@ zpp_$nape_space_ZPP_$Space.prototype = { b2.sweep_angvel = b2.angvel % MAX_VEL; } } - if(arb != null && (arb.active && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) && arb.type == zpp_$nape_dynamics_ZPP_$Arbiter.COL) { - if(!b1.sweepFrozen && !(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC)) { + if(arb != null && (arb.active && (arb.immState & 1) != 0) && arb.type == zpp_$nape_dynamics_ZPP_$Arbiter.COL) { + if(!b1.sweepFrozen && !(b1.type == 3)) { b1.sweepFrozen = true; if(minTOI.failed) b1.angvel = b1.sweep_angvel = 0; else if(minTOI.slipped) b1.angvel = b1.sweep_angvel *= nape_Config.angularCCDSlipScale; else b1.angvel = b1.sweep_angvel; } - if(!b2.sweepFrozen && !(b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC)) { + if(!b2.sweepFrozen && !(b2.type == 3)) { b2.sweepFrozen = true; if(minTOI.failed) b2.angvel = b2.sweep_angvel = 0; else if(minTOI.slipped) b2.angvel = b2.sweep_angvel *= nape_Config.angularCCDSlipScale; else b2.angvel = b2.sweep_angvel; } @@ -13224,9 +13224,9 @@ zpp_$nape_space_ZPP_$Space.prototype = { toi.failed = false; toi.s1 = toi.s2 = null; toi.arbiter = null; - var kin = b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC || b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC; + var kin = b1.type == 3 || b2.type == 3; if(stat && !kin) { - if(!(s1.body.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC)) { + if(!(s1.body.type == 2)) { toi.s2 = s1; toi.s1 = s2; } else { @@ -13264,17 +13264,17 @@ zpp_$nape_space_ZPP_$Space.prototype = { return in_arb; } ,bodyCbWake: function(b) { - if(b.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && b.cbSet != null) { + if(b.type == 2 && b.cbSet != null) { if(this.midstep) { var cx_ite = b.cbSet.bodylisteners.head; while(cx_ite != null) { var i = cx_ite.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE) { + if(i.event != 2) { cx_ite = cx_ite.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE; + cb.event = 2; cb.body = b; cx_ite = cx_ite.next; } @@ -13282,16 +13282,16 @@ zpp_$nape_space_ZPP_$Space.prototype = { } } ,bodyCbSleep: function(b) { - if(b.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && b.cbSet != null) { + if(b.type == 2 && b.cbSet != null) { var cx_ite = b.cbSet.bodylisteners.head; while(cx_ite != null) { var i = cx_ite.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_SLEEP) { + if(i.event != 3) { cx_ite = cx_ite.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_SLEEP; + cb.event = 3; cb.body = b; cx_ite = cx_ite.next; } @@ -13303,12 +13303,12 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = con.cbSet.conlisteners.head; while(cx_ite != null) { var i = cx_ite.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE) { + if(i.event != 2) { cx_ite = cx_ite.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE; + cb.event = 2; cb.constraint = con; cx_ite = cx_ite.next; } @@ -13320,12 +13320,12 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = con.cbSet.conlisteners.head; while(cx_ite != null) { var i = cx_ite.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_SLEEP) { + if(i.event != 3) { cx_ite = cx_ite.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_SLEEP; + cb.event = 3; cb.constraint = con; cx_ite = cx_ite.next; } @@ -13336,12 +13336,12 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = con.cbSet.conlisteners.head; while(cx_ite != null) { var i = cx_ite.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_BREAK) { + if(i.event != 4) { cx_ite = cx_ite.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_BREAK; + cb.event = 4; cb.constraint = con; cx_ite = cx_ite.next; } @@ -13642,7 +13642,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var o = y; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,false); } cx_ite = cx_ite.next; @@ -13685,7 +13685,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { c.island = null; c.parent = c; c.rank = 0; - if(!(b.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(!(b.type == 1)) { var cx_ite1 = b.shapes.head; while(cx_ite1 != null) { var shape = cx_ite1.elt; @@ -13712,7 +13712,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var o1 = o; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,fst); } } @@ -13720,7 +13720,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(fst == null) fst = false; if(o.component.island == null) { o.component.sleeping = false; - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC || o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) this.staticsleep.inlined_add(o); else this.live.inlined_add(o); + if(o.type == 3 || o.type == 1) this.staticsleep.inlined_add(o); else this.live.inlined_add(o); var cx_ite = o.constraints.head; while(cx_ite != null) { var con = cx_ite.elt; @@ -13738,28 +13738,28 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(carb.stat) this.c_arbiters_true.inlined_add(carb); else this.c_arbiters_false.inlined_add(carb); } else if(arb.type == zpp_$nape_dynamics_ZPP_$Arbiter.FLUID) this.f_arbiters.inlined_add(arb.fluidarb); else this.s_arbiters.inlined_add(arb.sensorarb); } - if(arb.type != zpp_$nape_dynamics_ZPP_$Arbiter.SENSOR && !arb.cleared && arb.up_stamp >= this.stamp && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { - if(arb.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb.b1.component.sleeping) { + if(arb.type != zpp_$nape_dynamics_ZPP_$Arbiter.SENSOR && !arb.cleared && arb.up_stamp >= this.stamp && (arb.immState & 1) != 0) { + if(arb.b1.type == 2 && arb.b1.component.sleeping) { var o1 = arb.b1; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,false); } } - if(arb.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb.b2.component.sleeping) { + if(arb.b2.type == 2 && arb.b2.component.sleeping) { var o2 = arb.b2; if(!o2.world) { o2.component.waket = this.stamp + (this.midstep?0:1); - if(o2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o2.kinematicDelaySleep = true; + if(o2.type == 3) o2.kinematicDelaySleep = true; if(o2.component.sleeping) this.really_wake(o2,false); } } } cx_ite1 = cx_ite1.next; } - if(!fst && o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) this.bodyCbWake(o); - if(!fst && !this.bphase.is_sweep && !(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(!fst && o.type == 2) this.bodyCbWake(o); + if(!fst && !this.bphase.is_sweep && !(o.type == 1)) { var cx_ite2 = o.shapes.head; while(cx_ite2 != null) { var shape = cx_ite2.elt; @@ -13788,8 +13788,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = this.c_arbiters_false.head; while(cx_ite != null) { var arb = cx_ite.elt; - if(!arb.cleared && arb.up_stamp == this.stamp && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { - if(arb.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(!arb.cleared && arb.up_stamp == this.stamp && (arb.immState & 1) != 0) { + if(arb.b1.type == 2 && arb.b2.type == 2) { var xr; if(arb.b1.component == arb.b1.component.parent) xr = arb.b1.component; else { var obj = arb.b1.component; @@ -13837,8 +13837,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite1 = this.f_arbiters.head; while(cx_ite1 != null) { var arb1 = cx_ite1.elt; - if(!arb1.cleared && arb1.up_stamp == this.stamp && (arb1.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { - if(arb1.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb1.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(!arb1.cleared && arb1.up_stamp == this.stamp && (arb1.immState & 1) != 0) { + if(arb1.b1.type == 2 && arb1.b2.type == 2) { var xr1; if(arb1.b1.component == arb1.b1.component.parent) xr1 = arb1.b1.component; else { var obj2 = arb1.b1.component; @@ -14094,7 +14094,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = body.shapes.head; while(cx_ite != null) { var s = cx_ite.elt; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s.type == 1) { s.polygon.splice_collinear(); var res = s.polygon.valid(); if(res != (function($this) { @@ -14122,7 +14122,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite1 = cur.shapes.head; while(cx_ite1 != null) { var s = cx_ite1.elt; - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s.type == 1) { s.polygon.splice_collinear(); var res = s.polygon.valid(); if(res != (function($this) { @@ -14154,18 +14154,18 @@ zpp_$nape_space_ZPP_$Space.prototype = { cur.axisy = Math.cos(cur.rot); null; } - if(!cur.nomove && cur.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur.mass == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false"); - if(!cur.norotate && cur.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur.inertia == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false"); + if(!cur.nomove && cur.type == 2 && cur.mass == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false"); + if(!cur.norotate && cur.type == 2 && cur.inertia == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false"); if(cur.component.woken && cur.cbSet != null) { var cx_ite2 = cur.cbSet.bodylisteners.head; while(cx_ite2 != null) { var i = cx_ite2.elt; - if(i.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE) { + if(i.event != 2) { cx_ite2 = cx_ite2.next; continue; } var cb = this.push_callback(i); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE; + cb.event = 2; cb.body = cur; cx_ite2 = cx_ite2.next; } @@ -14186,7 +14186,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite5 = cur1.shapes.head; while(cx_ite5 != null) { var s1 = cx_ite5.elt; - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON) { + if(s1.type == 1) { s1.polygon.splice_collinear(); var res1 = s1.polygon.valid(); if(res1 != (function($this) { @@ -14218,8 +14218,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { cur1.axisy = Math.cos(cur1.rot); null; } - if(!cur1.nomove && cur1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur1.mass == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false"); - if(!cur1.norotate && cur1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur1.inertia == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false"); + if(!cur1.nomove && cur1.type == 2 && cur1.mass == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false"); + if(!cur1.norotate && cur1.type == 2 && cur1.inertia == 0) throw new js__$Boot_HaxeError("Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false"); var cx_ite6 = cur1.shapes.head; while(cx_ite6 != null) { var shape1 = cx_ite6.elt; @@ -14237,12 +14237,12 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite8 = con.cbSet.conlisteners.head; while(cx_ite8 != null) { var i1 = cx_ite8.elt; - if(i1.event != zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE) { + if(i1.event != 2) { cx_ite8 = cx_ite8.next; continue; } var cb1 = this.push_callback(i1); - cb1.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE; + cb1.event = 2; cb1.constraint = con; cx_ite8 = cx_ite8.next; } @@ -14290,7 +14290,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(!cur.disableCCD) { var linThreshold = nape_Config.staticCCDLinearThreshold * cur.sweepRadius; var angThreshold = nape_Config.staticCCDAngularThreshold; - if((cur.velx * cur.velx + cur.vely * cur.vely) * dt * dt > linThreshold * linThreshold || cur.angvel * cur.angvel * dt * dt > angThreshold * angThreshold || cur.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) { + if((cur.velx * cur.velx + cur.vely * cur.vely) * dt * dt > linThreshold * linThreshold || cur.angvel * cur.angvel * dt * dt > angThreshold * angThreshold || cur.type == 3) { var angvel = cur.sweep_angvel; if(angvel < 0) angvel = -angvel; var iangvel = 1 / angvel; @@ -14306,7 +14306,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(count > 8) count = 8; var anginc = angvel * dt / count; cur.sweepIntegrate(dt); - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) s.circle._force_validate_aabb(); else s.polygon._force_validate_aabb(); + if(s.type == 0) s.circle._force_validate_aabb(); else s.polygon._force_validate_aabb(); if(minx < aabb.minx) aabb.minx = minx; else minx = aabb.minx; if(miny < aabb.miny) aabb.miny = miny; else miny = aabb.miny; if(maxx > aabb.maxx) aabb.maxx = maxx; else maxx = aabb.maxx; @@ -14315,7 +14315,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { while(_g < count) { var i = _g++; cur.sweepIntegrate(anginc * i * iangvel); - if(s.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) s.circle._force_validate_aabb(); else s.polygon._force_validate_aabb(); + if(s.type == 0) s.circle._force_validate_aabb(); else s.polygon._force_validate_aabb(); if(minx < aabb.minx) aabb.minx = minx; else minx = aabb.minx; if(miny < aabb.miny) aabb.miny = miny; else miny = aabb.miny; if(maxx > aabb.maxx) aabb.maxx = maxx; else maxx = aabb.maxx; @@ -14325,7 +14325,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { cx_ite1 = cx_ite1.next; } cur.sweepFrozen = false; - if(cur.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur.bulletEnabled) { + if(cur.type == 2 && cur.bulletEnabled) { var linThreshold2 = nape_Config.bulletCCDLinearThreshold * cur.sweepRadius; var angThreshold2 = nape_Config.bulletCCDAngularThreshold; if((cur.velx * cur.velx + cur.vely * cur.vely) * dt * dt > linThreshold2 * linThreshold2 || cur.angvel * cur.angvel * dt * dt > angThreshold2 * angThreshold2) cur.bullet = true; @@ -14352,7 +14352,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(!cur1.disableCCD) { var linThreshold1 = nape_Config.staticCCDLinearThreshold * cur1.sweepRadius; var angThreshold1 = nape_Config.staticCCDAngularThreshold; - if((cur1.velx * cur1.velx + cur1.vely * cur1.vely) * dt * dt > linThreshold1 * linThreshold1 || cur1.angvel * cur1.angvel * dt * dt > angThreshold1 * angThreshold1 || cur1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) { + if((cur1.velx * cur1.velx + cur1.vely * cur1.vely) * dt * dt > linThreshold1 * linThreshold1 || cur1.angvel * cur1.angvel * dt * dt > angThreshold1 * angThreshold1 || cur1.type == 3) { var angvel1 = cur1.sweep_angvel; if(angvel1 < 0) angvel1 = -angvel1; var iangvel1 = 1 / angvel1; @@ -14368,7 +14368,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { if(count1 > 8) count1 = 8; var anginc1 = angvel1 * dt / count1; cur1.sweepIntegrate(dt); - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) s1.circle._force_validate_aabb(); else s1.polygon._force_validate_aabb(); + if(s1.type == 0) s1.circle._force_validate_aabb(); else s1.polygon._force_validate_aabb(); if(minx1 < aabb1.minx) aabb1.minx = minx1; else minx1 = aabb1.minx; if(miny1 < aabb1.miny) aabb1.miny = miny1; else miny1 = aabb1.miny; if(maxx1 > aabb1.maxx) aabb1.maxx = maxx1; else maxx1 = aabb1.maxx; @@ -14377,7 +14377,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { while(_g1 < count1) { var i1 = _g1++; cur1.sweepIntegrate(anginc1 * i1 * iangvel1); - if(s1.type == zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE) s1.circle._force_validate_aabb(); else s1.polygon._force_validate_aabb(); + if(s1.type == 0) s1.circle._force_validate_aabb(); else s1.polygon._force_validate_aabb(); if(minx1 < aabb1.minx) aabb1.minx = minx1; else minx1 = aabb1.minx; if(miny1 < aabb1.miny) aabb1.miny = miny1; else miny1 = aabb1.miny; if(maxx1 > aabb1.maxx) aabb1.maxx = maxx1; else maxx1 = aabb1.maxx; @@ -14387,7 +14387,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { cx_ite3 = cx_ite3.next; } cur1.sweepFrozen = false; - if(cur1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && cur1.bulletEnabled) { + if(cur1.type == 2 && cur1.bulletEnabled) { var linThreshold21 = nape_Config.bulletCCDLinearThreshold * cur1.sweepRadius; var angThreshold21 = nape_Config.bulletCCDAngularThreshold; if((cur1.velx * cur1.velx + cur1.vely * cur1.vely) * dt * dt > linThreshold21 * linThreshold21 || cur1.angvel * cur1.angvel * dt * dt > angThreshold21 * angThreshold21) cur1.bullet = true; @@ -14435,11 +14435,11 @@ zpp_$nape_space_ZPP_$Space.prototype = { callbackset[0] = zpp_$nape_space_ZPP_$CallbackSet.get(i1,i2); this.add_callbackset(callbackset[0]); } - cb1.manager.pair(cb1,cb2).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_BEGIN,(function(callbackset) { + cb1.manager.pair(cb1,cb2).forall(0,(function(callbackset) { return function(listener) { if((listener.itype & arb.type) != 0 && callbackset[0].empty_arb(listener.itype)) { var cb = _g.push_callback(listener); - cb.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_BEGIN; + cb.event = 0; zpp_$nape_phys_ZPP_$Interactor.int_callback(callbackset[0],listener,cb); cb.set = callbackset[0]; } @@ -14454,11 +14454,11 @@ zpp_$nape_space_ZPP_$Space.prototype = { } else { arb.present--; callbackset[0].remove_arb(arb); - cb1.manager.pair(cb1,cb2).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_END,(function(callbackset) { + cb1.manager.pair(cb1,cb2).forall(1,(function(callbackset) { return function(listener1) { if((listener1.itype & arb.type) != 0 && callbackset[0].empty_arb(listener1.itype)) { var cb3 = _g.push_callback(listener1); - cb3.event = zpp_$nape_util_ZPP_$Flags.id_CbEvent_END; + cb3.event = 1; zpp_$nape_phys_ZPP_$Interactor.int_callback(callbackset[0],listener1,cb3); cb3.set = callbackset[0]; } @@ -14480,7 +14480,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } var pact = arb.active; arb.active = arb.presentable = arb.up_stamp == this.stamp; - if((arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { + if((arb.immState & 1) != 0) { if(arb.active && arb.type != zpp_$nape_dynamics_ZPP_$Arbiter.SENSOR) { if(arb.colarb != null) { if(arb.colarb.preStep(dt)) arb.active = false; @@ -14610,7 +14610,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = this.f_arbiters.head; while(cx_ite != null) { var arb = cx_ite.elt; - if(arb.active && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) arb.warmStart(); + if(arb.active && (arb.immState & 1) != 0) arb.warmStart(); cx_ite = cx_ite.next; } var arbi = this.c_arbiters_false.head; @@ -14621,7 +14621,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } while(arbi != null) { var arb1 = arbi.elt; - if(arb1.active && (arb1.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) arb1.warmStart(); + if(arb1.active && (arb1.immState & 1) != 0) arb1.warmStart(); arbi = arbi.next; if(fst && arbi == null) { arbi = this.c_arbiters_true.head; @@ -14642,7 +14642,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite = this.f_arbiters.head; while(cx_ite != null) { var arb = cx_ite.elt; - if(arb.active && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) arb.applyImpulseVel(); + if(arb.active && (arb.immState & 1) != 0) arb.applyImpulseVel(); cx_ite = cx_ite.next; } var pre = null; @@ -14673,7 +14673,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } while(arbi != null) { var arb1 = arbi.elt; - if(arb1.active && (arb1.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) arb1.applyImpulseVel(); + if(arb1.active && (arb1.immState & 1) != 0) arb1.applyImpulseVel(); arbi = arbi.next; if(fst && arbi == null) { arbi = this.c_arbiters_true.head; @@ -14716,7 +14716,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } while(arbi != null) { var arb = arbi.elt; - if(arb.active && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) arb.applyImpulsePos(); + if(arb.active && (arb.immState & 1) != 0) arb.applyImpulsePos(); arbi = arbi.next; if(fst && arbi == null) { arbi = this.c_arbiters_true.head; @@ -14830,7 +14830,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { first = true; swapped = true; } else arb = xarb.fluidarb; - var inttype = zpp_$nape_util_ZPP_$Flags.id_InteractionType_FLUID; + var inttype = 4; if(first || arb.stamp != this.stamp || continuous) { arb.stamp = this.stamp; if(zpp_$nape_geom_ZPP_$Collide.flowCollide(sa,sb,arb)) { @@ -14858,8 +14858,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { arb.fresh = !swapped; } else arb.fresh = arb.up_stamp < this.stamp - 1 || arb.endGenerated == this.stamp && continuous; arb.up_stamp = arb.stamp; - if(arb.fresh || (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if(arb.fresh || (arb.immState & 4) == 0) { + arb.immState = 1; var anyimpure = false; var arbs1; if(arb.ws1.id > arb.ws2.id) arbs1 = arb.ws2; else arbs1 = arb.ws1; @@ -14882,7 +14882,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var ncallbackset = null; this.prelisteners.inlined_clear(); var lite = [null]; - cb1.manager.pair(cb1,cb2).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_PRE,(function(lite) { + cb1.manager.pair(cb1,cb2).forall(5,(function(lite) { return function(listener) { if((listener.itype & inttype) != 0) { lite[0] = _g.prelisteners.inlined_insert(lite[0],listener); @@ -14899,13 +14899,13 @@ zpp_$nape_space_ZPP_$Space.prototype = { ncallbackset = zpp_$nape_space_ZPP_$CallbackSet.get(i1,i2); this.add_callbackset(ncallbackset); } - if(callbackset == null || (callbackset.FLUIDstamp != this.stamp || continuous) && (callbackset.FLUIDstate & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { + if(callbackset == null || (callbackset.FLUIDstamp != this.stamp || continuous) && (callbackset.FLUIDstate & 4) == 0) { if(ncallbackset != null) callbackset = ncallbackset; if(callbackset != null) { var cx_ite3 = this.prelisteners.head; while(cx_ite3 != null) { var listener1 = cx_ite3.elt; - if(listener1.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener1.itype == 7) { callbackset.COLLISIONstamp = this.stamp; callbackset.SENSORstamp = this.stamp; callbackset.FLUIDstamp = this.stamp; @@ -14936,7 +14936,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT; return $r; - }(this))) arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else if(ret2 == (function($this) { + }(this))) arb.immState = 5; else if(ret2 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -14945,7 +14945,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE; return $r; - }(this))) arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; else if(ret2 == (function($this) { + }(this))) arb.immState = 1; else if(ret2 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -14954,7 +14954,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE; return $r; - }(this))) arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE; + }(this))) arb.immState = 6; else arb.immState = 2; cx_ite4 = cx_ite4.next; } arb.mutable = false; @@ -14964,7 +14964,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite5 = this.prelisteners.head; while(cx_ite5 != null) { var listener3 = cx_ite5.elt; - if(listener3.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener3.itype == 7) { callbackset.COLLISIONstate = arb.immState; callbackset.SENSORstate = arb.immState; callbackset.FLUIDstate = arb.immState; @@ -14973,45 +14973,45 @@ zpp_$nape_space_ZPP_$Space.prototype = { } } } else if(callbackset == null) { - if((arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) arb.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if((arb.immState & 4) == 0) arb.immState = 1; } else arb.immState = callbackset.FLUIDstate; cx_ite2 = cx_ite2.next; } cx_ite1 = cx_ite1.next; } - if(anyimpure && (arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - if(arb.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(anyimpure && (arb.immState & 4) == 0) { + if(arb.b1.type == 2) { var o = arb.b1; if(!o.world) { o.component.waket = this.stamp + (this.midstep?0:1); - if(o.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o.kinematicDelaySleep = true; + if(o.type == 3) o.kinematicDelaySleep = true; if(o.component.sleeping) this.really_wake(o,false); } } - if(arb.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(arb.b1.type == 2) { var o1 = arb.b2; if(!o1.world) { o1.component.waket = this.stamp + (this.midstep?0:1); - if(o1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o1.kinematicDelaySleep = true; + if(o1.type == 3) o1.kinematicDelaySleep = true; if(o1.component.sleeping) this.really_wake(o1,false); } } } } - if((arb.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { - if(arb.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb.b1.component.sleeping) { + if((arb.immState & 1) != 0) { + if(arb.b1.type == 2 && arb.b1.component.sleeping) { var o2 = arb.b1; if(!o2.world) { o2.component.waket = this.stamp + (this.midstep?0:1); - if(o2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o2.kinematicDelaySleep = true; + if(o2.type == 3) o2.kinematicDelaySleep = true; if(o2.component.sleeping) this.really_wake(o2,false); } } - if(arb.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb.b2.component.sleeping) { + if(arb.b2.type == 2 && arb.b2.component.sleeping) { var o3 = arb.b2; if(!o3.world) { o3.component.waket = this.stamp + (this.midstep?0:1); - if(o3.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o3.kinematicDelaySleep = true; + if(o3.type == 3) o3.kinematicDelaySleep = true; if(o3.component.sleeping) this.really_wake(o3,false); } } @@ -15089,7 +15089,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } } } - var inttype1 = zpp_$nape_util_ZPP_$Flags.id_InteractionType_COLLISION; + var inttype1 = 1; if(first1 || arb2.stamp != this.stamp || continuous) { arb2.stamp = this.stamp; if(zpp_$nape_geom_ZPP_$Collide.contactCollide(sa,sb,arb2,reverse)) { @@ -15122,8 +15122,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { arb2.fresh = !swapped1; } else arb2.fresh = arb2.up_stamp < this.stamp - 1 || arb2.endGenerated == this.stamp && continuous; arb2.up_stamp = arb2.stamp; - if(arb2.fresh || (arb2.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if(arb2.fresh || (arb2.immState & 4) == 0) { + arb2.immState = 1; var anyimpure1 = false; var arbs11; if(arb2.ws1.id > arb2.ws2.id) arbs11 = arb2.ws2; else arbs11 = arb2.ws1; @@ -15146,7 +15146,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var ncallbackset1 = null; this.prelisteners.inlined_clear(); var lite1 = [null]; - cb11.manager.pair(cb11,cb21).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_PRE,(function(lite1) { + cb11.manager.pair(cb11,cb21).forall(5,(function(lite1) { return function(listener4) { if((listener4.itype & inttype1) != 0) { lite1[0] = _g.prelisteners.inlined_insert(lite1[0],listener4); @@ -15163,13 +15163,13 @@ zpp_$nape_space_ZPP_$Space.prototype = { ncallbackset1 = zpp_$nape_space_ZPP_$CallbackSet.get(i11,i21); this.add_callbackset(ncallbackset1); } - if(callbackset1 == null || (callbackset1.COLLISIONstamp != this.stamp || continuous) && (callbackset1.COLLISIONstate & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { + if(callbackset1 == null || (callbackset1.COLLISIONstamp != this.stamp || continuous) && (callbackset1.COLLISIONstate & 4) == 0) { if(ncallbackset1 != null) callbackset1 = ncallbackset1; if(callbackset1 != null) { var cx_ite9 = this.prelisteners.head; while(cx_ite9 != null) { var listener5 = cx_ite9.elt; - if(listener5.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener5.itype == 7) { callbackset1.COLLISIONstamp = this.stamp; callbackset1.SENSORstamp = this.stamp; callbackset1.FLUIDstamp = this.stamp; @@ -15202,7 +15202,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT; return $r; - }(this))) arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else if(ret4 == (function($this) { + }(this))) arb2.immState = 5; else if(ret4 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -15211,7 +15211,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE; return $r; - }(this))) arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; else if(ret4 == (function($this) { + }(this))) arb2.immState = 1; else if(ret4 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -15220,7 +15220,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE; return $r; - }(this))) arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE; + }(this))) arb2.immState = 6; else arb2.immState = 2; cx_ite10 = cx_ite10.next; } arb2.mutable = false; @@ -15231,7 +15231,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite11 = this.prelisteners.head; while(cx_ite11 != null) { var listener7 = cx_ite11.elt; - if(listener7.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener7.itype == 7) { callbackset1.COLLISIONstate = arb2.immState; callbackset1.SENSORstate = arb2.immState; callbackset1.FLUIDstate = arb2.immState; @@ -15240,45 +15240,45 @@ zpp_$nape_space_ZPP_$Space.prototype = { } } } else if(callbackset1 == null) { - if((arb2.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) arb2.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if((arb2.immState & 4) == 0) arb2.immState = 1; } else arb2.immState = callbackset1.COLLISIONstate; cx_ite8 = cx_ite8.next; } cx_ite7 = cx_ite7.next; } - if(anyimpure1 && (arb2.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - if(arb2.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(anyimpure1 && (arb2.immState & 4) == 0) { + if(arb2.b1.type == 2) { var o5 = arb2.b1; if(!o5.world) { o5.component.waket = this.stamp + (this.midstep?0:1); - if(o5.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o5.kinematicDelaySleep = true; + if(o5.type == 3) o5.kinematicDelaySleep = true; if(o5.component.sleeping) this.really_wake(o5,false); } } - if(arb2.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) { + if(arb2.b1.type == 2) { var o6 = arb2.b2; if(!o6.world) { o6.component.waket = this.stamp + (this.midstep?0:1); - if(o6.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o6.kinematicDelaySleep = true; + if(o6.type == 3) o6.kinematicDelaySleep = true; if(o6.component.sleeping) this.really_wake(o6,false); } } } } - if((arb2.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT) != 0) { - if(arb2.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb2.b1.component.sleeping) { + if((arb2.immState & 1) != 0) { + if(arb2.b1.type == 2 && arb2.b1.component.sleeping) { var o7 = arb2.b1; if(!o7.world) { o7.component.waket = this.stamp + (this.midstep?0:1); - if(o7.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o7.kinematicDelaySleep = true; + if(o7.type == 3) o7.kinematicDelaySleep = true; if(o7.component.sleeping) this.really_wake(o7,false); } } - if(arb2.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC && arb2.b2.component.sleeping) { + if(arb2.b2.type == 2 && arb2.b2.component.sleeping) { var o8 = arb2.b2; if(!o8.world) { o8.component.waket = this.stamp + (this.midstep?0:1); - if(o8.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o8.kinematicDelaySleep = true; + if(o8.type == 3) o8.kinematicDelaySleep = true; if(o8.component.sleeping) this.really_wake(o8,false); } } @@ -15347,7 +15347,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { first2 = true; swapped2 = true; } else arb4 = xarb2.sensorarb; - var inttype2 = zpp_$nape_util_ZPP_$Flags.id_InteractionType_SENSOR; + var inttype2 = 2; if(first2 || arb4.stamp != this.stamp || continuous) { arb4.stamp = this.stamp; if(zpp_$nape_geom_ZPP_$Collide.testCollide(sa,sb)) { @@ -15370,8 +15370,8 @@ zpp_$nape_space_ZPP_$Space.prototype = { arb4.fresh = !swapped2; } else arb4.fresh = arb4.up_stamp < this.stamp - 1 || arb4.endGenerated == this.stamp && continuous; arb4.up_stamp = arb4.stamp; - if(arb4.fresh || (arb4.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if(arb4.fresh || (arb4.immState & 4) == 0) { + arb4.immState = 1; var anyimpure2 = false; var arbs12; if(arb4.ws1.id > arb4.ws2.id) arbs12 = arb4.ws2; else arbs12 = arb4.ws1; @@ -15394,7 +15394,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var ncallbackset2 = null; this.prelisteners.inlined_clear(); var lite2 = [null]; - cb12.manager.pair(cb12,cb22).forall(zpp_$nape_util_ZPP_$Flags.id_CbEvent_PRE,(function(lite2) { + cb12.manager.pair(cb12,cb22).forall(5,(function(lite2) { return function(listener8) { if((listener8.itype & inttype2) != 0) { lite2[0] = _g.prelisteners.inlined_insert(lite2[0],listener8); @@ -15411,13 +15411,13 @@ zpp_$nape_space_ZPP_$Space.prototype = { ncallbackset2 = zpp_$nape_space_ZPP_$CallbackSet.get(i12,i22); this.add_callbackset(ncallbackset2); } - if(callbackset2 == null || (callbackset2.SENSORstamp != this.stamp || continuous) && (callbackset2.SENSORstate & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { + if(callbackset2 == null || (callbackset2.SENSORstamp != this.stamp || continuous) && (callbackset2.SENSORstate & 4) == 0) { if(ncallbackset2 != null) callbackset2 = ncallbackset2; if(callbackset2 != null) { var cx_ite15 = this.prelisteners.head; while(cx_ite15 != null) { var listener9 = cx_ite15.elt; - if(listener9.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener9.itype == 7) { callbackset2.COLLISIONstamp = this.stamp; callbackset2.SENSORstamp = this.stamp; callbackset2.FLUIDstamp = this.stamp; @@ -15446,7 +15446,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT; return $r; - }(this))) arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else if(ret6 == (function($this) { + }(this))) arb4.immState = 5; else if(ret6 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -15455,7 +15455,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_ACCEPT_ONCE; return $r; - }(this))) arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; else if(ret6 == (function($this) { + }(this))) arb4.immState = 1; else if(ret6 == (function($this) { var $r; if(zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE == null) { zpp_$nape_util_ZPP_$Flags.internal = true; @@ -15464,7 +15464,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { } $r = zpp_$nape_util_ZPP_$Flags.PreFlag_IGNORE; return $r; - }(this))) arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE | zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS; else arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE; + }(this))) arb4.immState = 6; else arb4.immState = 2; cx_ite16 = cx_ite16.next; } arb4.active = pact2; @@ -15472,7 +15472,7 @@ zpp_$nape_space_ZPP_$Space.prototype = { var cx_ite17 = this.prelisteners.head; while(cx_ite17 != null) { var listener11 = cx_ite17.elt; - if(listener11.itype == zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY) { + if(listener11.itype == 7) { callbackset2.COLLISIONstate = arb4.immState; callbackset2.SENSORstate = arb4.immState; callbackset2.FLUIDstate = arb4.immState; @@ -15481,26 +15481,26 @@ zpp_$nape_space_ZPP_$Space.prototype = { } } } else if(callbackset2 == null) { - if((arb4.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) arb4.immState = zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT; + if((arb4.immState & 4) == 0) arb4.immState = 1; } else arb4.immState = callbackset2.SENSORstate; cx_ite14 = cx_ite14.next; } cx_ite13 = cx_ite13.next; } - if(anyimpure2 && (arb4.immState & zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS) == 0) { - if(!(arb4.b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(anyimpure2 && (arb4.immState & 4) == 0) { + if(!(arb4.b1.type == 1)) { var o10 = arb4.b1; if(!o10.world) { o10.component.waket = this.stamp + (this.midstep?0:1); - if(o10.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o10.kinematicDelaySleep = true; + if(o10.type == 3) o10.kinematicDelaySleep = true; if(o10.component.sleeping) this.really_wake(o10,false); } } - if(!(arb4.b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC)) { + if(!(arb4.b2.type == 1)) { var o11 = arb4.b2; if(!o11.world) { o11.component.waket = this.stamp + (this.midstep?0:1); - if(o11.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC) o11.kinematicDelaySleep = true; + if(o11.type == 3) o11.kinematicDelaySleep = true; if(o11.component.sleeping) this.really_wake(o11,false); } } @@ -15641,7 +15641,7 @@ zpp_$nape_space_ZPP_$SweepPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broadph d2 = d2.next; continue; } - if(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC && b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC) { + if(b1.type == 1 && b2.type == 1) { d2 = d2.next; continue; } @@ -15650,7 +15650,7 @@ zpp_$nape_space_ZPP_$SweepPhase.prototype = $extend(zpp_$nape_space_ZPP_$Broadph continue; } if(s1.aabb.intersectY(s2.aabb)) { - if(discrete) space.narrowPhase(s1,s2,!(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) || !(b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC),null,false); else space.continuousEvent(s1,s2,!(b1.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC) || !(b2.type == zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC),null,false); + if(discrete) space.narrowPhase(s1,s2,!(b1.type == 2) || !(b2.type == 2),null,false); else space.continuousEvent(s1,s2,!(b1.type == 2) || !(b2.type == 2),null,false); } d2 = d2.next; } @@ -16459,21 +16459,6 @@ zpp_$nape_util_ZNPList_$ZPP_$Component.prototype = { } ,__class__: zpp_$nape_util_ZNPList_$ZPP_$Component }; -var zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup = function() { - this.length = 0; - this.pushmod = false; - this.modified = false; - this.head = null; -}; -zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup.__name__ = true; -zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup.prototype = { - iterator_at: function(ind) { - var ret = this.head; - while(ind-- > 0 && ret != null) ret = ret.next; - return ret; - } - ,__class__: zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup -}; var zpp_$nape_util_ZNPList_$ZPP_$FluidArbiter = function() { this.length = 0; this.pushmod = false; @@ -16574,35 +16559,15 @@ zpp_$nape_util_ZNPList_$ZPP_$SensorArbiter.prototype = { } ,__class__: zpp_$nape_util_ZNPList_$ZPP_$SensorArbiter }; -var zpp_$nape_util_ZNPList_$ZPP_$ColArbiter = function() { +var zpp_$nape_util_ZNPList_$ZPP_$Listener = function() { this.length = 0; this.pushmod = false; this.modified = false; this.head = null; }; -zpp_$nape_util_ZNPList_$ZPP_$ColArbiter.__name__ = true; -zpp_$nape_util_ZNPList_$ZPP_$ColArbiter.prototype = { - add: function(o) { - return this.inlined_add(o); - } - ,inlined_add: function(o) { - var temp; - var ret; - if(zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool == null) ret = new zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter(); else { - ret = zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool; - zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool = ret.next; - ret.next = null; - } - null; - ret.elt = o; - temp = ret; - temp.next = this.head; - this.head = temp; - this.modified = true; - this.length++; - return o; - } - ,remove: function(obj) { +zpp_$nape_util_ZNPList_$ZPP_$Listener.__name__ = true; +zpp_$nape_util_ZNPList_$ZPP_$Listener.prototype = { + remove: function(obj) { this.inlined_try_remove(obj); } ,inlined_try_remove: function(obj) { @@ -16636,24 +16601,49 @@ zpp_$nape_util_ZNPList_$ZPP_$ColArbiter.prototype = { } var o = old; o.elt = null; - o.next = zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool; - zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool = o; + o.next = zpp_$nape_util_ZNPNode_$ZPP_$Listener.zpp_pool; + zpp_$nape_util_ZNPNode_$ZPP_$Listener.zpp_pool = o; this.modified = true; this.length--; this.pushmod = true; return ret; } - ,__class__: zpp_$nape_util_ZNPList_$ZPP_$ColArbiter + ,iterator_at: function(ind) { + var ret = this.head; + while(ind-- > 0 && ret != null) ret = ret.next; + return ret; + } + ,__class__: zpp_$nape_util_ZNPList_$ZPP_$Listener }; -var zpp_$nape_util_ZNPList_$ZPP_$Listener = function() { +var zpp_$nape_util_ZNPList_$ZPP_$ColArbiter = function() { this.length = 0; this.pushmod = false; this.modified = false; this.head = null; }; -zpp_$nape_util_ZNPList_$ZPP_$Listener.__name__ = true; -zpp_$nape_util_ZNPList_$ZPP_$Listener.prototype = { - remove: function(obj) { +zpp_$nape_util_ZNPList_$ZPP_$ColArbiter.__name__ = true; +zpp_$nape_util_ZNPList_$ZPP_$ColArbiter.prototype = { + add: function(o) { + return this.inlined_add(o); + } + ,inlined_add: function(o) { + var temp; + var ret; + if(zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool == null) ret = new zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter(); else { + ret = zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool; + zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool = ret.next; + ret.next = null; + } + null; + ret.elt = o; + temp = ret; + temp.next = this.head; + this.head = temp; + this.modified = true; + this.length++; + return o; + } + ,remove: function(obj) { this.inlined_try_remove(obj); } ,inlined_try_remove: function(obj) { @@ -16687,19 +16677,29 @@ zpp_$nape_util_ZNPList_$ZPP_$Listener.prototype = { } var o = old; o.elt = null; - o.next = zpp_$nape_util_ZNPNode_$ZPP_$Listener.zpp_pool; - zpp_$nape_util_ZNPNode_$ZPP_$Listener.zpp_pool = o; + o.next = zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool; + zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.zpp_pool = o; this.modified = true; this.length--; this.pushmod = true; return ret; } - ,iterator_at: function(ind) { + ,__class__: zpp_$nape_util_ZNPList_$ZPP_$ColArbiter +}; +var zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup = function() { + this.length = 0; + this.pushmod = false; + this.modified = false; + this.head = null; +}; +zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup.__name__ = true; +zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup.prototype = { + iterator_at: function(ind) { var ret = this.head; while(ind-- > 0 && ret != null) ret = ret.next; return ret; } - ,__class__: zpp_$nape_util_ZNPList_$ZPP_$Listener + ,__class__: zpp_$nape_util_ZNPList_$ZPP_$InteractionGroup }; var zpp_$nape_util_ZNPList_$ZPP_$ToiEvent = function() { this.length = 0; @@ -16872,6 +16872,14 @@ zpp_$nape_util_ZNPNode_$ZPP_$Compound.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$Compound.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$Compound }; +var zpp_$nape_util_ZNPNode_$ZPP_$Arbiter = function() { + this.elt = null; + this.next = null; +}; +zpp_$nape_util_ZNPNode_$ZPP_$Arbiter.__name__ = true; +zpp_$nape_util_ZNPNode_$ZPP_$Arbiter.prototype = { + __class__: zpp_$nape_util_ZNPNode_$ZPP_$Arbiter +}; var zpp_$nape_util_ZNPNode_$ZPP_$InteractionListener = function() { this.elt = null; this.next = null; @@ -16904,13 +16912,13 @@ zpp_$nape_util_ZNPNode_$ZPP_$BodyListener.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$BodyListener.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$BodyListener }; -var zpp_$nape_util_ZNPNode_$ZPP_$Arbiter = function() { +var zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair = function() { this.elt = null; this.next = null; }; -zpp_$nape_util_ZNPNode_$ZPP_$Arbiter.__name__ = true; -zpp_$nape_util_ZNPNode_$ZPP_$Arbiter.prototype = { - __class__: zpp_$nape_util_ZNPNode_$ZPP_$Arbiter +zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair.__name__ = true; +zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair.prototype = { + __class__: zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair }; var zpp_$nape_util_ZNPNode_$ZPP_$ConstraintListener = function() { this.elt = null; @@ -16920,13 +16928,13 @@ zpp_$nape_util_ZNPNode_$ZPP_$ConstraintListener.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$ConstraintListener.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$ConstraintListener }; -var zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair = function() { +var zpp_$nape_util_ZNPNode_$ZPP_$Vec2 = function() { this.elt = null; this.next = null; }; -zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair.__name__ = true; -zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair.prototype = { - __class__: zpp_$nape_util_ZNPNode_$ZPP_$CbSetPair +zpp_$nape_util_ZNPNode_$ZPP_$Vec2.__name__ = true; +zpp_$nape_util_ZNPNode_$ZPP_$Vec2.prototype = { + __class__: zpp_$nape_util_ZNPNode_$ZPP_$Vec2 }; var zpp_$nape_util_ZNPNode_$ZPP_$AABBPair = function() { this.elt = null; @@ -16944,14 +16952,6 @@ zpp_$nape_util_ZNPNode_$ZPP_$Edge.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$Edge.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$Edge }; -var zpp_$nape_util_ZNPNode_$ZPP_$Vec2 = function() { - this.elt = null; - this.next = null; -}; -zpp_$nape_util_ZNPNode_$ZPP_$Vec2.__name__ = true; -zpp_$nape_util_ZNPNode_$ZPP_$Vec2.prototype = { - __class__: zpp_$nape_util_ZNPNode_$ZPP_$Vec2 -}; var zpp_$nape_util_ZNPNode_$ZPP_$Component = function() { this.elt = null; this.next = null; @@ -16960,14 +16960,6 @@ zpp_$nape_util_ZNPNode_$ZPP_$Component.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$Component.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$Component }; -var zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup = function() { - this.elt = null; - this.next = null; -}; -zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup.__name__ = true; -zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup.prototype = { - __class__: zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup -}; var zpp_$nape_util_ZNPNode_$ZPP_$FluidArbiter = function() { this.elt = null; this.next = null; @@ -16984,6 +16976,14 @@ zpp_$nape_util_ZNPNode_$ZPP_$SensorArbiter.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$SensorArbiter.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$SensorArbiter }; +var zpp_$nape_util_ZNPNode_$ZPP_$Listener = function() { + this.elt = null; + this.next = null; +}; +zpp_$nape_util_ZNPNode_$ZPP_$Listener.__name__ = true; +zpp_$nape_util_ZNPNode_$ZPP_$Listener.prototype = { + __class__: zpp_$nape_util_ZNPNode_$ZPP_$Listener +}; var zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter = function() { this.elt = null; this.next = null; @@ -16992,13 +16992,13 @@ zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.__name__ = true; zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter.prototype = { __class__: zpp_$nape_util_ZNPNode_$ZPP_$ColArbiter }; -var zpp_$nape_util_ZNPNode_$ZPP_$Listener = function() { +var zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup = function() { this.elt = null; this.next = null; }; -zpp_$nape_util_ZNPNode_$ZPP_$Listener.__name__ = true; -zpp_$nape_util_ZNPNode_$ZPP_$Listener.prototype = { - __class__: zpp_$nape_util_ZNPNode_$ZPP_$Listener +zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup.__name__ = true; +zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup.prototype = { + __class__: zpp_$nape_util_ZNPNode_$ZPP_$InteractionGroup }; var zpp_$nape_util_ZNPNode_$ZPP_$ToiEvent = function() { this.elt = null; @@ -18224,35 +18224,6 @@ zpp_$nape_callbacks_ZPP_$CbType.ANY_BODY = new nape_callbacks_CbType(); zpp_$nape_callbacks_ZPP_$CbType.ANY_COMPOUND = new nape_callbacks_CbType(); zpp_$nape_callbacks_ZPP_$CbType.ANY_CONSTRAINT = new nape_callbacks_CbType(); zpp_$nape_util_ZPP_$Flags.internal = false; -zpp_$nape_util_ZPP_$Flags.id_ImmState_ACCEPT = 1; -zpp_$nape_util_ZPP_$Flags.id_ImmState_IGNORE = 2; -zpp_$nape_util_ZPP_$Flags.id_ImmState_ALWAYS = 4; -zpp_$nape_util_ZPP_$Flags.id_GravMassMode_DEFAULT = 0; -zpp_$nape_util_ZPP_$Flags.id_GravMassMode_FIXED = 1; -zpp_$nape_util_ZPP_$Flags.id_GravMassMode_SCALED = 2; -zpp_$nape_util_ZPP_$Flags.id_InertiaMode_DEFAULT = 0; -zpp_$nape_util_ZPP_$Flags.id_MassMode_DEFAULT = 0; -zpp_$nape_util_ZPP_$Flags.id_BodyType_STATIC = 1; -zpp_$nape_util_ZPP_$Flags.id_BodyType_DYNAMIC = 2; -zpp_$nape_util_ZPP_$Flags.id_BodyType_KINEMATIC = 3; -zpp_$nape_util_ZPP_$Flags.id_ListenerType_BODY = 0; -zpp_$nape_util_ZPP_$Flags.id_ListenerType_CONSTRAINT = 1; -zpp_$nape_util_ZPP_$Flags.id_PreFlag_ACCEPT = 1; -zpp_$nape_util_ZPP_$Flags.id_ListenerType_INTERACTION = 2; -zpp_$nape_util_ZPP_$Flags.id_ListenerType_PRE = 3; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_BEGIN = 0; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_ONGOING = 6; -zpp_$nape_util_ZPP_$Flags.id_InteractionType_COLLISION = 1; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_END = 1; -zpp_$nape_util_ZPP_$Flags.id_InteractionType_SENSOR = 2; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_WAKE = 2; -zpp_$nape_util_ZPP_$Flags.id_InteractionType_FLUID = 4; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_SLEEP = 3; -zpp_$nape_util_ZPP_$Flags.id_InteractionType_ANY = 7; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_BREAK = 4; -zpp_$nape_util_ZPP_$Flags.id_CbEvent_PRE = 5; -zpp_$nape_util_ZPP_$Flags.id_ShapeType_CIRCLE = 0; -zpp_$nape_util_ZPP_$Flags.id_ShapeType_POLYGON = 1; zpp_$nape_callbacks_ZPP_$InteractionListener.UCbSet = new zpp_$nape_util_ZNPList_$ZPP_$CbSet(); zpp_$nape_callbacks_ZPP_$InteractionListener.VCbSet = new zpp_$nape_util_ZNPList_$ZPP_$CbSet(); zpp_$nape_callbacks_ZPP_$InteractionListener.WCbSet = new zpp_$nape_util_ZNPList_$ZPP_$CbSet(); diff --git a/samples/_output/nape.js.map b/samples/_output/nape.js.map index cbf2f7fd..86fcf48a 100644 --- a/samples/_output/nape.js.map +++ b/samples/_output/nape.js.map @@ -2,8 +2,8 @@ "version":3, "file":"nape.js", "sourceRoot":"file:///", -"sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/usr/local/lib/haxe/std/haxe/Timer.hx","/usr/local/lib/haxe/std/js/Boot.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/Callback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/BodyCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/Listener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/BodyListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/CbEvent.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/CbType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/CbTypeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/CbTypeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/ConstraintCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/ConstraintListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/InteractionCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/InteractionListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/InteractionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/ListenerIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/ListenerList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/ListenerType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/OptionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/PreCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/PreFlag.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/callbacks/PreListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/constraint/Constraint.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/constraint/ConstraintIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/constraint/ConstraintList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/Arbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/ArbiterIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/ArbiterList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/ArbiterType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/CollisionArbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/Contact.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/ContactIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/ContactList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/FluidArbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/InteractionFilter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/InteractionGroup.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/InteractionGroupIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/dynamics/InteractionGroupList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/AABB.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/ConvexResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/ConvexResultIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/ConvexResultList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/GeomPoly.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/GeomPolyIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/GeomPolyList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Mat23.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/MatMN.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/RayResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/RayResultIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/RayResultList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Vec2.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Vec2Iterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Vec2List.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Vec3.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/geom/Winding.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/Interactor.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/Body.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/BodyIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/BodyList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/BodyType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/Compound.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/CompoundIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/CompoundList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/FluidProperties.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/GravMassMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/InertiaMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/InteractorIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/InteractorList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/MassMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/phys/Material.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/Shape.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/Circle.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/Edge.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/EdgeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/EdgeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/Polygon.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/ShapeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/ShapeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/ShapeType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/shape/ValidationResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/space/Broadphase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/space/Space.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/nape/Main.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/ID.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/Callback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/CbSet.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/CbSetPair.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/util/Lists.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/CbType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/Listener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/callbacks/OptionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/constraint/Constraint.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/dynamics/Arbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/dynamics/Contact.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/dynamics/InteractionFilter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/dynamics/InteractionGroup.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/AABB.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/Collide.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/ConvexRayResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/GeomPoly.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/Mat23.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/MatMN.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/SweepDistance.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/Vec2.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/Vec3.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/geom/VecMath.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/phys/Interactor.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/phys/Body.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/phys/Compound.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/phys/FluidProperties.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/phys/Material.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/shape/Shape.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/shape/Circle.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/shape/Edge.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/shape/Polygon.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/space/Broadphase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/space/DynAABBPhase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/space/Space.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/space/SweepPhase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/util/Math.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/util/RBTree.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/nape/Config.hx","/projects/pixi-haxe/.haxelib/nape/2,0,19/zpp_nape/util/Flags.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2013 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage haxe;\n\n/**\n\tThe Timer class allows you to create asynchronous timers on platforms that\n\tsupport events.\n\n\tThe intended usage is to create an instance of the Timer class with a given\n\tinterval, set its run() method to a custom function to be invoked and\n\teventually call stop() to stop the Timer.\n\n\tNote that a running Timer may or may not prevent the program to exit\n\tautomatically when main() returns.\n\n\tIt is also possible to extend this class and override its run() method in\n\tthe child class.\n**/\nclass Timer {\n\t#if (flash || js || java || python)\n\n\t#if (flash || js)\n\t\tprivate var id : Null;\n\t#elseif java\n\t\tprivate var timer : java.util.Timer;\n\t\tprivate var task : java.util.TimerTask;\n\t#end\n\n\t/**\n\t\tCreates a new timer that will run every `time_ms` milliseconds.\n\n\t\tAfter creating the Timer instance, it calls `this].run` repeatedly,\n\t\twith delays of `time_ms` milliseconds, until `this.stop` is called.\n\n\t\tThe first invocation occurs after `time_ms` milliseconds, not\n\t\timmediately.\n\n\t\tThe accuracy of this may be platform-dependent.\n\t**/\n\tpublic function new( time_ms : Int ){\n\t\t#if flash\n\t\t\tvar me = this;\n\t\t\tid = untyped __global__[\"flash.utils.setInterval\"](function() { me.run(); },time_ms);\n\t\t#elseif js\n\t\t\tvar me = this;\n\t\t\tid = untyped setInterval(function() me.run(),time_ms);\n\t\t#elseif java\n\t\t\ttimer = new java.util.Timer();\n\t\t\ttimer.scheduleAtFixedRate(task = new TimerTask(this), haxe.Int64.ofInt(time_ms), haxe.Int64.ofInt(time_ms));\n\t\t#end\n\t}\n\n\t/**\n\t\tStops `this` Timer.\n\n\t\tAfter calling this method, no additional invocations of `this.run`\n\t\twill occur.\n\n\t\tIt is not possible to restart `this` Timer once stopped.\n\t**/\n\tpublic function stop() {\n\t\t#if (flash || js)\n\t\t\tif( id == null )\n\t\t\t\treturn;\n\t\t\t#if flash\n\t\t\t\tuntyped __global__[\"flash.utils.clearInterval\"](id);\n\t\t\t#elseif js\n\t\t\t\tuntyped clearInterval(id);\n\t\t\t#end\n\t\t\tid = null;\n\t\t#elseif java\n\t\t\ttimer.cancel();\n\t\t\ttimer = null;\n\t\t\ttask = null;\n\t\t#end\n\t}\n\n\t/**\n\t\tThis method is invoked repeatedly on `this` Timer.\n\n\t\tIt can be overridden in a subclass, or rebound directly to a custom\n\t\tfunction:\n\t\t\tvar timer = new haxe.Timer(1000); // 1000ms delay\n\t\t\ttimer.run = function() { ... }\n\n\t\tOnce bound, it can still be rebound to different functions until `this`\n\t\tTimer is stopped through a call to `this.stop`.\n\t**/\n\tpublic dynamic function run() {\n\n\t}\n\n\t/**\n\t\tInvokes `f` after `time_ms` milliseconds.\n\n\t\tThis is a convenience function for creating a new Timer instance with\n\t\t`time_ms` as argument, binding its run() method to `f` and then stopping\n\t\t`this` Timer upon the first invocation.\n\n\t\tIf `f` is null, the result is unspecified.\n\t**/\n\tpublic static function delay( f : Void -> Void, time_ms : Int ) {\n\t\tvar t = new haxe.Timer(time_ms);\n\t\tt.run = function() {\n\t\t\tt.stop();\n\t\t\tf();\n\t\t};\n\t\treturn t;\n\t}\n\n\t#end\n\n\t/**\n\t\tMeasures the time it takes to execute `f`, in seconds with fractions.\n\n\t\tThis is a convenience function for calculating the difference between\n\t\tTimer.stamp() before and after the invocation of `f`.\n\n\t\tThe difference is passed as argument to Log.trace(), with \"s\" appended\n\t\tto denote the unit. The optional `pos` argument is passed through.\n\n\t\tIf `f` is null, the result is unspecified.\n\t**/\n\tpublic static function measure( f : Void -> T, ?pos : PosInfos ) : T {\n\t\tvar t0 = stamp();\n\t\tvar r = f();\n\t\tLog.trace((stamp() - t0) + \"s\", pos);\n\t\treturn r;\n\t}\n\n\t/**\n\t\tReturns a timestamp, in seconds with fractions.\n\n\t\tThe value itself might differ depending on platforms, only differences\n\t\tbetween two values make sense.\n\t**/\n\tpublic static function stamp() : Float {\n\t\t#if flash\n\t\t\treturn flash.Lib.getTimer() / 1000;\n\t\t#elseif (neko || php)\n\t\t\treturn Sys.time();\n\t\t#elseif js\n\t\t\treturn Date.now().getTime() / 1000;\n\t\t#elseif cpp\n\t\t\treturn untyped __global__.__time_stamp();\n\t\t#elseif sys\n\t\t\treturn Sys.time();\n\t\t#else\n\t\t\treturn 0;\n\t\t#end\n\t}\n\n}\n\n#if java\n@:nativeGen\nprivate class TimerTask extends java.util.TimerTask {\n\tvar timer:Timer;\n\tpublic function new(timer:Timer):Void {\n\t\tsuper();\n\t\tthis.timer = timer;\n\t}\n\n\t@:overload override public function run():Void {\n\t\ttimer.run();\n\t}\n}\n#end\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for Callback event objects.\n *

\n * Callback objects are automatically reused and you should not keep references\n * to them.\n */\n#if nape_swc@:keep #end\nclass Callback{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Callback=null;\n /**\n * CbEvent type this callback was generated for.\n */\n #if nape_swc@:isVar #end\n public var event(get_event,never):CbEvent;\n inline function get_event():CbEvent{\n return ZPP_Listener.events[zpp_inner.event];\n }\n /**\n * The Listener which was responsive for this callback being generated.\n */\n #if nape_swc@:isVar #end\n public var listener(get_listener,never):Listener;\n inline function get_listener():Listener{\n return zpp_inner.listener.outer;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Callback.internal){\n throw \"Error: Callback cannot be instantiated derp!\";\n }\n #end\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"\";\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Body type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass BodyCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Body involved in callback event.\n */\n #if nape_swc@:isVar #end\n public var body(get_body,never):Body;\n inline function get_body():Body{\n return zpp_inner.body.outer;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"WAKE\",\"SLEEP\"][zpp_inner.event-ZPP_Flags.id_CbEvent_WAKE];\n ret+=\":\"+body.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for all Nape callback listeners.\n */\n#if nape_swc@:keep #end\nclass Listener{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Listener=null;\n /**\n * The sub-type of this listener.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ListenerType;\n inline function get_type():ListenerType{\n return ZPP_Listener.types[zpp_inner.type];\n }\n /**\n * The CbEvent this listener responds to.\n */\n #if nape_swc@:isVar #end\n public var event(get_event,set_event):CbEvent;\n inline function get_event():CbEvent{\n return ZPP_Listener.events[zpp_inner.event];\n }\n inline function set_event(event:CbEvent):CbEvent{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(event==null){\n throw \"Error: Cannot set listener event type to null\";\n }\n #end\n if(this.event!=event){\n var xevent=if(event==CbEvent.BEGIN)ZPP_Flags.id_CbEvent_BEGIN else if(event==CbEvent.ONGOING)ZPP_Flags.id_CbEvent_ONGOING else if(event==CbEvent.END)ZPP_Flags.id_CbEvent_END else if(event==CbEvent.SLEEP)ZPP_Flags.id_CbEvent_SLEEP else if(event==CbEvent.WAKE)ZPP_Flags.id_CbEvent_WAKE else if(event==CbEvent.PRE)ZPP_Flags.id_CbEvent_PRE else ZPP_Flags.id_CbEvent_BREAK;\n zpp_inner.swapEvent(xevent);\n }\n }\n return get_event();\n }\n /**\n * The precedence of this listener.\n *

\n * In any case that there is more than one suitable listener for a situation,\n * the listeners will be ordered by their precedence.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var precedence(get_precedence,set_precedence):Int;\n inline function get_precedence():Int{\n return zpp_inner.precedence;\n }\n inline function set_precedence(precedence:Int):Int{\n {\n if(this.precedence!=precedence){\n zpp_inner.precedence=precedence;\n zpp_inner.invalidate_precedence();\n }\n }\n return get_precedence();\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Listener.internal){\n throw \"Error: Cannot instantiate Listener derp!\";\n }\n #end\n }\n /**\n * The Space this listener is assigned to.\n *

\n * This value can be set, with setting to null being equivalent to removing\n * the listener from whichever Space it is presently assigned to.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n if(this.space!=space){\n if(zpp_inner.space!=null){\n zpp_inner.space.outer.listeners.remove(this);\n }\n if(space!=null){\n space.listeners.add(this);\n }\n else{\n zpp_inner.space=null;\n }\n }\n }\n return get_space();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var event=[\"BEGIN\",\"END\",\"WAKE\",\"SLEEP\",\"BREAK\",\"PRE\",\"ONGOING\"][zpp_inner.event];\n if(zpp_inner.type==ZPP_Flags.id_ListenerType_BODY){\n var body=zpp_inner.body;\n return \"BodyListener{\"+event+\"::\"+body.outer_zn.options+\"}\";\n }\n else if(zpp_inner.type==ZPP_Flags.id_ListenerType_CONSTRAINT){\n var con=zpp_inner.constraint;\n return \"ConstraintListener{\"+event+\"::\"+con.outer_zn.options+\"}\";\n }\n else{\n var con=zpp_inner.interaction;\n var itype=switch(con.itype){\n case ZPP_Flags.id_InteractionType_COLLISION:\"COLLISION\";\n case ZPP_Flags.id_InteractionType_SENSOR:\"SENSOR\";\n case ZPP_Flags.id_InteractionType_FLUID:\"FLUID\";\n default:\"ALL\";\n }\n return(if(zpp_inner.type==ZPP_Flags.id_ListenerType_INTERACTION)\"InteractionListener{\"+event+\"#\"+itype+\"::\"+con.outer_zni.options1+\":\"+con.outer_zni.options2+\"}\" else \"PreListener{\"+itype+\"::\"+con.outer_znp.options1+\":\"+con.outer_znp.options2+\"}\")+\" precedence=\"+zpp_inner.precedence;\n }\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Body type events.\n *

\n * The events that can be caught are WAKE and SLEEP type events.\n * Theses listeners will only operate on Bodys, not Interactors in general.\n */\n@:final#if nape_swc@:keep #end\nclass BodyListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_BodyListener=null;\n /**\n * The OptionType used to match against Bodies.\n *

\n * When added to the same Space, any Body who's CbType list matches\n * against this OptionType will be issued a callback when the relevant\n * event occurs.\n */\n #if nape_swc@:isVar #end\n public var options(get_options,set_options):OptionType;\n inline function get_options():OptionType{\n return zpp_inner_zn.options.outer;\n }\n inline function set_options(options:OptionType):OptionType{\n {\n zpp_inner_zn.options.set(options.zpp_inner);\n }\n return get_options();\n }\n /**\n * The callback handler for this listener.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):BodyCallback->Void;\n inline function get_handler():BodyCallback->Void{\n return zpp_inner_zn.handler;\n }\n inline function set_handler(handler:BodyCallback->Void):BodyCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: BodyListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handler=handler;\n }\n return get_handler();\n }\n /**\n * Construct a new BodyListener.\n *

\n * The possible event types are WAKE and SLEEP.\n *

\n * The options argument is typed Dynamic, and is permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param options The OptionType to match Bodys against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @return The newly constructed BodyListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If options is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,options:Null,handler:BodyCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: BodyListener::handler cannot be null\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.WAKE)xevent=ZPP_Flags.id_CbEvent_WAKE;\n else if(event==CbEvent.SLEEP)xevent=ZPP_Flags.id_CbEvent_SLEEP;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: cbEvent '\"+event.toString()+\"' is not a valid event type for a BodyListener\";\n #end\n }\n zpp_inner_zn=new ZPP_BodyListener(ZPP_OptionType.argument(options),xevent,handler);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner.precedence=precedence;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of possible callback event types.\n */\n@:final#if nape_swc@:keep #end\nclass CbEvent{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"CbEvent\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==PRE)return\"PRE\";\n else if(this==BEGIN)return\"BEGIN\";\n else if(this==ONGOING)return\"ONGOING\";\n else if(this==END)return\"END\";\n else if(this==WAKE)return\"WAKE\";\n else if(this==SLEEP)return\"SLEEP\";\n else if(this==BREAK)return\"BREAK\";\n else return \"\";\n }\n /**\n * BEGIN event corresponds to the start of an interaction\n */\n #if nape_swc@:isVar #end\n public static var BEGIN(get_BEGIN,never):CbEvent;\n inline static function get_BEGIN(){\n if(ZPP_Flags.CbEvent_BEGIN==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_BEGIN=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_BEGIN;\n }\n /**\n * ONGOING event corresponds to any step in which an interaction is occuring\n * overlapping with the BEGIN event.\n */\n #if nape_swc@:isVar #end\n public static var ONGOING(get_ONGOING,never):CbEvent;\n inline static function get_ONGOING(){\n if(ZPP_Flags.CbEvent_ONGOING==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_ONGOING=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_ONGOING;\n }\n /**\n * END event corresponds to the end of an interaction.\n */\n #if nape_swc@:isVar #end\n public static var END(get_END,never):CbEvent;\n inline static function get_END(){\n if(ZPP_Flags.CbEvent_END==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_END=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_END;\n }\n /**\n * WAKE event corresponds to the waking of a Body or Constraint in the space.\n */\n #if nape_swc@:isVar #end\n public static var WAKE(get_WAKE,never):CbEvent;\n inline static function get_WAKE(){\n if(ZPP_Flags.CbEvent_WAKE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_WAKE=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_WAKE;\n }\n /**\n * SLEEP event corresponds to the sleeping of a Body or Constraint in the space.\n */\n #if nape_swc@:isVar #end\n public static var SLEEP(get_SLEEP,never):CbEvent;\n inline static function get_SLEEP(){\n if(ZPP_Flags.CbEvent_SLEEP==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_SLEEP=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_SLEEP;\n }\n /**\n * BREAK event corresponds to the breaking of a defined limit on a Constraint.\n */\n #if nape_swc@:isVar #end\n public static var BREAK(get_BREAK,never):CbEvent;\n inline static function get_BREAK(){\n if(ZPP_Flags.CbEvent_BREAK==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_BREAK=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_BREAK;\n }\n /**\n * PRE event corresponds to a special mid-step event that occurs after it is determined\n * that two objects 'will' begin to interact, but before any interaction commences.\n */\n #if nape_swc@:isVar #end\n public static var PRE(get_PRE,never):CbEvent;\n inline static function get_PRE(){\n if(ZPP_Flags.CbEvent_PRE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_PRE=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_PRE;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback Type applied to Interactors and Constraints.\n *

\n * Callback types are ranged over by listeners.\n */\n@:final#if nape_swc@:keep #end\nclass CbType{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CbType=null;\n /**\n * Unique identifier for this CbType.\n */\n #if nape_swc@:isVar #end\n public var id(get_id,never):Int;\n inline function get_id():Int{\n return zpp_inner.id;\n }\n /**\n * Construct a new CbType object.\n *\n * @return A new CbType.\n */\n public function new(){\n zpp_inner=new ZPP_CbType();\n zpp_inner.outer=this;\n }\n \n /**\n * Default CbType given to all Bodys\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Bodys\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_BODY(get_ANY_BODY,never):CbType;\n inline static function get_ANY_BODY():CbType{\n return ZPP_CbType.ANY_BODY;\n }\n /**\n * Default CbType given to all Constraints\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Constraints\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_CONSTRAINT(get_ANY_CONSTRAINT,never):CbType;\n inline static function get_ANY_CONSTRAINT():CbType{\n return ZPP_CbType.ANY_CONSTRAINT;\n }\n /**\n * Default CbType given to all Shapes\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Shapes\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_SHAPE(get_ANY_SHAPE,never):CbType;\n inline static function get_ANY_SHAPE():CbType{\n return ZPP_CbType.ANY_SHAPE;\n }\n /**\n * Default CbType given to all Compounds\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Compounds\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_COMPOUND(get_ANY_COMPOUND,never):CbType;\n inline static function get_ANY_COMPOUND():CbType{\n return ZPP_CbType.ANY_COMPOUND;\n }\n /**\n * Construct OptionType with given extra includes.\n *

\n * Equivalent to new OptionType(this).including(includes)\n *

\n * The includes argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n *\n * @param includes The CbTypes to include.\n * @return A new OptionType whose includes are equal to this CbType\n * and all the CbTypes given as argument.\n * @throws # If includes is null.\n */\n public function including(includes:Dynamic):OptionType{\n return(new OptionType(this)).including(includes);\n }\n /**\n * Construct OptionType with given excludes.\n *

\n * Equivalent to new OptionType(this).excluding(excludes)\n *

\n * The excludes argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n *\n * @param excludes The CbTypes to exclude.\n * @return A new OptionType whose included types are just 'this' and whose\n * excluded types are those given as argument.\n * @throws # If excludes is null.\n */\n public function excluding(excludes:Dynamic):OptionType{\n return(new OptionType(this)).excluding(excludes);\n }\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * List of all Interactors using this CbType.\n *

\n * This list contains only those Interactors that are inside of a Space\n *

\n * This list is not only readonly, but also immutable.\n */\n #if nape_swc@:isVar #end\n public var interactors(get_interactors,never):InteractorList;\n inline function get_interactors():InteractorList{\n if(zpp_inner.wrap_interactors==null){\n zpp_inner.wrap_interactors=ZPP_InteractorList.get(zpp_inner.interactors,true);\n }\n return zpp_inner.wrap_interactors;\n }\n /**\n * List of all Constraints using this CbType.\n *

\n * This list contains only those Constraints that are inside of a Space\n *

\n * This list is not only readonly, but also immutable.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n if(zpp_inner.wrap_constraints==null){\n zpp_inner.wrap_constraints=ZPP_ConstraintList.get(zpp_inner.constraints,true);\n }\n return zpp_inner.wrap_constraints;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return if(this==ANY_BODY)\"ANY_BODY\";\n else if(this==ANY_SHAPE)\"ANY_SHAPE\";\n else if(this==ANY_COMPOUND)\"ANY_COMPOUND\";\n else if(this==ANY_CONSTRAINT)\"ANY_CONSTRAINT\";\n else \"CbType#\"+id;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CbTypeIterator{\n /**\n * @private\n */\n public var zpp_inner:CbTypeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:CbTypeIterator=null;\n /**\n * @private\n */\n public var zpp_next:CbTypeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_CbTypeList.internal)throw \"Error: Cannot instantiate \"+\"CbType\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:CbTypeList){\n var ret=if(zpp_pool==null){\n ZPP_CbTypeList.internal=true;\n var ret=new CbTypeIterator();\n ZPP_CbTypeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:CbType = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:CbType = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:CbType = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CbTypeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CbTypeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than CbType\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new CbTypeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,CbType)#else Std.is(i,CbType)#end)throw \"Error: Array contains non \"+\"CbType\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new CbTypeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:CbType):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):CbType{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():CbType{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():CbType{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:CbType):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return CbTypeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new CbTypeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"CbType\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:CbTypeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_CbTypeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:CbType->Void):CbTypeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=CbTypeIterator.zpp_pool;\n CbTypeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:CbType->Bool):CbTypeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass ConstraintCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Constraint involved in callback event.\n */\n #if nape_swc@:isVar #end\n public var constraint(get_constraint,never):Constraint;\n inline function get_constraint():Constraint{\n return zpp_inner.constraint.outer;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"WAKE\",\"SLEEP\",\"BREAK\"][zpp_inner.event-ZPP_Flags.id_CbEvent_WAKE];\n ret+=\":\"+constraint.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Constraint type events.\n *

\n * The events that can be caught are WAKE, SLEEP and BREAK type events.\n * Theses listeners will only operate on Constraints.\n */\n@:final#if nape_swc@:keep #end\nclass ConstraintListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_ConstraintListener=null;\n /**\n * The OptionType used to match against Constraints.\n *

\n * When added to the same Space, any Constraint who's CbType list matches\n * against this OptionType will be issued a callback when the relevant\n * event occurs.\n */\n #if nape_swc@:isVar #end\n public var options(get_options,set_options):OptionType;\n inline function get_options():OptionType{\n return zpp_inner_zn.options.outer;\n }\n inline function set_options(options:OptionType):OptionType{\n {\n zpp_inner_zn.options.set(options.zpp_inner);\n }\n return get_options();\n }\n /**\n * The callback handler for this event.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):ConstraintCallback->Void;\n inline function get_handler():ConstraintCallback->Void{\n return zpp_inner_zn.handler;\n }\n inline function set_handler(handler:ConstraintCallback->Void):ConstraintCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: ConstraintListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handler=handler;\n }\n return get_handler();\n }\n /**\n * Construct a new ConstraintListener.\n *

\n * The possible event types are WAKE, SLEEP and BREAK.\n *

\n * The options argument is typed Dynamic, and is permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param options The OptionType to match Constraints against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable ConstraintListener existing for the same\n * event on the same Constraint. (default 0)\n * @return The newly constructed ConstraintListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If options is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,options:Null,handler:ConstraintCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: ConstraintListener::handler cannot be null\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.WAKE)xevent=ZPP_Flags.id_CbEvent_WAKE;\n else if(event==CbEvent.SLEEP)xevent=ZPP_Flags.id_CbEvent_SLEEP;\n else if(event==CbEvent.BREAK)xevent=ZPP_Flags.id_CbEvent_BREAK;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: cbEvent '\"+event.toString()+\"' is not a valid event type for a ConstraintListener\";\n #end\n }\n zpp_inner_zn=new ZPP_ConstraintListener(ZPP_OptionType.argument(options),xevent,handler);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner.precedence=precedence;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Interaction type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * First Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the first\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int1(get_int1,never):Interactor;\n inline function get_int1():Interactor{\n return zpp_inner.int1.outer_i;\n }\n /**\n * Second Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the second\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int2(get_int2,never):Interactor;\n inline function get_int2():Interactor{\n return zpp_inner.int2.outer_i;\n }\n /**\n * Existing arbiters between interactors.\n *

\n * This list will at present contain 'all' arbiters, not just those matching the\n * interactionType in the InteractionListener. (This may be subject to change).\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n return zpp_inner.wrap_arbiters;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"BEGIN\",\"END\",\"\",\"\",\"\",\"\",\"ONGOING\"][zpp_inner.event];\n ret+=\":\"+int1.toString()+\"/\"+int2.toString();\n ret+=\" : \"+arbiters.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Interaction type events.\n *

\n * Interaction type events can occur between any two Interactors (whether they\n * be Shapes, Bodys, Compounds or a mix thereof).\n *

\n * The events that can be caught are BEGIN, ONGOING, and END type events.\n * Theses listeners will operate between pairs of Interactors.\n *
\n *          _Space\n *         /      \\\n *     Cmp1        Cmp3\n *    /    \\         |\n * Body1  Cmp2     Body3\n *   |      |        |\n * Shp1   Body2    Shp3\n *          |\n *        Shp2\n * 
\n * The possible interactor pairs for callbacks are formed by finding the most\n * recent common ancestor in the world for the given pair of shapes and taking all\n * possible pairings. In the above situation we have:\n *
\n * MRCA(Shp1, Shp2) = Cmp1  --> Possible pairings = [Shp1, Body1] x [Shp2, Body2, Cmp2]\n * MRCA(Shp1, Shp3) = Space --> Possible pairings = [Shp1, Body1, Cmp1] x [Shp3, Body3, Cmp3]\n * MRCA(Shp2, Shp3) = Space --> Possible pairings = [Shp2, Body2, Cmp2, Cmp1] x [Shp3, Body3, Cmp3]\n * 
\n * Of course, not all of these pairings will generate callbacks, only those for which\n * a valid listener exists for the event type, and for the cbtypes of each interactor.\n *

\n * Furthermore, the listener specifies an interaction type which works even in mixed\n * cases where many types of interaction between two objects is happening at once.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_InteractionListener=null;\n /**\n * The OptionType used to match against Interactors for the first object.\n */\n #if nape_swc@:isVar #end\n public var options1(get_options1,set_options1):OptionType;\n inline function get_options1():OptionType{\n return zpp_inner_zn.options1.outer;\n }\n inline function set_options1(options1:OptionType):OptionType{\n {\n zpp_inner_zn.options1.set(options1.zpp_inner);\n }\n return get_options1();\n }\n /**\n * The OptionType used to match against Interactors for the second object.\n */\n #if nape_swc@:isVar #end\n public var options2(get_options2,set_options2):OptionType;\n inline function get_options2():OptionType{\n return zpp_inner_zn.options2.outer;\n }\n inline function set_options2(options2:OptionType):OptionType{\n {\n zpp_inner_zn.options2.set(options2.zpp_inner);\n }\n return get_options2();\n }\n /**\n * The specific type of interaction that is to be listened for.\n *

\n * If we specify that we only want to listen for a fluid type interaction, then\n * this listener will operate so that any other interactions for the same pair\n * of objects is ignored.\n */\n #if nape_swc@:isVar #end\n public var interactionType(get_interactionType,set_interactionType):InteractionType;\n inline function get_interactionType():InteractionType{\n var ret=zpp_inner_zn.itype;\n return if(ret==ZPP_Flags.id_InteractionType_COLLISION)InteractionType.COLLISION;\n else if(ret==ZPP_Flags.id_InteractionType_SENSOR)InteractionType.SENSOR;\n else if(ret==ZPP_Flags.id_InteractionType_FLUID)InteractionType.FLUID;\n else if(ret==ZPP_Flags.id_InteractionType_ANY)InteractionType.ANY;\n else null;\n }\n inline function set_interactionType(interactionType:InteractionType):InteractionType{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(interactionType==null){\n throw \"Error: Cannot set listener interaction type to null\";\n }\n #end\n if(this.interactionType!=interactionType){\n var xtype=if(interactionType==InteractionType.COLLISION)ZPP_Flags.id_InteractionType_COLLISION else if(interactionType==InteractionType.SENSOR)ZPP_Flags.id_InteractionType_SENSOR else if(interactionType==InteractionType.FLUID)ZPP_Flags.id_InteractionType_FLUID else ZPP_Flags.id_InteractionType_ANY;\n zpp_inner_zn.setInteractionType(xtype);\n }\n }\n return get_interactionType();\n }\n /**\n * The callback handler for this listener.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):InteractionCallback->Void;\n inline function get_handler():InteractionCallback->Void{\n return zpp_inner_zn.handleri;\n }\n inline function set_handler(handler:InteractionCallback->Void):InteractionCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: InteractionListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handleri=handler;\n }\n return get_handler();\n }\n /**\n * For ONGOING listeners only, permit ONGOING callbacks whilst sleeping.\n *

\n * This property determines whether we will still receive\n * ONGOING callbacks between two sleeping Interactors. The default action is to\n * inhibit callbacks between sleeping objects for performance. Setting this field to true\n * will permit Nape to always generate callbacks.\n */\n #if nape_swc@:isVar #end\n public var allowSleepingCallbacks(get_allowSleepingCallbacks,set_allowSleepingCallbacks):Bool;\n inline function get_allowSleepingCallbacks():Bool{\n return zpp_inner_zn.allowSleepingCallbacks;\n }\n inline function set_allowSleepingCallbacks(allowSleepingCallbacks:Bool):Bool{\n {\n zpp_inner_zn.allowSleepingCallbacks=allowSleepingCallbacks;\n }\n return get_allowSleepingCallbacks();\n }\n /**\n * Construct a new InteractionListener.\n *

\n * The possible event types are BEGIN, ONGOING and END.\n *

\n * The options arguments are typed Dynamic, and are permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param interactionType The interaction type to listen for.\n * @param options1 The OptionType to match first Interactor against, passing null\n * will equate to an empty OptionType.\n * @param options2 The OptionType to match second Interactor against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @return The newly constructed InteractionListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If either option is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,interactionType:InteractionType,options1:Null,options2:Null,handler:InteractionCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: InteractionListener::handler cannot be null\";\n }\n if(event==null){\n throw \"Error: CbEvent cannot be null for InteractionListener\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.BEGIN)xevent=ZPP_Flags.id_CbEvent_BEGIN;\n else if(event==CbEvent.END)xevent=ZPP_Flags.id_CbEvent_END;\n else if(event==CbEvent.ONGOING)xevent=ZPP_Flags.id_CbEvent_ONGOING;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: CbEvent '\"+event.toString()+\"' is not a valid event type for InteractionListener\";\n #end\n }\n zpp_inner_zn=new ZPP_InteractionListener(ZPP_OptionType.argument(options1),ZPP_OptionType.argument(options2),xevent,ZPP_Flags.id_ListenerType_INTERACTION);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zni=this;\n zpp_inner.precedence=precedence;\n zpp_inner_zn.handleri=handler;\n this.interactionType=interactionType;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of Interaction types.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionType{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"InteractionType\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==COLLISION)return\"COLLISION\";\n else if(this==SENSOR)return\"SENSOR\";\n else if(this==FLUID)return\"FLUID\";\n else if(this==ANY)return\"ANY\";\n else return \"\";\n }\n /**\n * Collision interaction type.\n */\n #if nape_swc@:isVar #end\n public static var COLLISION(get_COLLISION,never):InteractionType;\n inline static function get_COLLISION(){\n if(ZPP_Flags.InteractionType_COLLISION==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_COLLISION=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_COLLISION;\n }\n /**\n * Sensor interaction type.\n \"\"*/#if nape_swc@:isVar #end\n public static var SENSOR(get_SENSOR,never):InteractionType;\n inline static function get_SENSOR(){\n if(ZPP_Flags.InteractionType_SENSOR==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_SENSOR=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_SENSOR;\n }\n /**\n * Fluid interaction type.\n */\n #if nape_swc@:isVar #end\n public static var FLUID(get_FLUID,never):InteractionType;\n inline static function get_FLUID(){\n if(ZPP_Flags.InteractionType_FLUID==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_FLUID=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_FLUID;\n }\n /**\n * Special enum corresponding to 'all' interaction types.\n */\n #if nape_swc@:isVar #end\n public static var ANY(get_ANY,never):InteractionType;\n inline static function get_ANY(){\n if(ZPP_Flags.InteractionType_ANY==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_ANY=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_ANY;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ListenerIterator{\n /**\n * @private\n */\n public var zpp_inner:ListenerList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ListenerIterator=null;\n /**\n * @private\n */\n public var zpp_next:ListenerIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ListenerList.internal)throw \"Error: Cannot instantiate \"+\"Listener\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ListenerList){\n var ret=if(zpp_pool==null){\n ZPP_ListenerList.internal=true;\n var ret=new ListenerIterator();\n ZPP_ListenerList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Listener = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Listener = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Listener = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ListenerList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ListenerList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Listener\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ListenerList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Listener)#else Std.is(i,Listener)#end)throw \"Error: Array contains non \"+\"Listener\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ListenerList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Listener):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Listener{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Listener{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Listener{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Listener):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ListenerIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ListenerList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Listener\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ListenerList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ListenerList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Listener->Void):ListenerList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ListenerIterator.zpp_pool;\n ListenerIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Listener->Bool):ListenerList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * An object's set of CbType's 'matches' against an OptionType iff.\n * the OptionType's includes list intersects the object's set of CbTypes\n * and the OptionType's excludes list 'does not' intersect the object's set\n * of CbTypes.\n *
\n * option = new OptionType([A, B], [C, D]);\n * obj.cbTypes = [] // => does not match option.\n * obj.cbTypes = [A] // => matches the option\n * obj.cbTypes = [A, C] // => does not match option.\n * 
\n * The optionType's includes and excludes list are managed to be always\n * disjoint: The action of including an already excluded type serves to\n * remove it from the excludes list, equalliy excluding an already included\n * type serves to remove it from the includes list.\n *
\n * var option = new OptionType();\n * option.including(A); // option = {[A]:[]}\n * option.excluding(A); // option = {[]:[]}\n * option.excluding(A); // option = {[]:[A]}\n * option.including(A); // option = {[A]:[]}\n * 
\n */\n@:final#if nape_swc@:keep #end\nclass OptionType{\n /**\n * @private\n */\n public var zpp_inner:ZPP_OptionType=null;\n /**\n * List of included CbTypes.\n *

\n * This list is both readonly, and immutable. To remove an element\n * from this list you can use: option.excluding(cbType)\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var includes(get_includes,never):CbTypeList;\n inline function get_includes():CbTypeList{\n if(zpp_inner.wrap_includes==null)zpp_inner.setup_includes();\n return zpp_inner.wrap_includes;\n }\n /**\n * List of excluded CbTypes.\n *

\n * This list is both readonly, and immutable. To remove an element\n * from this list you can use: option.including(cbType)\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var excludes(get_excludes,never):CbTypeList;\n inline function get_excludes():CbTypeList{\n if(zpp_inner.wrap_excludes==null)zpp_inner.setup_excludes();\n return zpp_inner.wrap_excludes;\n }\n /**\n * Construct a new OptionType.\n *

\n * The type of the arguments is Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param includes The set of CbTypes to be included in the matching process.\n * (default null)\n * @param excludes The set of CbTypes to be excluded in the matching process.\n * (default null)\n * @return Return new OptionType with give sets of CbTypes.\n * @throws # If either argument is not of the expected Type.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(includes:Dynamic=null,excludes:Dynamic=null){\n zpp_inner=new ZPP_OptionType();\n zpp_inner.outer=this;\n if(includes!=null)including(includes);\n if(excludes!=null)excluding(excludes);\n }\n /**\n * Append set of types to includes list.\n *

\n * This method was originally named the more appropriate 'include'\n * but this conflicted with the AS3 keyword include and had to be\n * change.\n *

\n * The argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param includes The set of CbTypes to be included. (default null)\n * @return A reference to this OptionType.\n * @throws # If argument is not of the expected Type.\n */\n public function including(includes:Dynamic=null):OptionType{\n zpp_inner.append(zpp_inner.includes,includes);\n return this;\n }\n /**\n * Append set of types to excludes list.\n *

\n * This method was originally named the more appropriate 'exclude'\n * but to match the necessary change for the include function, this was\n * renamed as excluding.\n *

\n * The argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param excludes The set of CbTypes to be excluded. (default null)\n * @return A reference to this OptionType.\n * @throws # If argument is not of the expected Type.\n */\n public function excluding(excludes:Dynamic=null):OptionType{\n zpp_inner.append(zpp_inner.excludes,excludes);\n return this;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n var inc=includes.toString();\n var exc=excludes.toString();\n return \"@{\"+inc+\" excluding \"+exc+\"}\";\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Pre-Interaction type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass PreCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Arbiter related to callback event.\n *

\n * In the case that this pre-event occurs between two non-Shape's\n * then this is the first arbiter to be created for the related\n * interactionType\n */\n #if nape_swc@:isVar #end\n public var arbiter(get_arbiter,never):Arbiter;\n inline function get_arbiter():Arbiter{\n return zpp_inner.pre_arbiter.wrapper();\n }\n /**\n * First Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the first\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int1(get_int1,never):Interactor;\n inline function get_int1():Interactor{\n return zpp_inner.int1.outer_i;\n }\n /**\n * Second Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the second\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int2(get_int2,never):Interactor;\n inline function get_int2():Interactor{\n return zpp_inner.int2.outer_i;\n }\n /**\n * Describes how Arbiter's objects are related to int1/int2 properties\n *

\n * If true, then arbiter.shape1 will belong to callback.int2, and\n * arbiter.shape2 will belong to callback.int1.\n *

\n * If you take the arbiter's normal, then if swapped is true, the normal\n * will point from int2 towards int1 instead of from int1 towards int2.\n */\n #if nape_swc@:isVar #end\n public var swapped(get_swapped,never):Bool;\n inline function get_swapped():Bool{\n return zpp_inner.pre_swapped;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:PRE:\";\n ret+=\":\"+int1.toString()+\"/\"+int2.toString();\n ret+=\" : \"+arbiter.toString();\n ret+=\" : listnener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of interaction states for arbiters. These values are returned\n * by PreListener callback handlers.\n */\n@:final#if nape_swc@:keep #end\nclass PreFlag{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"PreFlag\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==ACCEPT)return\"ACCEPT\";\n else if(this==IGNORE)return\"IGNORE\";\n else if(this==ACCEPT_ONCE)return\"ACCEPT_ONCE\";\n else if(this==IGNORE_ONCE)return\"IGNORE_ONCE\";\n else return \"\";\n }\n /**\n * Value denotes interaction will occur, and Nape will not ask again.\n */\n #if nape_swc@:isVar #end\n public static var ACCEPT(get_ACCEPT,never):PreFlag;\n inline static function get_ACCEPT(){\n if(ZPP_Flags.PreFlag_ACCEPT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_ACCEPT=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_ACCEPT;\n }\n /**\n * Value denotes interaction will be ignored, and Nape will not ask again.\n */\n #if nape_swc@:isVar #end\n public static var IGNORE(get_IGNORE,never):PreFlag;\n inline static function get_IGNORE(){\n if(ZPP_Flags.PreFlag_IGNORE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_IGNORE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_IGNORE;\n }\n /**\n * Value denotes interaction will occur 'this' step, and Nape will ask what\n * to do again in the following step if interaction is still possible.\n */\n #if nape_swc@:isVar #end\n public static var ACCEPT_ONCE(get_ACCEPT_ONCE,never):PreFlag;\n inline static function get_ACCEPT_ONCE(){\n if(ZPP_Flags.PreFlag_ACCEPT_ONCE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_ACCEPT_ONCE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_ACCEPT_ONCE;\n }\n /**\n * Value denotes interaction will be ignored 'this' step, and Nape will ask what\n * to do again in the following step if interaction is still possible.\n */\n #if nape_swc@:isVar #end\n public static var IGNORE_ONCE(get_IGNORE_ONCE,never):PreFlag;\n inline static function get_IGNORE_ONCE(){\n if(ZPP_Flags.PreFlag_IGNORE_ONCE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_IGNORE_ONCE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_IGNORE_ONCE;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Pre-Interaction type events.\n *

\n * Pre-Interaction type events can occur between any two Interactors (whether they\n * be Shapes, Bodys, Compounds or a mix thereof).\n */\n@:final#if nape_swc@:keep #end\nclass PreListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_InteractionListener=null;\n /**\n * The OptionType used to match against Interactors for the first object.\n */\n #if nape_swc@:isVar #end\n public var options1(get_options1,set_options1):OptionType;\n inline function get_options1():OptionType{\n return zpp_inner_zn.options1.outer;\n }\n inline function set_options1(options1:OptionType):OptionType{\n {\n zpp_inner_zn.options1.set(options1.zpp_inner);\n }\n return get_options1();\n }\n /**\n * The OptionType used to match against Interactors for the second object.\n */\n #if nape_swc@:isVar #end\n public var options2(get_options2,set_options2):OptionType;\n inline function get_options2():OptionType{\n return zpp_inner_zn.options2.outer;\n }\n inline function set_options2(options2:OptionType):OptionType{\n {\n zpp_inner_zn.options2.set(options2.zpp_inner);\n }\n return get_options2();\n }\n /**\n * Callback handler for this listener.\n *

\n * This callback handler returns a possibly null PreFlag object.\n *
\n * Passing null is equivalent to telling nape 'ignore me' so that whatever existing\n * decision has been made regarding the interaction is not modified.\n * Otherwise returning a non-null PreFlag will change the current decision about what\n * to do with the interaction.\n *

\n * Returning ACCEPT/IGNORE inform nape to take control over all subsequent interaction\n * between the two objects until they seperate. Returning these will mean that the pre\n * listener will not be invoked again until the objects seperate, and then begin to interact\n * afresh.\n *

\n * Returning #_ONCE, the objects will only be effected for a single step, and the following\n * step should they still be candidates for interaction, this handler will be invoked again.\n *
\n * In the case of a #_ONCE, PreFlag; Nape will 'not' permit the two objects to go to sleep\n * as Nape cannot know if this callback handler will suddenly changes its mind.\n *
\n * If this handler is a 'pure' function, then you may mark it as such and Nape will keep you\n * to your word and permit the objects to sleep.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):PreCallback->Null;\n inline function get_handler():PreCallback->Null{\n return zpp_inner_zn.handlerp;\n }\n inline function set_handler(handler:PreCallback->Null):PreCallback->Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: PreListener must take a non-null handler!\";\n }\n #end\n zpp_inner_zn.handlerp=handler;\n zpp_inner_zn.wake();\n }\n return get_handler();\n }\n /**\n * Mark this listener as having a pure callback handler.\n *

\n * A pure callback handler is one which under no circumstances will change its behaviour.\n * In such a (favourable) instance, marking the callback as pure will allow Nape to permit\n * objects in interaction to go to sleep even if the handler returns an IGNORE_ONCE/ACCEPT_ONCE\n * PreFlag.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var pure(get_pure,set_pure):Bool;\n inline function get_pure():Bool{\n return zpp_inner_zn.pure;\n }\n inline function set_pure(pure:Bool):Bool{\n {\n if(!pure){\n zpp_inner_zn.wake();\n }\n zpp_inner_zn.pure=pure;\n }\n return get_pure();\n }\n /**\n * The specific type of interaction that is to be listened for.\n *

\n * If we specify that we only want to listen for a fluid type interaction, then\n * this listener will operate so that any other interactions for the same pair\n * of objects is ignored.\n */\n #if nape_swc@:isVar #end\n public var interactionType(get_interactionType,set_interactionType):InteractionType;\n inline function get_interactionType():InteractionType{\n var ret=zpp_inner_zn.itype;\n return if(ret==ZPP_Flags.id_InteractionType_COLLISION)InteractionType.COLLISION;\n else if(ret==ZPP_Flags.id_InteractionType_SENSOR)InteractionType.SENSOR;\n else if(ret==ZPP_Flags.id_InteractionType_FLUID)InteractionType.FLUID;\n else if(ret==ZPP_Flags.id_InteractionType_ANY)InteractionType.ANY;\n else null;\n }\n inline function set_interactionType(interactionType:InteractionType):InteractionType{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(interactionType==null){\n throw \"Error: Cannot set listener interaction type to null\";\n }\n #end\n if(this.interactionType!=interactionType){\n var xtype=if(interactionType==InteractionType.COLLISION)ZPP_Flags.id_InteractionType_COLLISION else if(interactionType==InteractionType.SENSOR)ZPP_Flags.id_InteractionType_SENSOR else if(interactionType==InteractionType.FLUID)ZPP_Flags.id_InteractionType_FLUID else ZPP_Flags.id_InteractionType_ANY;\n zpp_inner_zn.setInteractionType(xtype);\n }\n }\n return get_interactionType();\n }\n /**\n * Construct a new PreListener.\n *

\n * The options arguments are typed Dynamic, and are permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param interactionType The interaction type to listen for.\n * @param options1 The OptionType to match first Interactor against, passing null\n * will equate to an empty OptionType.\n * @param options2 The OptionType to match second Interactor against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @param pure If true, then the listener will be marked as having a pure handler.\n * (default false)\n * @return The newly constructed InteractionListener\n * @throws # If handler is null.\n * @throws # If either option is not of the expected Type.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(interactionType:InteractionType,options1:Null,options2:Null,handler:PreCallback->Null,precedence=0,pure=false){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: PreListener must take a handler!\";\n }\n #end\n zpp_inner_zn=new ZPP_InteractionListener(ZPP_OptionType.argument(options1),ZPP_OptionType.argument(options2),ZPP_Flags.id_CbEvent_PRE,ZPP_Flags.id_ListenerType_PRE);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_znp=this;\n zpp_inner.precedence=precedence;\n zpp_inner_zn.pure=pure;\n zpp_inner_zn.handlerp=handler;\n this.interactionType=interactionType;\n }\n}\n","package nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for all Nape joints and constraints\n */\n#if nape_swc@:keep #end\nclass Constraint{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Constraint;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set to disable debug drawing/\n *

\n * When true, this Constraint will not be drawn during debug draw operations\n * unless specifically given as argument to Debug draw() method.\n * @default true\n */\n public var debugDraw:Bool=true;\n /**\n * Compound this Constraints belong to.\n *

\n * If this constraint is in a Space or another Compound and you change\n * its compound, then it will be removed from that Space or Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n if(this.compound!=compound){\n if(this.compound!=null){\n this.compound.constraints.remove(this);\n }\n if(compound!=null){\n compound.constraints.add(this);\n }\n }\n }\n return get_compound();\n }\n /**\n * Space this constraint is inside of.\n *

\n * Whether this constraint is directly in a Space, or part of a Compound\n * which is inside of a space, this value will be equal to that Space.\n *

\n * If this constraint is inside of a Compound, then you cannot modify its\n * Space as the constraint belongs to that Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null){\n throw \"Error: Cannot set the space of a Constraint belonging to\"+\" a Compound, only the root Compound space can be set\";\n }\n #end\n if(this.space!=space){\n if(zpp_inner.component!=null)zpp_inner.component.woken=false;\n zpp_inner.clearcache();\n if(zpp_inner.space!=null){\n zpp_inner.space.outer.constraints.remove(this);\n }\n if(space!=null){\n space.constraints.add(this);\n }\n else{\n zpp_inner.space=null;\n }\n }\n }\n return get_space();\n }\n /**\n * Whether this constraint is sleeping or not.\n *

\n * This property is only defined if the constraint is inside of a Space\n * and is active, otherwise an error will be thrown should you access this\n * property.\n *

\n * This value is immutable, In Nape you do not ever need to manually\n * wake up a Constraint. It will always be done automatically without error.\n *

\n * To manually put a Constraint to sleep is against the very nature of Nape\n * API and so is excluded from the core of Nape. If you really want to do this\n * you should make use of the nape-hacks module.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.space==null||!zpp_inner.active){\n throw \"Error: isSleeping only makes sense if constraint is\"+\" active and inside a space\";\n }\n #end\n return zpp_inner.component.sleeping;\n }\n /**\n * Whether this constraint is active or not.\n *

\n * Setting a constraint to be no longer active is a useful way of\n * temporarigly disabling a constraint without having to remove it\n * from a Space.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var active(get_active,set_active):Bool;\n inline function get_active():Bool{\n return zpp_inner.active;\n }\n inline function set_active(active:Bool):Bool{\n {\n if(this.active!=active){\n if(zpp_inner.component!=null)zpp_inner.component.woken=false;\n zpp_inner.clearcache();\n if(active){\n zpp_inner.active=active;\n zpp_inner.activate();\n if(zpp_inner.space!=null){\n if(zpp_inner.component!=null)zpp_inner.component.sleeping=true;\n zpp_inner.space.wake_constraint(zpp_inner,true);\n }\n }\n else{\n if(zpp_inner.space!=null){\n zpp_inner.wake();\n zpp_inner.space.live_constraints.remove(zpp_inner);\n }\n zpp_inner.active=active;\n zpp_inner.deactivate();\n }\n }\n }\n return get_active();\n }\n /**\n * Whether interactions between related Bodys will be ignored.\n *

\n * If true, then the Bodys related to this constraint will not\n * be permitted to interact in anyway, including callbacks.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var ignore(get_ignore,set_ignore):Bool;\n inline function get_ignore():Bool{\n return zpp_inner.ignore;\n }\n inline function set_ignore(ignore:Bool):Bool{\n {\n if(this.ignore!=ignore){\n zpp_inner.ignore=ignore;\n zpp_inner.wake();\n }\n }\n return get_ignore();\n }\n /**\n * Whether constraint is stiff, or elastic.\n *

\n * A stiff constraint has its positional error resolved directly\n * as with contact penetrations. This is generally a more stable\n * way of solving positional errors but has a side-effect that for example\n * changing the pivot point on a constraint used for mouse control will not\n * cause the objects to swing as the positional error is solved without\n * effecting the velocity of the object which may not be wanted.\n *

\n * If false, then the positional error of the constraint will be\n * resolved in an elastic way using changes in velocity.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var stiff(get_stiff,set_stiff):Bool;\n inline function get_stiff():Bool{\n return zpp_inner.stiff;\n }\n inline function set_stiff(stiff:Bool):Bool{\n {\n if(this.stiff!=stiff){\n zpp_inner.stiff=stiff;\n zpp_inner.wake();\n }\n }\n return get_stiff();\n }\n /**\n * Frequency of elastic properties of constraint.\n *

\n * This property only has an effect when constraint is not stiff.\n *

\n * This value corresponds to in an ideal situation, the number of\n * spring like oscillations the constraint will make per second.\n *

\n * This value must be strictly positive (0 not allowed).\n *\n * @default 10\n */\n #if nape_swc@:isVar #end\n public var frequency(get_frequency,set_frequency):Float;\n inline function get_frequency():Float{\n return zpp_inner.frequency;\n }\n inline function set_frequency(frequency:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((frequency!=frequency)){\n throw \"Error: Constraint::Frequency cannot be NaN\";\n }\n if(frequency<=0){\n throw \"Error: Constraint::Frequency must be >0\";\n }\n #end\n if(this.frequency!=frequency){\n zpp_inner.frequency=frequency;\n if(!zpp_inner.stiff){\n zpp_inner.wake();\n }\n }\n }\n return get_frequency();\n }\n /**\n * Damping ratio of elastic properties of constraint.\n *

\n * This property only has an effect when constraint is not stiff.\n *

\n * This value corresponds to in the ideal situation, the damping\n * ratio of the constraints oscillations with 1 corresponding to\n * a total dampening, and values greater than one being over-dampening.\n *

\n * This value must be zero or positive.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var damping(get_damping,set_damping):Float;\n inline function get_damping():Float{\n return zpp_inner.damping;\n }\n inline function set_damping(damping:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((damping!=damping)){\n throw \"Error: Constraint::Damping cannot be Nan\";\n }\n if(damping<0){\n throw \"Error: Constraint::Damping must be >=0\";\n }\n #end\n if(this.damping!=damping){\n zpp_inner.damping=damping;\n if(!zpp_inner.stiff){\n zpp_inner.wake();\n }\n }\n }\n return get_damping();\n }\n /**\n * The maximum amount of force this constraint is allowed to use.\n *

\n * This value, whilst still used in a stiff constraint will not work\n * as you might hope for; since a stiff constraint resolves positional\n * error without using impulses, the maxForce will not have any effect\n * on how positional errors are resolved.\n *

\n * This value must be zero or positive.\n *\n * @default infinity\n */\n #if nape_swc@:isVar #end\n public var maxForce(get_maxForce,set_maxForce):Float;\n inline function get_maxForce():Float{\n return zpp_inner.maxForce;\n }\n inline function set_maxForce(maxForce:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((maxForce!=maxForce)){\n throw \"Error: Constraint::maxForce cannot be NaN\";\n }\n if(maxForce<0){\n throw \"Error: Constraint::maxForce must be >=0\";\n }\n #end\n if(this.maxForce!=maxForce){\n zpp_inner.maxForce=maxForce;\n zpp_inner.wake();\n }\n }\n return get_maxForce();\n }\n /**\n * The maximum amount of error this constraint is allowed to use.\n *

\n * For stiff constraints, this value only serves to work in conjunction\n * with breakUnderError to permit breaking of the constraint.\n *

\n * For non-stiff constraints, this value will also effect how the constraint\n * behaves when breakUnderError is false by restricting the amount of error\n * that will be resolved; this will not work for stiff constraints.\n *\n * @default infinity\n */\n #if nape_swc@:isVar #end\n public var maxError(get_maxError,set_maxError):Float;\n inline function get_maxError():Float{\n return zpp_inner.maxError;\n }\n inline function set_maxError(maxError:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((maxError!=maxError)){\n throw \"Error: Constraint::maxError cannot be NaN\";\n }\n if(maxError<0){\n throw \"Error: Constraint::maxError must be >=0\";\n }\n #end\n if(this.maxError!=maxError){\n zpp_inner.maxError=maxError;\n zpp_inner.wake();\n }\n }\n return get_maxError();\n }\n /**\n * Whether constraint will break once maxForce is reached.\n *

\n * This property effects both stiff and non-stiff constraints, though\n * for the same reasons as those of maxForce, does not make much sense\n * to be used in stiff constraints.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var breakUnderForce(get_breakUnderForce,set_breakUnderForce):Bool;\n inline function get_breakUnderForce():Bool{\n return zpp_inner.breakUnderForce;\n }\n inline function set_breakUnderForce(breakUnderForce:Bool):Bool{\n {\n if(this.breakUnderForce!=breakUnderForce){\n zpp_inner.breakUnderForce=breakUnderForce;\n zpp_inner.wake();\n }\n }\n return get_breakUnderForce();\n }\n /**\n * Whether constraint will break once maxError is reached.\n *

\n * This property effects both stiff and non-stiff constraints.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var breakUnderError(get_breakUnderError,set_breakUnderError):Bool;\n inline function get_breakUnderError():Bool{\n return zpp_inner.breakUnderError;\n }\n inline function set_breakUnderError(breakUnderError:Bool):Bool{\n {\n if(this.breakUnderError!=breakUnderError){\n zpp_inner.breakUnderError=breakUnderError;\n zpp_inner.wake();\n }\n }\n return get_breakUnderError();\n }\n /**\n * Whether constraint will be removed when it breaks.\n *

\n * If true, then when constraint is broken it will be removed from\n * the Space. Otherwise it will simple be made inactive.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var removeOnBreak(get_removeOnBreak,set_removeOnBreak):Bool;\n inline function get_removeOnBreak():Bool{\n return zpp_inner.removeOnBreak;\n }\n inline function set_removeOnBreak(removeOnBreak:Bool):Bool{\n {\n zpp_inner.removeOnBreak=removeOnBreak;\n }\n return get_removeOnBreak();\n }\n /**\n * Return the constraint-space impulse applied in previous step.\n *\n * @return A new MatMN representing the constraint space impulse.\n */\n public function impulse():MatMN{\n return null;\n }\n /**\n * Compute impulse that was applied to the given Body.\n *

\n * This impulse is the actual (mass weighted) change in velocity\n * that occured due to this constraint.\n *\n * @param body The Body to compute impulse for.\n * @return The impulse that was applied to the body in the previous step.\n * @throws # If Body is not related to the Constraint.\n */\n public function bodyImpulse(body:Body):Vec3{\n return null;\n }\n /**\n * Apply given function to all Bodys linked to the constraint.\n *

\n * If a body is duplicated in a constraint then it will only\n * be visited once.\n *\n * @param lambda The function to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void):Void{}\n /**\n * Set of CbTypes for this constraints for callbacks.\n *

\n * This value cannot at present be set, but can be modified.\n *\n * @default [CbType.ANY_CONSTRAINT]\n */\n #if nape_swc@:isVar #end\n public var cbTypes(get_cbTypes,never):CbTypeList;\n inline function get_cbTypes():CbTypeList{\n if(zpp_inner.wrap_cbTypes==null){\n zpp_inner.setupcbTypes();\n }\n return zpp_inner.wrap_cbTypes;\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n public function new(){\n zpp_inner.insert_cbtype(CbType.ANY_CONSTRAINT.zpp_inner);\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Constraint cannot be instantiated derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"{Constraint}\";\n }\n /**\n * Produce copy of constraint.\n *

\n * All constraint properties except for internal impulse cache\n * and userData field will be copied.\n *\n * @return The copied Constraint.\n */\n public function copy():Constraint{\n return zpp_inner.copy();\n }\n}\n","package nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConstraintIterator{\n /**\n * @private\n */\n public var zpp_inner:ConstraintList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ConstraintIterator=null;\n /**\n * @private\n */\n public var zpp_next:ConstraintIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConstraintList.internal)throw \"Error: Cannot instantiate \"+\"Constraint\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ConstraintList){\n var ret=if(zpp_pool==null){\n ZPP_ConstraintList.internal=true;\n var ret=new ConstraintIterator();\n ZPP_ConstraintList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Constraint = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Constraint = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Constraint = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConstraintList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConstraintList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Constraint\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ConstraintList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Constraint)#else Std.is(i,Constraint)#end)throw \"Error: Array contains non \"+\"Constraint\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ConstraintList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Constraint):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Constraint{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Constraint{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Constraint{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Constraint):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ConstraintIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ConstraintList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Constraint\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ConstraintList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ConstraintList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Constraint->Void):ConstraintList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ConstraintIterator.zpp_pool;\n ConstraintIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Constraint->Bool):ConstraintList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * These objects are automatically reused, and you should not keep your own\n * references to them.\n */\n#if nape_swc@:keep #end\nclass Arbiter{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Arbiter=null;\n /**\n * Flag representing arbiter sleep state.\n *

\n * When true, this arbiter is sleeping.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.sleeping;\n }\n /**\n * The type of this Arbiter.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ArbiterType;\n inline function get_type():ArbiterType{\n return ZPP_Arbiter.types[zpp_inner.type];\n }\n /**\n * Equivalent to: arb.type == ArbiterType.COLLISION\n *

\n *\n * @return True if this Arbiter is a Collision type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isCollisionArbiter(){\n return zpp_inner.type==ZPP_Arbiter.COL;\n }\n /**\n * Equivalent to: arb.type == ArbiterType.FLUID\n *

\n *\n * @return True if this Arbiter is a Fluid type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isFluidArbiter(){\n return zpp_inner.type==ZPP_Arbiter.FLUID;\n }\n /**\n * Equivalent to: arb.type == ArbiterType.SENSOR\n *

\n *\n * @return True if this Arbiter is a Sensor type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isSensorArbiter(){\n return zpp_inner.type==ZPP_Arbiter.SENSOR;\n }\n /**\n * Fast equivalent to casting this object to a CollisionArbiter.\n *

\n * This value is null when this arbiter is not a collision type.\n */\n #if nape_swc@:isVar #end\n public var collisionArbiter(get_collisionArbiter,never):Null;\n inline function get_collisionArbiter():Null{\n return if(isCollisionArbiter())zpp_inner.colarb.outer_zn else null;\n }\n /**\n * Fast equivalent to casting this object to a FluidArbiter.\n *

\n * This value is null when this arbiter is not a fluid type.\n */\n #if nape_swc@:isVar #end\n public var fluidArbiter(get_fluidArbiter,never):Null;\n inline function get_fluidArbiter():Null{\n return if(isFluidArbiter())zpp_inner.fluidarb.outer_zn else null;\n }\n /**\n * The first shape in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.id < arb.shape2.id\n */\n #if nape_swc@:isVar #end\n public var shape1(get_shape1,never):Shape;\n inline function get_shape1():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.ws2.outer:zpp_inner.ws1.outer;\n }\n /**\n * The second shape in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.id < arb.shape2.id\n */\n #if nape_swc@:isVar #end\n public var shape2(get_shape2,never):Shape;\n inline function get_shape2():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.ws1.outer:zpp_inner.ws2.outer;\n }\n /**\n * The first body in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.body == arb.body1\n */\n #if nape_swc@:isVar #end\n public var body1(get_body1,never):Body;\n inline function get_body1():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.b2.outer:zpp_inner.b1.outer;\n }\n /**\n * The second body in Arbiter interaction.\n *

\n * It will always be the case that arb.shape2.body == arb.body2\n */\n #if nape_swc@:isVar #end\n public var body2(get_body2,never):Body;\n inline function get_body2():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.b1.outer:zpp_inner.b2.outer;\n }\n /**\n * The interaction state of this Arbiter.\n *

\n * This flag will, except for in a PreListener handler, always be either\n * ImmState.ACCEPT or ImmState.IGNORE\n *
\n * During a PreListener handler, you can query this property to see what\n * the current state of the arbiter has been set to, and returning null from\n * the handler will keep the state unchanged.\n */\n #if nape_swc@:isVar #end\n public var state(get_state,never):PreFlag;\n inline function get_state():PreFlag{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return switch(zpp_inner.immState){\n case x if(x==ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS):PreFlag.ACCEPT;\n case ZPP_Flags.id_ImmState_ACCEPT:PreFlag.ACCEPT_ONCE;\n case x if(x==ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS):PreFlag.IGNORE;\n default:PreFlag.IGNORE_ONCE;\n }\n }\n /**\n * Evaluate the total impulse this arbiter applied to the given body for\n * the previous space step including angular impulse based on things like\n * contact position, or centre of buoyancy etc.\n *

\n * If body is null, then the constraint space impulse will be returned instead\n *\n * @param body The body to query impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be queried for\n * collision type arbiters. This field has no use on fluid type\n * arbiters. (default false)\n * @return The total impulse applied to the given body, or the constraint\n * space impule if the body is null.\n * @throws # If body is non-null, but not related to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null,freshOnly:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n return Vec3.get(0,0,0);\n }\n /**\n * @private\n */\n public function new(){\n if(!ZPP_Arbiter.internal){\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot instantiate Arbiter derp!\";\n #end\n }\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=if(isCollisionArbiter())\"CollisionArbiter\";\n else if(isFluidArbiter())\"FluidArbiter\";\n else \"SensorArbiter\";\n #if NAPE_POOL_STATS ret+=\"#\"+zpp_inner.arbid;\n #end\n if(zpp_inner.cleared)return ret+\"(object-pooled)\";\n else return ret+\"(\"+shape1.toString()+\"|\"+shape2.toString()+\")\"+(isCollisionArbiter()?\"[\"+[\"SD\",\"DD\"][zpp_inner.colarb.stat?0:1]+\"]\":\"\")+\"<-\"+state.toString();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ArbiterIterator{\n /**\n * @private\n */\n public var zpp_inner:ArbiterList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ArbiterIterator=null;\n /**\n * @private\n */\n public var zpp_next:ArbiterIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ArbiterList.internal)throw \"Error: Cannot instantiate \"+\"Arbiter\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ArbiterList){\n var ret=if(zpp_pool==null){\n ZPP_ArbiterList.internal=true;\n var ret=new ArbiterIterator();\n ZPP_ArbiterList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Arbiter = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Arbiter = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Arbiter = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!true@:final #end\n#if nape_swc@:keep #end\nclass ArbiterList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ArbiterList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if false inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Arbiter\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ArbiterList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Arbiter)#else Std.is(i,Arbiter)#end)throw \"Error: Array contains non \"+\"Arbiter\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ArbiterList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Arbiter):Bool{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Arbiter{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!true){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Arbiter{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Arbiter{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function add(obj:Arbiter):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public function empty(){\n #if false if(true)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public function iterator(){\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ArbiterIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ArbiterList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Arbiter\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ArbiterList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ArbiterList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function foreach(lambda:Arbiter->Void):ArbiterList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ArbiterIterator.zpp_pool;\n ArbiterIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Arbiter->Bool):ArbiterList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This normal will always point from arbiter's shape1, towards shape2 and\n * corresponds to the direction of the normal before positional integration\n * and erorr resolvement took place (Correct at time of pre-listener).\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n if(zpp_inner.colarb.wrap_normal==null)zpp_inner.colarb.getnormal();\n return zpp_inner.colarb.wrap_normal;\n }\n /**\n * This radius property describes the sum of the circle's radii for the pair of shapes, with\n * a Polygon having 0 radius. This value is used in positional iterations to resolve penetrations\n * between the Shapes.\n */\n #if nape_swc@:isVar #end\n public var radius(get_radius,never):Float;\n inline function get_radius():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.colarb.radius;\n }\n /**\n * The reference edge for the collision on the first Polygon\n * If the first shape in Arbiter is a Circle this value is null.\n */\n #if nape_swc@:isVar #end\n public var referenceEdge1(get_referenceEdge1,never):Null;\n inline function get_referenceEdge1():Null{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var edge=zpp_inner.colarb.__ref_edge1;\n if(edge!=null&&(!shape1.isPolygon()||shape1.zpp_inner!=edge.polygon))edge=zpp_inner.colarb.__ref_edge2;\n return(edge==null)?null:edge.wrapper();\n }\n /**\n * The reference edge for the collision on the second Polygon\n * If the second shape in Arbiter is a Circle this value is null.\n */\n #if nape_swc@:isVar #end\n public var referenceEdge2(get_referenceEdge2,never):Null;\n inline function get_referenceEdge2():Null{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var edge=zpp_inner.colarb.__ref_edge1;\n if(edge!=null&&(!shape2.isPolygon()||shape2.zpp_inner!=edge.polygon))edge=zpp_inner.colarb.__ref_edge2;\n return(edge==null)?null:edge.wrapper();\n }\n /**\n * In the case that we have a Circle-Polygon collision, then this\n * function will return true, if the circle collided with the first\n * vertex of edge.\n *

\n * If both firstVertex() and secondVertex() are false, it indicates\n * the Circle collided with the edge.\n *\n * @returns True if Circle collided with first reference vertex.\n */\n public function firstVertex(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var poly2circle=(zpp_inner.colarb.__ref_edge1!=null)!=(zpp_inner.colarb.__ref_edge2!=null);\n return if(poly2circle)(zpp_inner.colarb.__ref_vertex==-1)else false;\n }\n /**\n * Check if colliding Circle hit second vertex of reference edge.\n *

\n * In the case that we have a Circle-Polygon collision, then this\n * function will return true, if the circle collided with the second\n * vertex of edge.\n *

\n * If both firstVertex() and secondVertex() are false, it indicates\n * the Circle collided with the edge.\n *\n * @returns True if Circle collided with second reference vertex.\n */\n public function secondVertex(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var poly2circle=(zpp_inner.colarb.__ref_edge1!=null)!=(zpp_inner.colarb.__ref_edge2!=null);\n return if(poly2circle)(zpp_inner.colarb.__ref_vertex==1)else false;\n }\n /**\n * Evaluate normal reactive impulses for collision interaction for a given body.\n *

\n * If body argument is null, then the sum of the contact normal impulses will be returned instead\n * with no angular impulse derivable, the direction of this impulse will be the direction of the normal.\n *
\n * If body argument is not null, then this will return the actual impulse applied to that specific body\n * rather than simply the sum of contact normal impulses, this will include angular impulses due to\n * positions of contact points and normal.\n *\n * @param body The Body to query normal impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body, considering normal reactive forces.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().normalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().normalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate tangent impulses for collision interaction.\n *

\n * If body argument is null, then the sum of the contact friction impulses is returned with\n * no angular impulse derivable, the direction of this impulse will be against the relative\n * velocity of the first body against the second.\n *
\n * If the body argument is non-null, then the actual impulse applied to that body due to tangent\n * frictino impulses will be returned, including angular effects due to contact positions and normal.\n *

\n * These tangent impulses correspond to the forces of static and dynamic friction.\n *\n * @param body The Body to query tangent impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body, considering standard frictional forces.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().tangentImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().tangentImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate total contact impulses for collision interaction.\n *

\n * If body argument is null, then this will return the sum of linear contact impulses, and the sum\n * of contact rolling impulses.\n *
\n * When body argument is non-null, this impulse will be the actual change in (mass weighted)\n * velocity that this collision caused to the Body in the previous time step.\n *\n * @param body The Body to query total impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public override function totalImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().totalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().totalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate rolling friction impulses for collision interaction.\n *

\n * If body argument is null, then the sum of the rolling impulses of each contact will be returned\n * instead of the angular impulse applied to the specific body as a result of the rolling impulses.\n *\n * @param body The Body to query rolling impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The angular impulse applied to the given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function rollingImpulse(body:Body=null,freshOnly:Bool=false):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var colarb=zpp_inner.colarb;\n if(!freshOnly||colarb.oc1.fresh)return colarb.oc1.wrapper().rollingImpulse(body);\n else return 0.0;\n }\n /**\n * Coeffecient of combined elasticity for collision interaction.\n *

\n * The value is computed as the average of the Shape Material's elasticities\n * clamped to be in the range [0,1]\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must be in the range 0\n * to 1.\n */\n #if nape_swc@:isVar #end\n public var elasticity(get_elasticity,set_elasticity):Float;\n inline function get_elasticity():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.restitution;\n }\n inline function set_elasticity(elasticity:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((elasticity!=elasticity))throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" cannot be NaN\";\n if(elasticity<0)throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" cannot be negative\";\n if(\"elasticity\"==\"restitution\"&&elasticity>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.restitution=elasticity;\n colarb.userdef_restitution=true;\n }\n return get_elasticity();\n }\n /**\n * Coeffecient of combined dynamic friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's dynamicFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var dynamicFriction(get_dynamicFriction,set_dynamicFriction):Float;\n inline function get_dynamicFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.dyn_fric;\n }\n inline function set_dynamicFriction(dynamicFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((dynamicFriction!=dynamicFriction))throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" cannot be NaN\";\n if(dynamicFriction<0)throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" cannot be negative\";\n if(\"dynamicFriction\"==\"restitution\"&&dynamicFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.dyn_fric=dynamicFriction;\n colarb.userdef_dyn_fric=true;\n }\n return get_dynamicFriction();\n }\n /**\n * Coeffecient of combined static friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's staticFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var staticFriction(get_staticFriction,set_staticFriction):Float;\n inline function get_staticFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.stat_fric;\n }\n inline function set_staticFriction(staticFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((staticFriction!=staticFriction))throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" cannot be NaN\";\n if(staticFriction<0)throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" cannot be negative\";\n if(\"staticFriction\"==\"restitution\"&&staticFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.stat_fric=staticFriction;\n colarb.userdef_stat_fric=true;\n }\n return get_staticFriction();\n }\n /**\n * Coeffecient of combined rolling friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's rollingFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var rollingFriction(get_rollingFriction,set_rollingFriction):Float;\n inline function get_rollingFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.rfric;\n }\n inline function set_rollingFriction(rollingFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((rollingFriction!=rollingFriction))throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" cannot be NaN\";\n if(rollingFriction<0)throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" cannot be negative\";\n if(\"rollingFriction\"==\"restitution\"&&rollingFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.rfric=rollingFriction;\n colarb.userdef_rfric=true;\n }\n return get_rollingFriction();\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Arbiter.internal)throw \"Error: Cannot instantiate CollisionArbiter derp!\";\n #end\n super();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Contact point for collision interactions\n *

\n * These objects are automatically reused and you should not keep references to them.\n */\n@:final#if nape_swc@:keep #end\nclass Contact{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Contact=null;\n /**\n * Reference to the CollisionArbiter this contact belongs to\n */\n #if nape_swc@:isVar #end\n public var arbiter(get_arbiter,never):CollisionArbiter;\n inline function get_arbiter():CollisionArbiter{\n return if(zpp_inner.arbiter==null)null else zpp_inner.arbiter.outer.collisionArbiter;\n }\n /**\n * Penetration of bodies along normal for this contact.\n *

\n * This value may be negative and corresponds to the penetration (if at all)\n * of the contact point before positional integration and error resolvement\n * took place (correct at time of pre-listeners).\n */\n #if nape_swc@:isVar #end\n public var penetration(get_penetration,never):Float;\n inline function get_penetration():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return(-zpp_inner.dist);\n }\n /**\n * The world-space position of contact.\n *

\n * This value corresponds to the position\n * of the contact point before positional integration and error resolvement\n * took place (correct at time of pre-listeners).\n */\n #if nape_swc@:isVar #end\n public var position(get_position,never):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n if(zpp_inner.wrap_position==null)zpp_inner.getposition();\n return zpp_inner.wrap_position;\n }\n /**\n * Whether this contact is newly generated, or persistant from previous step.\n */\n #if nape_swc@:isVar #end\n public var fresh(get_fresh,never):Bool;\n inline function get_fresh():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return zpp_inner.fresh;\n }\n /**\n * Evaluate normal reactive impulses for this contact for a given body.\n *

\n * If body argument is null, then the contact normal impulses will be returned instead\n * with no angular impulse derivable, the direction of this impulse will be the direction of the normal.\n *
\n * If body argument is not null, then this will return the actual impulse applied to that specific body\n * for this contact this will include angular impulses due to position of contact point and normal.\n *\n * @param body The Body to query normal impulse for. (default null)\n * @return The impulse applied to the given body, considering normal reactive forces.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jnAcc=cin.jnAcc;\n if(body==null)return Vec3.get(colarb.nx*jnAcc,colarb.ny*jnAcc);\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return Vec3.get(colarb.nx*-jnAcc,colarb.ny*-jnAcc,-(colarb.ny*cin.r1x-colarb.nx*cin.r1y)*jnAcc);\n else return Vec3.get(colarb.nx*jnAcc,colarb.ny*jnAcc,(colarb.ny*cin.r2x-colarb.nx*cin.r2y)*jnAcc);\n }\n }\n /**\n * Evaluate tangent impulses for this contact for a given body.\n *

\n * If body argument is null, then the contact friction impulses is returned with\n * no angular impulse derivable, the direction of this impulse will be against the relative\n * velocity of the first body against the second.\n *
\n * If the body argument is non-null, then the actual impulse applied to that body due to tangent\n * frictino impulses will be returned, including angular effects due to contact position and normal.\n *

\n * These tangent impulses correspond to the forces of static and dynamic friction for this contact.\n *\n * @param body The Body to query tangent impulse for. (default null)\n * @return The impulse applied to the given body, considering standard frictional forces.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jtAcc=cin.jtAcc;\n if(body==null)return Vec3.get(-colarb.ny*jtAcc,colarb.nx*jtAcc);\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return Vec3.get(colarb.ny*jtAcc,-colarb.nx*jtAcc,-(cin.r1x*colarb.nx+cin.r1y*colarb.ny)*jtAcc);\n else return Vec3.get(-colarb.ny*jtAcc,colarb.nx*jtAcc,(cin.r2x*colarb.nx+cin.r2y*colarb.ny)*jtAcc);\n }\n }\n /**\n * Evaluate rolling friction impulses for this contact for a given body.\n *

\n * If body argument is null, then the rolling impulse of this contact will be returned\n * instead of the angular impulse applied to the specific body as a result of the rolling impulse.\n *\n * @param body The Body to query rolling impulse for. (default null)\n * @return The angular impulse applied to the given body.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function rollingImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var jrAcc=zpp_inner.arbiter.colarb.jrAcc;\n if(body==null)return jrAcc;\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return-jrAcc;\n else return jrAcc;\n }\n }\n /**\n * Evaluate total contact impulse for a given body.\n *

\n * If body argument is null, then this will return the sum of normal and tangent contact impulse, and the contact\n * rolling impulse.\n *
\n * When body argument is non-null, this impulse will be the actual change in (mass weighted)\n * velocity that this contact caused to the Body in the previous time step.\n *\n * @param body The Body to query total impulse for. (default null)\n * @return The impulse applied to the given body\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jnAcc=cin.jnAcc;\n var jtAcc=cin.jtAcc;\n var jrAcc=colarb.jrAcc;\n if(body==null){\n return Vec3.get(colarb.nx*jnAcc-colarb.ny*jtAcc,colarb.ny*jnAcc+colarb.nx*jtAcc,jrAcc);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n var jx:Float=colarb.nx*jnAcc-colarb.ny*jtAcc;\n var jy:Float=colarb.ny*jnAcc+colarb.nx*jtAcc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jx!=jx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jx)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"colarb.nx*jnAcc-colarb.ny*jtAcc\"+\",in y: \"+\"colarb.ny*jnAcc+colarb.nx*jtAcc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jy!=jy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jy)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"colarb.nx*jnAcc-colarb.ny*jtAcc\"+\",in y: \"+\"colarb.ny*jnAcc+colarb.nx*jtAcc\"+\")\");\n #end\n };\n if(body==colarb.b1.outer)return Vec3.get(-jx,-jy,-(jy*cin.r1x-jx*cin.r1y)-jrAcc);\n else return Vec3.get(jx,jy,(jy*cin.r2x-jx*cin.r2y)+jrAcc);\n }\n }\n /**\n * The specific coeffecient of friction for this contact.\n *

\n * This value is equal either to the static or dynamic friction coeffecient of the arbiter\n * based on the relative velocity at contact point.\n *

\n * This value cannot be set, though you may implicitly set it exactly by modifying\n * the arbiter to have the same static and dynamic friction in the PreListener.\n */\n #if nape_swc@:isVar #end\n public var friction(get_friction,never):Float;\n inline function get_friction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return zpp_inner.inner.friction;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Contact.internal)throw \"Error: Cannot instantiate Contact derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(zpp_inner.arbiter==null||zpp_inner.arbiter.cleared)return \"{object-pooled}\";\n else return \"{Contact}\";\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ContactIterator{\n /**\n * @private\n */\n public var zpp_inner:ContactList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ContactIterator=null;\n /**\n * @private\n */\n public var zpp_next:ContactIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ContactList.internal)throw \"Error: Cannot instantiate \"+\"Contact\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ContactList){\n var ret=if(zpp_pool==null){\n ZPP_ContactList.internal=true;\n var ret=new ContactIterator();\n ZPP_ContactList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Contact = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Contact = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Contact = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ContactList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ContactList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active&&i.arbiter.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active&&i.arbiter.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Contact\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ContactList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Contact)#else Std.is(i,Contact)#end)throw \"Error: Array contains non \"+\"Contact\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ContactList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Contact):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Contact{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!true){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Contact{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Contact{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Contact):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(true)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ContactIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ContactList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Contact\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ContactList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ContactList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Contact->Void):ContactList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ContactIterator.zpp_pool;\n ContactIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Contact->Bool):ContactList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This value can be modified during a related PreListener handler.\n */\n #if nape_swc@:isVar #end\n public var position(get_position,set_position):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n if(zpp_inner.fluidarb.wrap_position==null)zpp_inner.fluidarb.getposition();\n return zpp_inner.fluidarb.wrap_position;\n }\n inline function set_position(position:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.fluidarb.mutable)throw \"Error: Arbiter is mutable only within a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: FluidArbiter::position cannot be null\";\n #end\n this.position.set(position);\n }\n return get_position();\n }\n /**\n * Overlap area of Shapes in fluid interaction.\n *

\n * This value is strictly positive, and represents the amount of overlap between the Shapes\n * used in buoyancy computations.\n *

\n * This value can be modified during a related PreListener handler.\n */\n #if nape_swc@:isVar #end\n public var overlap(get_overlap,set_overlap):Float;\n inline function get_overlap():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.fluidarb.overlap;\n }\n inline function set_overlap(overlap:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.fluidarb.mutable)throw \"Error: Arbiter is mutable only within a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((overlap!=overlap))throw \"Error: FluidArbiter::overlap cannot be NaN\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(overlap<=0||overlap==Math.POSITIVE_INFINITY)throw \"Error: FluidArbiter::overlap must be strictly positive and non infinite\";\n #end\n zpp_inner.fluidarb.overlap=overlap;\n }\n return get_overlap();\n }\n /**\n * Determine impulse on a given body due to buoyancy.\n *

\n * If the body is null, then the buoyancy impulse will be returned without consideration to any specific\n * body involved, and no angular impulses can be derived.\n *\n * @param body The body to query impulse for. (default null)\n * @return The buoyancy impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function buoyancyImpulse(body:Body=null):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var farb=zpp_inner.fluidarb;\n if(body==null){\n return Vec3.get(farb.buoyx,farb.buoyy,0);\n }\n else if(body.zpp_inner==zpp_inner.b2){\n return Vec3.get(farb.buoyx,farb.buoyy,(farb.buoyy*farb.r2x-farb.buoyx*farb.r2y));\n }\n else{\n return Vec3.get(-farb.buoyx,-farb.buoyy,-(farb.buoyy*farb.r1x-farb.buoyx*farb.r1y));\n }\n }\n /**\n * Determine impulse on a given body due to fluid drag.\n *

\n * If the body is null, then the drag impulse will be returned without consideration to any specific\n * body involved.\n *\n * @param body The body to query impulse for. (default null)\n * @return The drag impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function dragImpulse(body:Body=null):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var farb=zpp_inner.fluidarb;\n var scale=(body==null||body.zpp_inner==zpp_inner.b2?1:-1);\n return Vec3.get(farb.dampx*scale,farb.dampy*scale,farb.adamp*scale);\n }\n /**\n * Determine total impulse on a given body due to fluid interaction.\n *

\n * If the body is null, then the total impulse will be computed without consideration to any specific\n * body involved, and no angular impulses can be derived for the linear portion of the impulses.\n *\n * @param body The body to query impulse for. (default null)\n * @param freshOnly This parameter is unused for FluidArbiters. (default false)\n * @return The total impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public override function totalImpulse(body:Body=null,freshOnly:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var tmp=this.buoyancyImpulse(body);\n var ret=this.dragImpulse(body);\n ret.x+=tmp.x;\n ret.y+=tmp.y;\n ret.z+=tmp.z;\n tmp.dispose();\n return ret;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Arbiter.internal)throw \"Error: Cannot instantiate FluidArbiter derp!\";\n #end\n super();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * InteractionFilter provides bit flags for low-level filtering of interactions.\n *

\n * For a given interaction type, two Shapes will be permitted to interact only if\n * (shape1.group & shape2.mask) != 0 && (shape2.group & shape1.mask) != 0\n *

\n * There are 32 real groups corresponding to a set bit in the group/mask fields. For instance\n * a group value of 0x120 corresponds to the 'real' groups 5 and 8 as 0x120 = (1<<5) | (1<<8)\n *

\n * Nape provides group/mask for each interaction type. The actual precedence of interactions\n * is further defined simply as: Sensor > Fluid > Collision.\n *
\n * Two static bodies can never interact, and with the exception of sensor interaction, at least one\n * of the two bodies must be dynamic.\n *
\n * Sensor interactions have the highest precedence, followed by fluid and then collisions.\n * Sensor interaction is permitted only if one of the shapes is sensorEnabled, whilst fluid\n * is permitted only if one of the shapes is fluidEnabled.\n *
\n * if ((shapeA.sensorEnabled || shapeB.sensorEnabled) && shapeA.filter.shouldSense(shapeB.filter)) {\n *     SENSOR INTERACTION!!\n * }\n * else if (bodyA.isDynamic() || bodyB.isDynamic()) {\n *     if ((shapeA.fluidEnabled || shapeB.fluidEnabled) && shapeA.filter.shouldFlow(shapeB.filter)) {\n *         FLUID INTERACTION!!\n *     }\n *     else if (shapeA.filter.shouldCollide(shapeB.filter)) {\n *         COLLISION INTERACTION!!\n *     }\n * }\n * 
\n */\n@:final#if nape_swc@:keep #end\nclass InteractionFilter{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionFilter=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Group bitfield for Collision type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var collisionGroup(get_collisionGroup,set_collisionGroup):Int;\n inline function get_collisionGroup():Int{\n return zpp_inner.collisionGroup;\n }\n inline function set_collisionGroup(collisionGroup:Int):Int{\n {\n if(this.collisionGroup!=collisionGroup){\n zpp_inner.collisionGroup=collisionGroup;\n zpp_inner.invalidate();\n }\n }\n return get_collisionGroup();\n }\n /**\n * Mask bitfield for Collision type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var collisionMask(get_collisionMask,set_collisionMask):Int;\n inline function get_collisionMask():Int{\n return zpp_inner.collisionMask;\n }\n inline function set_collisionMask(collisionMask:Int):Int{\n {\n if(this.collisionMask!=collisionMask){\n zpp_inner.collisionMask=collisionMask;\n zpp_inner.invalidate();\n }\n }\n return get_collisionMask();\n }\n /**\n * Group bitfield for Sensor type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var sensorGroup(get_sensorGroup,set_sensorGroup):Int;\n inline function get_sensorGroup():Int{\n return zpp_inner.sensorGroup;\n }\n inline function set_sensorGroup(sensorGroup:Int):Int{\n {\n if(this.sensorGroup!=sensorGroup){\n zpp_inner.sensorGroup=sensorGroup;\n zpp_inner.invalidate();\n }\n }\n return get_sensorGroup();\n }\n /**\n * Mask bitfield for Sensor type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var sensorMask(get_sensorMask,set_sensorMask):Int;\n inline function get_sensorMask():Int{\n return zpp_inner.sensorMask;\n }\n inline function set_sensorMask(sensorMask:Int):Int{\n {\n if(this.sensorMask!=sensorMask){\n zpp_inner.sensorMask=sensorMask;\n zpp_inner.invalidate();\n }\n }\n return get_sensorMask();\n }\n /**\n * Group bitfield for Fluid type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var fluidGroup(get_fluidGroup,set_fluidGroup):Int;\n inline function get_fluidGroup():Int{\n return zpp_inner.fluidGroup;\n }\n inline function set_fluidGroup(fluidGroup:Int):Int{\n {\n if(this.fluidGroup!=fluidGroup){\n zpp_inner.fluidGroup=fluidGroup;\n zpp_inner.invalidate();\n }\n }\n return get_fluidGroup();\n }\n /**\n * Mask bitfield for Fluid type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var fluidMask(get_fluidMask,set_fluidMask):Int;\n inline function get_fluidMask():Int{\n return zpp_inner.fluidMask;\n }\n inline function set_fluidMask(fluidMask:Int):Int{\n {\n if(this.fluidMask!=fluidMask){\n zpp_inner.fluidMask=fluidMask;\n zpp_inner.invalidate();\n }\n }\n return get_fluidMask();\n }\n /**\n * Construct a new InteractionFilter.\n *\n * @param collisionGroup The Group bitfield for Collision interactions. (default 1)\n * @param collisionMask The Mask bitfield for Collision interactions. (default -1)\n * @param sensorGroup The Group bitfield for Sensor interactions. (default 1)\n * @param sensorMask The Mask bitfield for Sensor interactions. (default -1)\n * @param fluidGroup The Group bitfield for Fluid interactions. (default 1)\n * @param fluidMask The Mask bitfield for Fluid interactions. (default -1)\n * @return The newly constructed InteractionFilter.\n */\n #if flib@:keep function flibopts_6(){}\n #end\n public function new(collisionGroup=1,collisionMask=-1,sensorGroup=1,sensorMask=-1,fluidGroup=1,fluidMask=-1){\n {\n if(ZPP_InteractionFilter.zpp_pool==null){\n zpp_inner=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.collisionGroup=collisionGroup;\n this.collisionMask=collisionMask;\n this.sensorGroup=sensorGroup;\n this.sensorMask=sensorMask;\n this.fluidGroup=fluidGroup;\n this.fluidMask=fluidMask;\n }\n /**\n * Determine if objects are permitted to collide based on InteractionFilters\n *

\n * A collision type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of collision with.\n * @return True, if based on interaction filters only the two objects would be able to collide.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldCollide(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldCollide\";\n #end\n return zpp_inner.shouldCollide(filter.zpp_inner);\n }\n /**\n * Determine if objects are permitted to sense based on InteractionFilters\n *

\n * A sensor type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of sensor with.\n * @return True, if based on interaction filters only the two objects would be able to sense.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldSense(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldSense\";\n #end\n return zpp_inner.shouldSense(filter.zpp_inner);\n }\n /**\n * Determine if objects are permitted to interact as fluids based on InteractionFilters\n *

\n * A fluid type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of fluid with.\n * @return True, if based on interaction filters only the two objects would be able to interact as fluids.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldFlow(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldFlow\";\n #end\n return zpp_inner.shouldFlow(filter.zpp_inner);\n }\n /**\n * Produce a copy of this InteractionFilter\n *\n * @return The copy of this filter.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return new InteractionFilter(collisionGroup,collisionMask,sensorGroup,sensorMask,fluidGroup,fluidMask);\n }\n /**\n * @private\n */\n #if nape_swc@:keep #end\n public function toString(){\n return \"{ collision: \"+StringTools.hex(collisionGroup,8)+\"~\"+StringTools.hex(collisionMask,8)+\" sensor: \"+StringTools.hex(sensorGroup,8)+\"~\"+StringTools.hex(sensorMask,8)+\" fluid: \"+StringTools.hex(fluidGroup,8)+\"~\"+StringTools.hex(fluidMask,8)+\" }\";\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * InteractionGroups are another way of filtering interactions.\n *

\n * InteractionGroups form tree structures which are checked along side InteractionFilters\n * when deciding if two Shapes should interact.\n *

\n * InteractionGroups are assigned to any Interactor (not just Shapes), and two Shapes will\n * interact only if the most recent common ancestor in the InteractionGroup tree permits it.\n *

\n * For the purposes of the search, if any Interactor has no InteractionGroup assigned, we\n * search up the Compound tree first.\n *
\n *            _Group1\n *           /   |\n *          /  Group2      Group3\n *         /    |    \\       |                 Group1\n *     Body1   /      Cmp1   |                 /   \\           Group3\n *    /    \\  /      /    \\  |      ==>    Shp1    Group2        |\n * Shp1   Shp2   Body2     Cmp2                    /    \\      Shp4\n *                 |         |                  Shp2    Shp3\n *                Shp3     Body3\n *                           |\n *                         Shp4\n * 
\n * If we look at which InteractionGroup is used for which Shape following this rule, then\n * the left graph can be transformed into an InteractionGroup tree on the right and we get\n * that the MRCA (Most recent common ancestors) are such that:\n *
\n * MRCA(Shp1, Shp3) == Group1;\n * MRCA(Shp2, Shp3) == Group2;\n * MRCA(Shp4,   # ) == null;\n * 
\n * If we were to set up the groups such that Group1.ignore = false and\n * Group2.ignore = true; then shapes 1 and 3 would not be permitted to\n * interact, whilst shapes 2 and 3 would be permitted.\n *
\n * As the MRCA for shape 4 with any other is null, then the value of Group3's ignore field\n * is irrelevant, but the existance of Group3 is not as it serves to otherwise prevent Shape 4\n * from being permitted to interact with shapes 2 and 3.\n *

\n * InteractionGroup's can be fairly expressive, but they are strictly less powerful than\n * InteractionFilters. InteractionGroup's have their place however as there is no limit\n * to the number of Groups you can use.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionGroup{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionGroup=null;\n /**\n * Parent group in InteractionGroup tree.\n * @default null\n */\n #if nape_swc@:isVar #end\n public var group(get_group,set_group):Null;\n inline function get_group():Null{\n return if(zpp_inner.group==null)null else zpp_inner.group.outer;\n }\n inline function set_group(group:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(group==this)throw \"Error: Cannot assign InteractionGroup to itself\";\n #end\n zpp_inner.setGroup(group==null?null:group.zpp_inner);\n }\n return get_group();\n }\n /**\n * Ignore property, set to true so that objects will not interact.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var ignore(get_ignore,set_ignore):Bool;\n inline function get_ignore():Bool{\n return zpp_inner.ignore;\n }\n inline function set_ignore(ignore:Bool):Bool{\n {\n if(this.ignore!=ignore){\n zpp_inner.invalidate(true);\n zpp_inner.ignore=ignore;\n }\n }\n return get_ignore();\n }\n /**\n * Set of active interactors using this group.\n *

\n * Active interactors meaning those that are part of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var interactors(get_interactors,never):InteractorList;\n inline function get_interactors():InteractorList{\n if(zpp_inner.wrap_interactors==null)zpp_inner.wrap_interactors=ZPP_InteractorList.get(zpp_inner.interactors,true);\n return zpp_inner.wrap_interactors;\n }\n /**\n * Immutable set of children of Interaction groups.\n *

\n * You cannot assign or remove children in this manner, you must do it via setting\n * the childs parent group to this/null.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var groups(get_groups,never):InteractionGroupList;\n inline function get_groups():InteractionGroupList{\n if(zpp_inner.wrap_groups==null)zpp_inner.wrap_groups=ZPP_InteractionGroupList.get(zpp_inner.groups,true);\n return zpp_inner.wrap_groups;\n }\n /**\n * Construct a new InteractionGroup.\n *\n * @param ignore Whether interactors should be ignored. (default false)\n */\n public function new(ignore=false){\n zpp_inner=new ZPP_InteractionGroup();\n zpp_inner.outer=this;\n this.ignore=ignore;\n }\n /**\n * @private\n */\n public function toString(){\n var ret=\"InteractionGroup\";\n if(ignore)ret+=\":ignore\";\n return ret;\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractionGroupIterator{\n /**\n * @private\n */\n public var zpp_inner:InteractionGroupList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:InteractionGroupIterator=null;\n /**\n * @private\n */\n public var zpp_next:InteractionGroupIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_InteractionGroupList.internal)throw \"Error: Cannot instantiate \"+\"InteractionGroup\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:InteractionGroupList){\n var ret=if(zpp_pool==null){\n ZPP_InteractionGroupList.internal=true;\n var ret=new InteractionGroupIterator();\n ZPP_InteractionGroupList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:InteractionGroup = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:InteractionGroup = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:InteractionGroup = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractionGroupList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionGroupList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than InteractionGroup\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new InteractionGroupList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,InteractionGroup)#else Std.is(i,InteractionGroup)#end)throw \"Error: Array contains non \"+\"InteractionGroup\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new InteractionGroupList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:InteractionGroup):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):InteractionGroup{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():InteractionGroup{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():InteractionGroup{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:InteractionGroup):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return InteractionGroupIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new InteractionGroupList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"InteractionGroup\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:InteractionGroupList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_InteractionGroupList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:InteractionGroup->Void):InteractionGroupList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=InteractionGroupIterator.zpp_pool;\n InteractionGroupIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:InteractionGroup->Bool):InteractionGroupList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Note that in many cases of an AABB object being returned by a Nape function\n * the AABB object will be marked internally as an 'immutable' AABB. This will\n * always be documented and trying to mutate such an AABB will result in an\n * error being thrown.\n */\n@:final#if nape_swc@:keep #end\nclass AABB{\n /**\n * @private\n */\n public var zpp_inner:ZPP_AABB=null;\n /**\n * Construct a new AABB.\n *

\n * As input width/height are permitted to be negative it is not guaranteed\n * that the resultant AABB will have the same parameters as those\n * specified as the AABB parameters are guaranteed to always have positive\n * width/height, and for x/y to always be the top-left corner.\n *\n * @param x The x coordinate of the top-left corner of the AABB.\n * (default 0)\n * @param y The y coordinate of the top-left corner of the AABB\n * (default 0)\n * @param width The width of the AABB. This value may be negative.\n * (default 0)\n * @param height The height of the AABB. This value may be negative.\n * (default 0)\n * @return The newly constructed AABB object.\n */\n public function new(x:Float=0,y:Float=0,width:Float=0,height:Float=0){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: AABB position cannot be NaN\";\n }\n if((width!=width)||(height!=height)){\n throw \"Error: AABB dimensions cannot be NaN\";\n }\n #end\n zpp_inner=ZPP_AABB.get(x,y,x+width,y+height);\n zpp_inner.outer=this;\n }\n /**\n * Produce a copy of this AABB.\n *

\n * As would be expected, if you produce a copy of an 'immutable' AABB then\n * the copy will be 'mutable'.\n *\n * @return The copy of this AABB.\n */\n #if nape_swc@:keep #end\n public function copy(){\n zpp_inner.validate();\n return zpp_inner.copy().wrapper();\n }\n #if(flash9||openfl||nme)\n /**\n * Construct an AABB from an AS3 Rectangle object.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param rect The AS3 Rectangle to construct AABB from, this value\n * must not be null.\n * @return The constructed AABB matching the input Rectangle.\n * @throws # If the input rectangle is null.\n */\n #if nape_swc@:keep #end\n public static function fromRect(rect:flash.geom.Rectangle):AABB{\n #if(!NAPE_RELEASE_BUILD)\n if(rect==null){\n throw \"Error: Cannot create AABB from null Rectangle\";\n }\n #end\n return new AABB(rect.x,rect.y,rect.width,rect.height);\n }\n /**\n * Create an AS3 Rectangle object from AABB.\n *

\n * This method is available only on flash and\n * openfl||nme targets.\n *\n * @return The AS3 Rectangle object representing AABB.\n */\n #if nape_swc@:keep #end\n public function toRect():flash.geom.Rectangle{\n return new flash.geom.Rectangle(x,y,width,height);\n }\n #end\n /**\n * The minimum bounds for the AABB.\n *

\n * Euivalent to the top-left corner.\n *
\n * This Vec2 is intrinsically linked to the AABB so that modifications\n * to this object are reflected in changes to the AABB and vice-versa.\n *

\n * If the AABB is immutable, then this Vec2 will also be immutable.\n *

\n * This value can be set with the = operator, equivalent to performing\n * aabb.min.set(value).\n * @default (0, 0)\n */\n #if nape_swc@:isVar #end\n public var min(get_min,set_min):Vec2;\n inline function get_min():Vec2{\n return zpp_inner.getmin();\n }\n inline function set_min(min:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(min!=null&&min.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n if(min==null){\n throw \"Error: Cannot assign null to AABB::\"+\"min\";\n }\n if((x!=x)||(y!=y)){\n throw \"Error: AABB::\"+\"min\"+\" components cannot be NaN\";\n }\n if(\"min\"==\"min\"){\n if(min.x>max.x)throw \"Error: Assignment would cause negative width\";\n if(min.y>max.y)throw \"Error: Assignment would cause negative height\";\n }\n else{\n if(min.x
\n * Euivalent to the bottom-right corner.\n *
\n * This Vec2 is intrinsically linked to the AABB so that modifications\n * to this object are reflected in changes to the AABB and vice-versa.\n *

\n * If the AABB is immutable, then this Vec2 will also be immutable.\n *

\n * This value can be set with the = operator, equivalent to performing\n * aabb.max.set(value).\n * @default (0, 0)\n */\n #if nape_swc@:isVar #end\n public var max(get_max,set_max):Vec2;\n inline function get_max():Vec2{\n return zpp_inner.getmax();\n }\n inline function set_max(max:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(max!=null&&max.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n if(max==null){\n throw \"Error: Cannot assign null to AABB::\"+\"max\";\n }\n if((x!=x)||(y!=y)){\n throw \"Error: AABB::\"+\"max\"+\" components cannot be NaN\";\n }\n if(\"max\"==\"min\"){\n if(max.x>max.x)throw \"Error: Assignment would cause negative width\";\n if(max.y>max.y)throw \"Error: Assignment would cause negative height\";\n }\n else{\n if(max.x
\n * Equivalent to accessing/mutating min.x.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n zpp_inner.validate();\n return zpp_inner.minx;\n }\n inline function set_x(x:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.x!=x){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x))throw \"Error: AABB::\"+\"x\"+\" cannot be NaN\";\n #end\n zpp_inner.maxx+=x-zpp_inner.minx;\n zpp_inner.minx=x;\n zpp_inner.invalidate();\n }\n }\n return get_x();\n }\n /**\n * The y coordinate of the AABB's top-left corner.\n *

\n * Equivalent to accessing/mutating min.y.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n zpp_inner.validate();\n return zpp_inner.miny;\n }\n inline function set_y(y:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.y!=y){\n #if(!NAPE_RELEASE_BUILD)\n if((y!=y))throw \"Error: AABB::\"+\"y\"+\" cannot be NaN\";\n #end\n zpp_inner.maxy+=y-zpp_inner.miny;\n zpp_inner.miny=y;\n zpp_inner.invalidate();\n }\n }\n return get_y();\n }\n /**\n * width of AABB.\n *

\n * This value is and must always be positive.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var width(get_width,set_width):Float;\n inline function get_width():Float{\n zpp_inner.validate();\n return zpp_inner.width();\n }\n inline function set_width(width:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.width!=width){\n #if(!NAPE_RELEASE_BUILD)\n if((width!=width)){\n throw \"Error: AABB::\"+\"width\"+\" cannot be NaN\";\n }\n if(width<0){\n throw \"Error: AABB::\"+\"width\"+\" (\"+width+\") must be >= 0\";\n }\n #end\n zpp_inner.maxx=this.x+width;\n zpp_inner.invalidate();\n }\n }\n return get_width();\n }\n /**\n * height of AABB.\n *

\n * This value is and must always be positive.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var height(get_height,set_height):Float;\n inline function get_height():Float{\n zpp_inner.validate();\n return zpp_inner.height();\n }\n inline function set_height(height:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.height!=height){\n #if(!NAPE_RELEASE_BUILD)\n if((height!=height)){\n throw \"Error: AABB::\"+\"height\"+\" cannot be NaN\";\n }\n if(height<0){\n throw \"Error: AABB::\"+\"height\"+\" (\"+height+\") must be >= 0\";\n }\n #end\n zpp_inner.maxy=this.y+height;\n zpp_inner.invalidate();\n }\n }\n return get_height();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n zpp_inner.validate();\n return zpp_inner.toString();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing the results of a convex cast operation.\n *

\n * These objects are allocated from an object pool and can\n * be released back to that pool by calling its dispose method.\n */\n@:final#if nape_swc@:keep #end\nclass ConvexResult{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexRayResult=null;\n /**\n * The normal of the surface at collision.\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.normal;\n }\n /**\n * The position of the collision.\n */\n #if nape_swc@:isVar #end\n public var position(get_position,never):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.position;\n }\n /**\n * The time of impact to the collision\n */\n #if nape_swc@:isVar #end\n public var toi(get_toi,never):Float;\n inline function get_toi():Float{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.toiDistance;\n }\n /**\n * The shape which was collided against.\n */\n #if nape_swc@:isVar #end\n public var shape(get_shape,never):Shape;\n inline function get_shape():Shape{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.shape;\n }\n /**\n * @private\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexRayResult.internal)throw \"Error: ConvexResult cannot be instantiated derp!\";\n #end\n }\n /**\n * Release ConvexResult object to pool.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n zpp_inner.free();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return \"{ shape: \"+shape+\" toi: \"+toi+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConvexResultIterator{\n /**\n * @private\n */\n public var zpp_inner:ConvexResultList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ConvexResultIterator=null;\n /**\n * @private\n */\n public var zpp_next:ConvexResultIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexResultList.internal)throw \"Error: Cannot instantiate \"+\"ConvexResult\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ConvexResultList){\n var ret=if(zpp_pool==null){\n ZPP_ConvexResultList.internal=true;\n var ret=new ConvexResultIterator();\n ZPP_ConvexResultList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:ConvexResult = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:ConvexResult = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:ConvexResult = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConvexResultList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexResultList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than ConvexResult\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ConvexResultList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,ConvexResult)#else Std.is(i,ConvexResult)#end)throw \"Error: Array contains non \"+\"ConvexResult\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ConvexResultList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:ConvexResult):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):ConvexResult{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n else zpp_inner.inner.add(obj);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():ConvexResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():ConvexResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:ConvexResult):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ConvexResultIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ConvexResultList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"ConvexResult\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ConvexResultList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ConvexResultList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:ConvexResult->Void):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ConvexResultIterator.zpp_pool;\n ConvexResultIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:ConvexResult->Bool):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This class represents a general Polygon, rather than the Polygon class\n * which is physics shape.\n *

\n * Internally this polygon is stored as a circularly linked list of special\n * vertex types that are exposed via a Vec2 that is lazily constructed whenever\n * necessary to the API.\n */\n@:final#if nape_swc@:keep #end\nclass GeomPoly{\n /**\n * @private\n */\n public var zpp_pool:GeomPoly=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * @private\n */\n public var zpp_inner:ZPP_GeomPoly=null;\n /**\n * Determine if polygon is empty.\n *\n * @return True if polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return(zpp_inner.vertices==null);\n }\n /**\n * Determine number of vertices in polygon\n *\n * @return The number of vertices.\n * @throws # If this GeomPoly has been disposed.\n */\n public function size():Int{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n });\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function iterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,true);\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * Iterating in a forward direction.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function forwardIterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,true);\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * Iterating in a backwards direction.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function backwardsIterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,false);\n }\n /**\n * Current vertex at head of polygon.\n *

\n * The current vertex will not be changed by this access.\n *

\n * This function returns a Vec2 which will be intrinsically tied\n * to the values of the internal vertex so that modifications to\n * this Vec2 will be reflected in the vertex of the polygon.\n *

\n * If invoked again with the head of the polygon pointing to the\n * same vertex, then the same Vec2 will be returned; this Vec2 is\n * not able to be disposed of.\n *\n * @return A Vec2 representing the current vertex of polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function current():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: GeomPoly is empty\";\n }\n #end\n return zpp_inner.vertices.wrapper();\n }\n /**\n * Push vertex to polygon.\n *

\n * A vertex will be allocated from a global object pool, and initialised\n * with the values of the given Vec2.\n *

\n * This vertex will be inserted after the current head, and the head\n * advanced to the newly inserted vertex, in this way successive pushes\n * will insert elements in order.\n *

\n * Note that the Vec2 supplied as argument is only used to initialise the\n * inner Vertex.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.push(X);\n     *\n     * poly := -> A <-> B <-> X <-> C <-> D <-> E <-\n     *                      (head)\n     * 
\n *\n * @param vertex The Vec2 to be used in initialising the inner vertex.\n * @return A reference to this polygon.\n * @throws # If Vec2 is null, or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function push(vertex:Vec2):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vertex!=null&&vertex.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vertex==null){\n throw \"Error: Cannot push null vertex\";\n }\n #end\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(vertex.x,vertex.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n ({\n if(({\n vertex.zpp_inner.weak;\n })){\n vertex.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Pop vertex from polygon.\n *

\n * Pop the current vertex at head of polygon, retreating the 'current'\n * vertex to point to the previous vertex in polygon. This inner vertex\n * will be released to the global object pool.\n *

\n * In this way a pop which follows a push will act to reset the push.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.pop();\n     *\n     * poly := -> A <-> C <-> D <-> E <-\n     *          (head)\n     * 
\n *\n * @return A reference to this polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function pop():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((zpp_inner.vertices==null)){\n throw \"Error: Cannot pop from empty polygon\";\n }\n #end\n var retv=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list derpiderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n null;\n }\n else{\n var retnodes=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n return this;\n }\n /**\n * Unshift vertex to polygon.\n *

\n * A vertex will be allocated from a global object pool, and initialised\n * with the values of the given Vec2.\n *

\n * This vertex will be inserted before the current head, and the head\n * retreated to the newly inserted vertex, in this way successive unshifts\n * will insert elements in the expected reverse order.\n *

\n * Note that the Vec2 supplied as argument is only used to initialise the\n * inner Vertex.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.unshift(X);\n     *\n     * poly := -> A <-> X <-> B <-> C <-> D <-> E <-\n     *                (head)\n     * 
\n *\n * @param vertex The Vec2 to be used in initialising the inner vertex.\n * @return A reference to this polygon.\n * @throws # If Vec2 is null, or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function unshift(vertex:Vec2):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vertex!=null&&vertex.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vertex==null){\n throw \"Error: Cannot unshift null vertex\";\n }\n #end\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(vertex.x,vertex.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.next=zpp_inner.vertices;\n obj.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=obj;\n zpp_inner.vertices.prev=obj;\n }\n obj;\n };\n ({\n if(({\n vertex.zpp_inner.weak;\n })){\n vertex.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Shift vertex from polygon.\n *

\n * Shift the current vertex at head of polygon, advancing the 'current'\n * vertex to point to the next vertex in polygon. This inner vertex\n * will be released to the global object pool.\n *

\n * In this way a shift which follows an unshift will act to reset the\n * unshift operation.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.shift();\n     *\n     * poly := -> A <-> C <-> D <-> E <-\n     *                (head)\n     * 
\n *\n * @return A reference to this polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function shift():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((zpp_inner.vertices==null)){\n throw \"Error: Cannot shift from empty polygon\";\n }\n #end\n var retv=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n return this;\n }\n /**\n * Advance head of polygon forward.\n *

\n * The current head of polygon will be moved forwards\n * the given number of times, with a negative value\n * being equivalent to performing a backwards advance.\n *

\n * poly.skip_forwards(times) is equivalent to\n * poly.skip_backwards(-times)\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.skipForwards(2);\n     *\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                            (head)\n     * 
\n *\n * @params times The number of times to advance head forward.\n * This value can be negative indicating a backwards\n * advance.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function skipForward(times:Int):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(!(zpp_inner.vertices==null)){\n if(times>0){\n while(times-->0)zpp_inner.vertices=zpp_inner.vertices.next;\n }\n else if(times<0){\n while(times++<0)zpp_inner.vertices=zpp_inner.vertices.prev;\n }\n }\n return this;\n }\n /**\n * Advance head of polygon backwards.\n *

\n * The current head of polygon will be moved backwards\n * the given number of times, with a negative value\n * being equivalent to performing a forwards advance.\n *

\n * poly.skip_backwards(times) is equivalent to\n * poly.skip_forwards(-times)\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.skipBackwards(2);\n     *\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                                  (head)\n     * 
\n *\n * @params times The number of times to advance head backwards.\n * This value can be negative indicating a forwards\n * advance.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function skipBackwards(times:Int){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return skipForward(-times);\n }\n /**\n * Erase count number of elements\n *

\n * For positive values of count, this is equivalent to successive\n * unshift operations.\n *

\n * For negative values of count, this is equivalent to successive\n * pop operations.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-> F <-> G <-\n     *                (head)\n     *\n     * poly.erase(2);\n     *\n     * poly := -> A <-> D <-> E <-> F <-> G <-\n     *                (head)\n     *\n     * poly.erase(-3);\n     *\n     * poly := -> E <-> F <-\n     *                (head)\n     * 
\n * In this case that the specified number of elements to erase is\n * greater than the size of the polygon, the method will simply\n * terminate with the polygon being empty.\n *\n * @param count The number of vertices to erase, with sign indicating\n * the direction for erasing.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function erase(count:Int):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n while(count!=0&&!(zpp_inner.vertices==null)){\n var retv=zpp_inner.vertices;\n if(count>0){\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n count--;\n }\n else if(count<0){\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list derpiderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n null;\n }\n else{\n var retnodes=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n count++;\n }\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n }\n return this;\n }\n /**\n * Clear all vertices from polygon.\n *

\n * All of the vertices will be released to the global object pool.\n *\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function clear():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n while(!(zpp_inner.vertices==null)){\n var tmp=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=tmp;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"tmp\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n }\n };\n return this;\n }\n /**\n * Copy this polygon.\n *

\n * The copy will have its vertices in the same order as 'this' polygon.\n * It will also have its current vertex at head, as the same vertex\n * this polygon has.\n *

\n * This polygon will not be modified in any way.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly2 = poly.copy();\n     *\n     * poly2 := -> A' <-> B' <-> C' <-> D' <-> E' <-\n     *                  (head)\n     * 
\n *\n * @return The new GeomPoly representing the copy.\n * @throws # If this GeomPoly has been disposed.\n */\n public function copy():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=GeomPoly.get();\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return ret.skipForward(1);\n }\n /**\n * Create a new GeomPoly polygon.\n *

\n * The vertices argument is typed Dynamic (* in AS3), and is permitted\n * to be one of: Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *

\n * The input will be used to initialise the vertices of the polygon with\n * the head of the polygon pointing to the first vertex in input with vertices\n * inserted in forward order.\n *

\n * You should use the static 'get' method in preference to make use of object pool.\n *\n * @param vertices Vertex data to initialise polygon, or null for empty polygon.\n * @return New GeomPoly representing input vertex data.\n * @throws # If input data is not of an expected Type.\n */\n public function new(vertices:Dynamic=null){\n zpp_inner=new ZPP_GeomPoly(this);\n if(vertices!=null){\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash10 untyped __is__(vertices,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n #end\n }\n else if(#if flash untyped __is__(vertices,Vec2List)#else Std.is(vertices,Vec2List)#end){\n var lv:Vec2List=vertices;\n for(v in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(v==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash untyped __is__(vertices,GeomPoly)#else Std.is(vertices,GeomPoly)#end){\n var lv:GeomPoly=vertices;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var v=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n v.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n skipForward(1);\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n var i=0;\n while(i=vertices;\n if(!lv.fixed){\n var i:Int=0;\n while(i
\n * The vertices argument is typed Dynamic (* in AS3), and is permitted\n * to be one of: Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *

\n * The input will be used to initialise the vertices of the polygon with\n * the head of the polygon pointing to the first vertex in input with vertices\n * inserted in forward order.\n *\n * @param vertices Vertex data to initialise polygon, or null for empty polygon.\n * @return New GeomPoly representing input vertex data, allocated from object pool.\n * @throws # If input data is not of an expected Type.\n */\n public static function get(vertices:Dynamic=null){\n var ret;\n {\n if(ZPP_PubPool.poolGeomPoly==null){\n ret=new GeomPoly();\n #if NAPE_POOL_STATS GeomPoly.POOL_TOT++;\n GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolGeomPoly;\n ZPP_PubPool.poolGeomPoly=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextGeomPoly)ZPP_PubPool.nextGeomPoly=null;\n #end\n #if NAPE_POOL_STATS GeomPoly.POOL_CNT--;\n GeomPoly.POOL_ADD++;\n #end\n }\n };\n if(vertices!=null){\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash10 untyped __is__(vertices,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n #end\n }\n else if(#if flash untyped __is__(vertices,Vec2List)#else Std.is(vertices,Vec2List)#end){\n var lv:Vec2List=vertices;\n for(v in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(v==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash untyped __is__(vertices,GeomPoly)#else Std.is(vertices,GeomPoly)#end){\n var lv:GeomPoly=vertices;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var v=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n v.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n ret.skipForward(1);\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n var i=0;\n while(i=vertices;\n if(!lv.fixed){\n var i:Int=0;\n while(i
\n * Once disposed this GeomPoly will be accessible to Nape internals for re-allocation\n * and should not be touched (Good practice would be to set any references to this\n * GeomPoly to null to help ensure this).\n *

\n * In debug mode, should you attempt to access this GeomPoly after disposal\n * and the GeomPoly is still in the object pool, you will be given an Error.\n * The object pool operates on a First-In-Last-Out principal in debug mode to help\n * catch these sort of errors.\n * @throws # If this GeomPoly has already been disposed.\n */\n public function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n clear();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"GeomPoly\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextGeomPoly!=null)ZPP_PubPool.nextGeomPoly.zpp_pool=o;\n else ZPP_PubPool.poolGeomPoly=o;\n ZPP_PubPool.nextGeomPoly=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolGeomPoly;\n ZPP_PubPool.poolGeomPoly=o;\n #end\n #if NAPE_POOL_STATS GeomPoly.POOL_CNT++;\n GeomPoly.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n var ret=\"GeomPoly[\";\n {\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n if(v!=zpp_inner.vertices)ret+=\",\";\n ret+=\"{\"+v.x+\",\"+v.y+\"}\";\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n }\n return ret+\"]\";\n }\n /**\n * Compute area of weakly-simple polygon.\n *

\n * For complex polygons, this function will return an underestimate\n * to the true area.\n *\n * @return The area of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function area():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))0.0 else({\n var ret=({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var area=0.0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n area+=v.x*(v.next.y-v.prev.y);\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n area*0.5;\n });\n if(ret<0)(-ret)else ret;\n });\n }\n /**\n * Compute the winding order for this polygon.\n *

\n * The winding order can be conceptualised by thinking of an analog\n * clock face, if your polygon is the numbers on the clock then a\n * clockwise winding would have your polygon's vertices in numerical\n * order.\n *

\n * In the case of a non-simple polygon with self intersections then the\n * winding order is decided by how 'much' of the polygon is locally\n * clockwise wound, and how much is locally anti-clockwise wound.\n *
\n * (Think of a figure 8 style polygon where one loop is larger than the\n * other. This larger loop will dictate the winding of the polygon.)\n *

\n * If no winding can be computed, then Winding.UNDEFINED\n * will be returned.\n *\n * @return The winding of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function winding():Winding{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n return Winding.UNDEFINED;\n }\n else{\n var area=({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var area=0.0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n area+=v.x*(v.next.y-v.prev.y);\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n area*0.5;\n });\n return if(area>0)Winding.CLOCKWISE else if(area==0)Winding.UNDEFINED else Winding.ANTICLOCKWISE;\n }\n }\n /**\n * Determine if point is contained in polygon.\n *

\n * Polygon containment is performed with a ray cast through polygon\n * from the vertex and counting the number of intersections. In this\n * way containment will be defined for self-intersecting polygons based\n * on how such a polygon would be rendered with areas of self-intersection\n * treat as being 'outside' the polygon.\n *

\n * This algorithm operates in O(n) time.\n *\n * @param point The point to test for containment.\n * @return True if point is contained in the polygon.\n * @throws # If point is null or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function contains(point:Vec2):Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: GeomPoly::contains point cannot be null\";\n }\n #end\n var ret=({\n var x=point.x;\n var y=point.y;\n var ret=false;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var p=nite;\n {\n {\n var q=p.prev;\n if((p.y=y||q.y=y)&&(p.x<=x||q.x<=x)){\n if((p.x+(y-p.y)/(q.y-p.y)*(q.x-p.x))
\n * This is equivalent to poly.winding() == Winding.CLOCKWISE.\n *\n * @return True if polygon is clockwise wound.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isClockwise():Bool{\n return winding()==Winding.CLOCKWISE;\n }\n /**\n * Determine if weakly-simple polygon is convex.\n *

\n * This algorithm assumes that the polygon is weakly-simple. Otherwise it may\n * fail (It is very easy to construct a self intersecting polygon which\n * will return True for isConvex()).\n *

\n * You may wish to instead use isSimple() && isConvex() if\n * you cannot be sure of the polygon being simple, noting that this will\n * of course return false in the case of a weakly-simple polygon.\n *
\n     *  _____\n     * |     |\n     * |     |  <-- convex\n     * |____/\n     *  __\n     * |  \___\n     * |     /  <-- concave\n     * |____/\n     * 
\n * This algorithm operates in O(n) time.\n *\n * @return True if polygon is found to be convex.\n * @throws # If this GeomPoly has been disposed.\n */\n public function isConvex():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var neg=false;\n var pos=false;\n var ret=true;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n var u=v.prev;\n var w=v.next;\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>0.0){\n pos=true;\n }\n else if(dot<0.0){\n neg=true;\n }\n if(pos&&neg){\n ret=false;\n break;\n }\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n });\n }\n /**\n * Determine if polygon is strictly simple.\n *

\n * By strict simplicity, we refer to not permitting 'glancing'\n * self intersections (where boundary of polygon 'touches' but does not\n * pass through another area of the polygon's boundary). This property\n * is instead referred to as being 'weakly simple' for which there is no\n * easy test!\n *
\n     *  _______\n     * |   __  |  <-- strictly simple polygon.\n     * |   \ \_|\n     *  \__/\n     *  _______\n     * |   |   |\n     * |  /_\  | <-- weakly simple polygon.\n     *  \_____/\n     *  ____\n     * | __/\n     *  X_  __   <-- complex polygon.\n     * |  \/  \\n     * \__/\__|\n     * 
\n * This algorithm operates in O(n.log(n)) time.\n *\n * @return True if polygon is strictly simple.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isSimple():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else ZPP_Simple.isSimple(zpp_inner.vertices);\n }\n /**\n * Determine if polygon is y-monotone.\n *

\n * To be classed as y-monotone, the polygon must be such that any horizontal\n * line intersects the polygon in at most 2 intersections.\n *
\n     *  ___\n     * |   |\n     * |   |  <-- y-monotone\n     * |___|\n     *\n     * |\\n     * | \/|  <-- not y-monotone, offending vertex at bottom of the V.\n     * |___|\n     * 
\n * This algorithm operates in O(n) time.\n *\n * @return True if polygon is y-monotone.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isMonotone():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else ZPP_Monotone.isMonotone(zpp_inner.vertices);\n }\n /**\n * Determine if weakly-simple polygon is degenerate.\n *

\n * Degeneracy is determined by having a zero area, if polygon is complex,\n * then this function may report degeneracy erroneously.\n *\n * @return True if polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isDegenerate():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else area()
\n * Simplification is performed with an implementation of the Ramer-Douglas-Peucker\n * algorithm. The output polygon is formed via subset of the vertices in\n * the input polygon such that any discarded vertex is at most 'epsilon' pixels\n * away from the local output polygon.\n *

\n * This algorithm works on both simple and complex polygons, but please note\n * that this algorithm makes no guarantees on a simple polygon remaining simple\n * after simplification. This should not generally be a problem unless the epsilon\n * value is large with respect to the size of the features on the polygon.\n *

\n * Many of the geometric algorithms will mark vertices as important, such that\n * they will be guaranteed to exist after simplification (Such as preventing\n * gaps from opening up in marching squares when simplifying output polygons).\n *

\n * The average runtime of this algorithm is O(n.log(n)). This algorithm is\n * not stable in the sense that adding a new vertex to the polygon may drastically\n * change the result of simplifying the polygon.\n *\n * @param epsilon The distance from polygon at which vertices are ignored.\n * @return A new GeomPoly representing the result of the simplification.\n * @throws # If epsilon is <= 0.\n * @throws # If this GeomPoly has been disposed.\n */\n public function simplify(epsilon:Float):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(epsilon<=0.0){\n throw \"Error: Epsilon should be > 0 for simplifying a GeomPoly\";\n }\n #end\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n return copy();\n }\n else{\n var x=ZPP_Simplify.simplify(zpp_inner.vertices,epsilon);\n var ret=GeomPoly.get();\n ret.zpp_inner.vertices=x;\n return ret;\n }\n }\n /**\n * Produce a decomposition of complex polygon into simple components.\n *

\n * WARNING: This method is 'not' 100% robust. It may fail!\n *

\n * Produce a decomposition of a self intersecting, complex polygon into\n * a set of weakly-simple components.\n *

\n * This algorithm operates in O(n.log(n)) time and is based on the\n * Bentley-Ottmann algorithm.\n *\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's representing the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # Any other error may be thrown if algorithm has failed, even\n * in release builds!\n * @throws # If this GeomPoly has been disposed.\n */\n public function simpleDecomposition(output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var MPs=ZPP_Simple.decompose(zpp_inner.vertices,ZPP_PartitionedPoly.getShared());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MP;\n ret.add(x);\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into monotone components.\n *

\n * This algorithm 'should' be 100% robust and has been well tested on for\n * example, the output of the Marching Squares utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time and may strip vertices from\n * the polygon in degenerate cases where vertex is not needed to define the\n * polygon.\n *

\n * This algorithm is an improved version of the one presented in: Mark de\n * Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf.\n * Computational Geometry: Algorithms and Applications. Springer-Verlag,\n * Berlin, 1997.\n \n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function monotoneDecomposition(output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract(ZPP_PartitionedPoly.getShared());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MP;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.isMonotone();\n };\n if(!res)throw \"assert(\"+\"x.isMonotone()\"+\") :: \"+(\"monotone decomposition gave non-monotone output?\");\n #end\n };\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into convex components.\n *

\n * This algorithm 'should' be 100% robust and has been well test on for\n * example, the output of the Marching Squars utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time and will produce no more than\n * 4 times the number of convex poylgons in a minimal decomposition in the\n * worst case scenario.\n *

\n * Vertices may be stripped from the polygon that are found to not be\n * necessary as part of making this algorithm robust.\n *\n * @param delaunay This algorithm first performs a triangulation, if this field\n * is true, then this triangulation will be made delaunay and may\n * produce better convex polygons resultanly (default false).\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function convexDecomposition(delaunay:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract_partitions(ZPP_PartitionedPoly.getSharedPP());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n ZPP_Triangular.triangulate(MP);\n if(delaunay){\n ZPP_Triangular.optimise(MP);\n }\n ZPP_Convex.optimise(MP);\n var MQs=MP.extract(ZPP_PartitionedPoly.getShared());\n {\n var o=MP;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_PartitionedPoly\"+\", in obj: \"+\"MP\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_PartitionedPoly.zpp_pool;\n ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_PartitionedPoly.POOL_CNT++;\n ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n while(!MQs.empty()){\n var MQ=MQs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MQ;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.isConvex();\n };\n if(!res)throw \"assert(\"+\"x.isConvex()\"+\") :: \"+(\"convex decomposition gave non-convex output?\");\n #end\n };\n }\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into triangles.\n *

\n * This algorithm 'should' be 100% robust and has been well test on for\n * example, the output of the Marching Squars utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time.\n *

\n * Vertices may be stripped from the polygon that are found to not be\n * necessary as part of making this algorithm robust.\n *\n * @param delaunay If true, then an O(n^2) pass will be made to mutate the original\n * triangulation to push it into a delanuay triangulation. (default false)\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function triangularDecomposition(delaunay:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract_partitions(ZPP_PartitionedPoly.getSharedPP());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n ZPP_Triangular.triangulate(MP);\n if(delaunay){\n ZPP_Triangular.optimise(MP);\n }\n var MQs=MP.extract(ZPP_PartitionedPoly.getShared());\n {\n var o=MP;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_PartitionedPoly\"+\", in obj: \"+\"MP\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_PartitionedPoly.zpp_pool;\n ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_PartitionedPoly.POOL_CNT++;\n ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n while(!MQs.empty()){\n var MQ=MQs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MQ;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.size()==3;\n };\n if(!res)throw \"assert(\"+\"x.size()==3\"+\") :: \"+(\"triangular decomosition gave non-triangle output?\");\n #end\n };\n }\n }\n return ret;\n }\n /**\n * Inflate/Deflate polygon.\n *

\n * This algorithm does not attempt to deal with any self-intersections which may\n * result from the process. Gaps are joined with a miter joint.\n *

\n * This algorithm will work for self-intersecting polygons, though the results\n * may not be what you expect; some parts will be inflated, and some deflated\n * depending on the local winding. You should probably avoid using this on\n * self-intersecting polygons.\n *\n * @param inflation The number of pixels to inflate polygon by. To deflate\n * use a negative value.\n * @return The inflated polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function inflate(inflation:Float):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=GeomPoly.get();\n if(isClockwise())inflation=-inflation;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var p=nite;\n {\n {\n var prev=p.prev;\n var next=p.next;\n var ax:Float=0.0;\n var ay:Float=0.0;\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n ax=p.x-prev.x;\n ay=p.y-prev.y;\n };\n {\n bx=next.x-p.x;\n by=next.y-p.y;\n };\n var apx:Float=0.0;\n var apy:Float=0.0;\n var bpx:Float=0.0;\n var bpy:Float=0.0;\n {\n apx=ax;\n apy=ay;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((apx!=apx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(apx)\"+\") :: \"+(\"vec_set(in n: \"+\"ap\"+\",in x: \"+\"ax\"+\",in y: \"+\"ay\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((apy!=apy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(apy)\"+\") :: \"+(\"vec_set(in n: \"+\"ap\"+\",in x: \"+\"ax\"+\",in y: \"+\"ay\"+\")\");\n #end\n };\n };\n {\n {\n var d=(apx*apx+apy*apy);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"ap\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"ap\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n apx*=t;\n apy*=t;\n };\n };\n {\n var t=apx;\n apx=-apy;\n apy=t;\n };\n };\n {\n var t=(inflation);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"ap\"+\",in s: \"+\"inflation\"+\")\");\n #end\n };\n apx*=t;\n apy*=t;\n };\n {\n bpx=bx;\n bpy=by;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((bpx!=bpx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(bpx)\"+\") :: \"+(\"vec_set(in n: \"+\"bp\"+\",in x: \"+\"bx\"+\",in y: \"+\"by\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((bpy!=bpy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(bpy)\"+\") :: \"+(\"vec_set(in n: \"+\"bp\"+\",in x: \"+\"bx\"+\",in y: \"+\"by\"+\")\");\n #end\n };\n };\n {\n {\n var d=(bpx*bpx+bpy*bpy);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"bp\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"bp\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n bpx*=t;\n bpy*=t;\n };\n };\n {\n var t=bpx;\n bpx=-bpy;\n bpy=t;\n };\n };\n {\n var t=(inflation);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"bp\"+\",in s: \"+\"inflation\"+\")\");\n #end\n };\n bpx*=t;\n bpy*=t;\n };\n var bapx:Float=0.0;\n var bapy:Float=0.0;\n {\n bapx=bpx-apx;\n bapy=bpy-apy;\n };\n var num=(by*bapx-bx*bapy);\n var t=if(num==0)0 else(num/(by*ax-bx*ay));\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=p.x+apx;\n py=p.y+apy;\n };\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p\"+\",in b: \"+\"a\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n px+=ax*t;\n py+=ay*t;\n };\n ret.push(Vec2.get(px,py));\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return ret.skipForward(1);\n }\n /**\n * Cut simple polygon with line.\n *

\n * The result of this operation will be a list of new GeomPoly representing\n * the connected regions of the polygon after an imaginary cut is made.\n *
\n     * (Result of cut assuming\n     *  boundedStart = true)       _\n     *   /\    _             /\   / \\n     *  /  \  / \           /  \ '---'\n     * / o--\/---\-->  =>  /    \,---,\n     * \_________/         \_________/\n     * 
\n * This algorithm runs in average case O(n.log(n)) time and worst case O(n^2).\n * For convex polygons, this algorithm runs in guaranteed O(n) time.\n *\n * @param start The start point for line segment\n * @param end The end point for line segment.\n * @param boundedStart If true, then the cut will not extend\n * beyond the start of the line segment.\n * (default false)\n * @param boundedEnd If true, then the cut will not extend\n * beyond the end of the line segment.\n * (default false)\n * @param output A GeomPolyList to append results to if supplied,\n * otherwise a new list is created (default null)\n * @return A list of GeomPoly representing the result of the cut.\n * @throws # If polygon is not simple.\n * @throws # If start or end Vec2 are null or disposed of.\n * @throws # If this GeomPoly has been disposed.\n */\n public function cut(start:Vec2,end:Vec2,boundedStart:Bool=false,boundedEnd:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(!isSimple()){\n throw \"Error: Cut requires a truly simple polygon\";\n }\n if(start==null||end==null){\n throw \"Error: Cannot cut with null start/end's\";\n }\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(start!=null&&start.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(end!=null&&end.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=ZPP_Cutter.run(zpp_inner.vertices,start,end,boundedStart,boundedEnd,output);\n ({\n if(({\n start.zpp_inner.weak;\n })){\n start.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n end.zpp_inner.weak;\n })){\n end.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Transform polygon by given matrix.\n *

\n * Any transformation (not just equiorthogonal ones) are permitted, though\n * a transformation that causes polygon to be come degenerate is a bit\n * pointless.\n *\n * @param matrix The matrix to transform polygon by.\n * @return A reference to this polygon.\n * @throws # If matrix is null.\n * @throws # If this GeomPoly has been disposed.\n */\n public function transform(matrix:Mat23):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(matrix==null){\n throw \"Error: Cannot transform by null matrix\";\n }\n #end\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n {\n var t=matrix.a*v.x+matrix.b*v.y+matrix.tx;\n v.y=matrix.c*v.x+matrix.d*v.y+matrix.ty;\n v.x=t;\n };\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return this;\n }\n /**\n * Determine bounds of polygon.\n *\n * @return A new AABB representing bounds of polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function bounds():AABB{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable bounds\";\n }\n #end\n var minx:Float=ZPP_Const.FMAX;\n var miny:Float=ZPP_Const.FMAX;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minx!=minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minx)\"+\") :: \"+(\"vec_new(in n: \"+\"min\"+\",in x: \"+\"ZPP_Const.FMAX\"+\",in y: \"+\"ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((miny!=miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(miny)\"+\") :: \"+(\"vec_new(in n: \"+\"min\"+\",in x: \"+\"ZPP_Const.FMAX\"+\",in y: \"+\"ZPP_Const.FMAX\"+\")\");\n #end\n };\n var maxx:Float=-ZPP_Const.FMAX;\n var maxy:Float=-ZPP_Const.FMAX;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxx!=maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxx)\"+\") :: \"+(\"vec_new(in n: \"+\"max\"+\",in x: \"+\"-ZPP_Const.FMAX\"+\",in y: \"+\"-ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxy!=maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxy)\"+\") :: \"+(\"vec_new(in n: \"+\"max\"+\",in x: \"+\"-ZPP_Const.FMAX\"+\",in y: \"+\"-ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n if(v.xmaxx)maxx=v.x;\n if(v.y>maxy)maxy=v.y;\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return new AABB(minx,miny,maxx-minx,maxy-miny);\n }\n /**\n * Find top most vertex of polygon.\n *

\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the top most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function top():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable topmost vertex\";\n }\n #end\n var min=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.y
\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the bottom most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function bottom():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable bottommost vertex\";\n }\n #end\n var max=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.y>max.y)max=v;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return max.wrapper();\n }\n /**\n * Find left most vertex of polygon.\n *

\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the left most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function left():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable leftmost vertex\";\n }\n #end\n var min=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.x
\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the right most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function right():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable rightmmost vertex\";\n }\n #end\n var max=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.x>max.x)max=v;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return max.wrapper();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass GeomPolyIterator{\n /**\n * @private\n */\n public var zpp_inner:GeomPolyList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:GeomPolyIterator=null;\n /**\n * @private\n */\n public var zpp_next:GeomPolyIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_GeomPolyList.internal)throw \"Error: Cannot instantiate \"+\"GeomPoly\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:GeomPolyList){\n var ret=if(zpp_pool==null){\n ZPP_GeomPolyList.internal=true;\n var ret=new GeomPolyIterator();\n ZPP_GeomPolyList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:GeomPoly = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:GeomPoly = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:GeomPoly = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass GeomPolyList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_GeomPolyList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than GeomPoly\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new GeomPolyList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,GeomPoly)#else Std.is(i,GeomPoly)#end)throw \"Error: Array contains non \"+\"GeomPoly\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new GeomPolyList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:GeomPoly):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):GeomPoly{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():GeomPoly{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():GeomPoly{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:GeomPoly):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return GeomPolyIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new GeomPolyList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"GeomPoly\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:GeomPolyList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_GeomPolyList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:GeomPoly->Void):GeomPolyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=GeomPolyIterator.zpp_pool;\n GeomPolyIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:GeomPoly->Bool):GeomPolyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i\n * [ a b tx ]\n * [ c d ty ]\n * [ 0 0 1 ]\n * \n *\n * Note that in AS3, flash.geom.Matrix has 'b' and 'c' swapped! so if you are\n * converting between flash.geom.Matrix and nape.geom.Mat23 you should use the\n * methods provided to avoid any mistakes with this.\n *\n */\n@:final#if nape_swc@:keep #end\nclass Mat23{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Mat23=null;\n /**\n * The (1,1) entry in Mat23:\n *

\n *
\n     * [ a  .  . ]\n     * [ .  .  . ]\n     * 
\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var a(get_a,set_a):Float;\n inline function get_a():Float{\n return zpp_inner.a;\n }\n inline function set_a(a:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((a!=a)){\n throw \"Error: Mat23::\"+\"a\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.a=a;\n zpp_inner.invalidate();\n }\n return get_a();\n }\n /**\n * The (1,2) entry in Mat23:\n *

\n *
\n     * [ .  b  . ]\n     * [ .  .  . ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var b(get_b,set_b):Float;\n inline function get_b():Float{\n return zpp_inner.b;\n }\n inline function set_b(b:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((b!=b)){\n throw \"Error: Mat23::\"+\"b\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.b=b;\n zpp_inner.invalidate();\n }\n return get_b();\n }\n /**\n * The (2,1) entry in Mat23:\n *

\n *
\n     * [ .  .  . ]\n     * [ c  .  . ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var c(get_c,set_c):Float;\n inline function get_c():Float{\n return zpp_inner.c;\n }\n inline function set_c(c:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((c!=c)){\n throw \"Error: Mat23::\"+\"c\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.c=c;\n zpp_inner.invalidate();\n }\n return get_c();\n }\n /**\n * The (2,2) entry in Mat23:\n *

\n *
\n     * [ .  .  . ]\n     * [ .  d  . ]\n     * 
\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var d(get_d,set_d):Float;\n inline function get_d():Float{\n return zpp_inner.d;\n }\n inline function set_d(d:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d)){\n throw \"Error: Mat23::\"+\"d\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.d=d;\n zpp_inner.invalidate();\n }\n return get_d();\n }\n /**\n * The (1,3) entry in Mat23 which represents x translation\n *

\n *
\n     * [ .  .  tx ]\n     * [ .  .  .  ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var tx(get_tx,set_tx):Float;\n inline function get_tx():Float{\n return zpp_inner.tx;\n }\n inline function set_tx(tx:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((tx!=tx)){\n throw \"Error: Mat23::\"+\"tx\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.tx=tx;\n zpp_inner.invalidate();\n }\n return get_tx();\n }\n /**\n * The (2,3) entry in Mat23 which represents y translation\n *

\n *
\n     * [ .  .  .  ]\n     * [ .  .  ty ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var ty(get_ty,set_ty):Float;\n inline function get_ty():Float{\n return zpp_inner.ty;\n }\n inline function set_ty(ty:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((ty!=ty)){\n throw \"Error: Mat23::\"+\"ty\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.ty=ty;\n zpp_inner.invalidate();\n }\n return get_ty();\n }\n /**\n * Construct new Mat23.\n *

\n *
\n     * [ a  b  tx ]\n     * [ c  d  ty ]\n     * 
\n *\n * @param a The (1,1) entry in matrix (default 1)\n * @param b The (1,2) entry in matrix (default 0)\n * @param c The (2,1) entry in matrix (default 0)\n * @param d The (2,2) entry in matrix (default 1)\n * @param tx The (1,3) entry in matrix (default 0)\n * @param ty The (2,3) entry in matrix (default 0)\n * @return The newly constructed Mat23.\n */\n public function new(a:Float=1.0,b:Float=0.0,c:Float=0.0,d:Float=1.0,tx:Float=0.0,ty:Float=0.0){\n zpp_inner=ZPP_Mat23.get();\n zpp_inner.outer=this;\n this.a=a;\n this.b=b;\n this.tx=tx;\n this.c=c;\n this.d=d;\n this.ty=ty;\n }\n /**\n * Produce copy of this Mat23\n *\n * @return The new Mat23 representing copy of this.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return new Mat23(a,b,c,d,tx,ty);\n }\n /**\n * Set values of matrix from another.\n *\n * @param matrix The matrix to copy values from.\n * @return A reference to this Mat23.\n * @throws # if matrix argument is null.\n */\n public function set(matrix:Mat23):Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if(matrix==null){\n throw \"Error: Cannot set form null matrix\";\n }\n #end\n zpp_inner.set(matrix.zpp_inner);\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Set values of matrix from numbers.\n *

\n * So that: mat.setAs(...) is\n * semantically equivalent to: mat.set(new Mat23(...))\n *

\n * @param a The value to which the (1,1) entry will be set (default 1)\n * @param b The value to which the (1,2) entry will be set (default 0)\n * @param c The value to which the (2,1) entry will be set (default 0)\n * @param d The value to which the (2,2) entry will be set (default 1)\n * @param tx The value to which the (1,3) entry will be set (default 0)\n * @param ty The value to which the (2,3) entry will be set (default 0)\n * @return A reference to this Mat23.\n */\n public function setAs(a:Float=1.0,b:Float=0.0,c:Float=0.0,d:Float=1.0,tx:Float=0.0,ty:Float=0.0):Mat23{\n zpp_inner.setas(a,b,c,d,tx,ty);\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Reset matrix to identity.\n *

\n * Equivalent to calling setAs with default argument values.\n *

\n * @return A reference to this Mat23.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function reset():Mat23{\n return setAs();\n }\n #if(flash9||openfl||nme)/**\n * Create a Mat23 matrix from a given AS3 flash.geom.Matrix.\n *

\n * This method should be used in preference to doing so manually\n * as the allocation of matrix entries to name is different and\n * it is easy to make this mistake!\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param matrix The AS3 Matrix to create Mat23 from. This value must\n * not be null.\n * @return The constructed Mat23 matching AS3 Matrix.\n */\n #if nape_swc@:keep #end\n public static function fromMatrix(matrix:flash.geom.Matrix):Mat23{\n var m=matrix;\n return new Mat23(m.a,m.c,m.b,m.d,m.tx,m.ty);\n }\n /**\n * Create an AS3 flash.geom.Matrix from this Mat23.\n *

\n * This method should be used in preference to doing so manually\n * as the allocation of matrix entries to name is different and\n * it is easy to make this mistake!\n *\n * @param output If supplied, this Matrix will have its properties\n * populated insteaad of creating a new Matrix.\n * @preturn The constructed AS3 Matrix.\n */\n #if nape_swc@:keep #end\n public function toMatrix(output:flash.geom.Matrix=null):flash.geom.Matrix{\n if(output==null)output=new flash.geom.Matrix();\n output.a=a;\n output.b=c;\n output.c=b;\n output.d=d;\n output.tx=tx;\n output.ty=ty;\n return output;\n }\n #end\n /**\n * Construct a Mat23 representing a clockwise rotation.\n *\n *
\n     * [ cos angle  -sin angle  0 ]\n     * [ sin angle   cos angle  0 ]\n     * 
\n *\n * @param angle The clockwise rotation in radians\n * @return The rotation matrix.\n */\n #if nape_swc@:keep #end\n public static function rotation(angle:Float):Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Cannot create rotation matrix with NaN angle\";\n }\n #end\n var cos=Math.cos(angle);\n var sin=Math.sin(angle);\n return new Mat23(cos,-sin,sin,cos,0,0);\n }\n /**\n * Construct a Mat23 representing a translation\n *\n *
\n     * [ 1  0  tx ]\n     * [ 0  1  ty ]\n     * 
\n *\n * @param tx The x translation.\n * @param ty The y translation.\n * @return The translation matrix.\n */\n #if nape_swc@:keep #end\n public static function translation(tx:Float,ty:Float):Mat23{\n return new Mat23(1,0,0,1,tx,ty);\n }\n /**\n * Construct a Mat23 representing a scaling\n *\n *
\n     * [ sx  0  0 ]\n     * [ 0  sy  0 ]\n     * 
\n *\n * @param sx The x factor of scaling.\n * @param sy The y factor of scaling.\n * @return The scaling matrix.\n */\n #if nape_swc@:keep #end\n public static function scale(sx:Float,sy:Float):Mat23{\n return new Mat23(sx,0,0,sy,0,0);\n }\n /**\n * (readonly) The determinant of this matrix.\n *

\n * This represents the factor of change in area\n * for a region of the plane after transformation by matrix.\n *

\n * A determinant of 0 signifies that the matrix is not invertible.\n *

\n * A negative determinant signifies that for example, a clockwise wound\n * polygon would be transformed into a counter-clockwise polygon.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var determinant(get_determinant,never):Float;\n inline function get_determinant():Float{\n return(a*d)-(b*c);\n }\n /**\n * Determine if the matrix is singular.\n * This check is based on computing the condition number of the matrix\n * by the Frobenius norm, and comparing against 2 / epsilon.\n *

\n * If matrix is singular, then inversion of the matrix cannot be performed\n *\n * @return True, if matrix is singular.\n */\n #if nape_swc@:keep #end\n public function singular():Bool{\n var norm=(a*a)+(b*b)+(c*c)+(d*d);\n var limit=determinant;\n if(limit<0)limit=-limit;\n return(norm>(Config.illConditionedThreshold*limit));\n }\n /**\n * Compute the inverse of this matrix, returning the inverse in a new\n * Mat23 object.\n *

\n * The inverse is such that mat.concat(mat.inverse()) is the identity\n * matrix, as well as mat.inverse().concat(mat)\n *\n * @return The inverse matrix.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function inverse():Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if(singular()){\n throw \"Error: Matrix is singular and cannot be inverted\";\n }\n #end\n var idet=1.0/determinant;\n return new Mat23((d*idet),(-b*idet),(-c*idet),(a*idet),((b*ty)-(d*tx))*idet,((c*tx)-(a*ty))*idet);\n }\n /**\n * Compute the transpose of this matrix, returning the transpose in a new\n * Mat23 object.\n *

\n * Technically speaking, we cannot transpose a matrix if the tx/ty values\n * are non-zero as the implicit bottom row of matrix must be (0, 0, 1)\n * so the tx/ty values of output matrix are set so that should the main\n * 2x2 block of the matrix be orthogonal (Representing a rotation), then\n * the transpose will be able to act as the matrix inverse.\n *
\n     * var mat = Mat23.rotation(..).concat(Mat23.translation(...));\n     * trace(mat.concat(mat.transpose())); // Identity matrix\n     * trace(mat.concat(mat.inverse())); // Identity matrix\n     * 
\n * If the main 2x2 block of matrix is 'not' orthogonal, then the transpose\n * will not be equal to the inverse.\n *\n * @return The transposed matrix.\n */\n #if nape_swc@:keep #end\n public function transpose():Mat23{\n return new Mat23(a,c,b,d,-a*tx-c*ty,-b*tx-d*ty);\n }\n /**\n * Concatenate matrices (left-multiplication), returning new Mat23.\n *

\n * mat1.concat(mat2) is the transformation that first\n * performs transformation represented by mat1, followed by transformation\n * represented by mat2.\n *
\n *\n * @param matrix Matrix to concatenate with.\n * @return The result of the concatenation.\n * @throws # If matrix argument is null.\n */\n #if nape_swc@:keep #end\n public function concat(matrix:Mat23):Mat23{\n var m=matrix;\n #if(!NAPE_RELEASE_BUILD)\n if(m==null){\n throw \"Error: Cannot concatenate with null Mat23\";\n }\n #end\n return new Mat23(((m.a*a)+(m.b*c)),((m.a*b)+(m.b*d)),((m.c*a)+(m.d*c)),((m.c*b)+(m.d*d)),(m.a*tx)+(m.b*ty)+m.tx,(m.c*tx)+(m.d*ty)+m.ty);\n }\n /**\n * Transform a Vec2 by this matrix in new Vec2.\n *

\n * The Vec2 object will be allocated form the global object pool.\n *\n * @param point The Vec2 to transform by this matrix.\n * @param noTranslation If true, then the input Vec2 will be treat as a\n * vector, rather than a point with the tx/ty values\n * treat as 0. (default false)\n * @param weak If true, then the allocated Vec2 will be\n * automatically released to global object pool when\n * used as an argument to a Nape function.\n * @return The result of the transformation as a newly\n * allocated (possibly weak) Vec2. (default false)\n * @throws # If point argument is null.\n */\n #if nape_swc@:keep #end\n public function transform(point:Vec2,noTranslation:Bool=false,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot transform null Vec2\";\n }\n #end\n var ret:Vec2;\n if(noTranslation){\n ret=Vec2.get((point.x*a)+(point.y*b),(point.x*c)+(point.y*d),weak);\n }\n else{\n ret=Vec2.get((point.x*a)+(point.y*b)+tx,(point.x*c)+(point.y*d)+ty,weak);\n }\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Perform inverse transformation with Vec2, returning new Vec2.\n *

\n * The matrix inverse will be performed implicitly and should this\n * method be called many times for the same Mat23, it would be better\n * to instead compute the matrix inverse only once.\n *

\n * The new Vec2 will be allocated from the global object pool.\n *\n * @param point The Vec2 to transform.\n * @param noTranslation If true then the input Vec2 will be treat as a\n * vector instead of a point, treating the tx/ty\n * values of this Mat23 as though they were 0.\n * (default false)\n * @param weak If true, then the allocated Vec2 will be\n * automatically released to global object pool when\n * used as an argument to a Nape function.\n * @return The result of the transformation as a newly\n * allocated (possibly weak) Vec2. (default false)\n * @throws # If matrix is singular.\n * @throws # If point argument is null.\n */\n #if nape_swc@:keep #end\n public function inverseTransform(point:Vec2,noTranslation:Bool=false,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot transform null Vec2\";\n }\n if(singular()){\n throw \"Error: Matrix is singular and inverse transformation cannot be performed\";\n }\n #end\n var idet=1.0/determinant;\n var ret:Vec2;\n if(noTranslation){\n ret=Vec2.get(((point.x*d)-(point.y*b))*idet,((point.y*a)-(point.x*c))*idet,weak);\n }\n else{\n var dx=point.x-tx;\n var dy=point.y-ty;\n ret=Vec2.get(((dx*d)-(dy*b))*idet,((dy*a)-(dx*c))*idet,weak);\n }\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"{ a: \"+a+\" b: \"+b+\" c: \"+c+\" d: \"+d+\" tx: \"+tx+\" ty: \"+ty+\" }\";\n }\n /**\n * Determine if matrix is equiorthogonal\n *

\n * This is a term I invented after\n * failing to find an existing name. It describes that this matrix maps\n * circles into other circles (of not necessarigly the same radius). In\n * otherwords the matrix can be decomposed into a rotation, translation\n * and scaling of equal x/y factors.\n *

\n * This property is required for any Mat23 that is used to transform a\n * Circle, or any Body containing a Circle, or to transform a Debug view.\n *

\n * This is a weaker property than orthogonality which describes a mapping\n * to a circle of equal radius.\n *

\n * Mathematically speaking a matrix is equiorthogonal iff.\n * transpose(M) * M = kI for some non-zero scalar k.\n *\n * @return True if matrix is equiorthogonal.\n */\n #if nape_swc@:keep #end\n public function equiorthogonal():Bool{\n if(singular()){\n return false;\n }\n else{\n var x=(a*b)+(c*d);\n if((x*x)
\n * This property describes a matrix\n * which maps circles into other circles of equal radius. In otherwords\n * the matrix can be decomposed into a rotation and a translation.\n *

\n * Mathematically speaking a matrix is orthogonal iff.\n * transpose(M) * M = I.\n *\n * @return True if matrix is orthogonal.\n */\n #if nape_swc@:keep #end\n public function orthogonal():Bool{\n var x=(a*b)+(c*d);\n if((x*x)
\n * We do this by finding the 'nearest' orthogonal matrix;\n * scaling the basis vectors of matrix to their mean length\n * and applying an equal and opposite rotation to each basis vector to\n * make them perpendicular.\n *\n * @return A reference to this Mat23.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function equiorthogonalise():Mat23{\n if(!equiorthogonal()){\n var k1=Math.sqrt((a*a)+(c*c));\n var k2=Math.sqrt((b*b)+(d*d));\n #if(!NAPE_RELEASE_BUILD)\n if((k1*k1)0){\n ang=-ang;\n }\n var sin=Math.sin(ang);\n var cos=Math.cos(ang);\n var a2=(a*cos)-(c*sin);\n var b2=(b*cos)+(d*sin);\n c=(c*cos)+(a*sin);\n a=a2;\n d=(d*cos)-(b*sin);\n b=b2;\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Orthogonalise matrix.\n *

\n * We do this by finding the 'nearest' orthogonal matrix;\n * normalising the basis vectors of matrix\n * and applying an equal and opposite rotation to each basis vector to\n * make them perpendicular.\n *\n * @return A reference to this Mat23.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function orthogonalise():Mat23{\n if(!orthogonal()){\n var k1=Math.sqrt((a*a)+(c*c));\n var k2=Math.sqrt((b*b)+(d*d));\n #if(!NAPE_RELEASE_BUILD)\n if((k1*k1)0){\n ang=-ang;\n }\n var sin=Math.sin(ang);\n var cos=Math.cos(ang);\n var a2=(a*cos)-(c*sin);\n var b2=(b*cos)+(d*sin);\n c=(c*cos)+(a*sin);\n a=a2;\n d=(d*cos)-(b*sin);\n b=b2;\n zpp_inner.invalidate();\n }\n return this;\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n /**\n * A general MxN dimensional matrix.\n *

\n * This object is not often used in Nape :)\n */\n@:final#if nape_swc@:keep #end\nclass MatMN{\n /**\n * @private\n */\n public var zpp_inner:ZPP_MatMN=null;\n /**\n * The number of rows in the matrix.\n */\n #if nape_swc@:isVar #end\n public var rows(get_rows,never):Int;\n inline function get_rows():Int{\n return zpp_inner.m;\n }\n /**\n * The number of columns in the matrix.\n */\n #if nape_swc@:isVar #end\n public var cols(get_cols,never):Int;\n inline function get_cols():Int{\n return zpp_inner.n;\n }\n /**\n * Access element at index.\n *\n * @param row The row of the matrix to access.\n * @param col the column of the matrix to access.\n * @return The element at given (row,col) index.\n * @throws # If access is out of range.\n */\n #if NAPE_NO_INLINE#else inline #end\n public function x(row:Int,col:Int):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(row<0||col<0||row>=rows||col>=cols){\n throw \"Error: MatMN indices out of range\";\n }\n #end\n return zpp_inner.x[(row*cols)+col];\n }\n /**\n * Set element at index.\n *\n * @param row The row of the matrix to set.\n * @param col The column of the matrix to set.\n * @param x The value to set at given (row,col) index.\n * @return The value of matrix at given index after set. (Always\n * equal to the x parameter)\n * @throws # If index is out of range.\n */\n #if NAPE_NO_INLINE#else inline #end\n public function setx(row:Int,col:Int,x:Float):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(row<0||col<0||row>=rows||col>=cols){\n throw \"Error: MatMN indices out of range\";\n }\n #end\n return zpp_inner.x[(row*cols)+col]=x;\n }\n /**\n * Construct a new Matrix.\n *\n * @param rows The number of rows in matrix.\n * @param cols The number of columns in matrix.\n * @return The constructed Matrix.\n * @throws # If rows or columns is negative or 0.\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(rows:Int,cols:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(rows<=0||cols<=0){\n throw \"Error: MatMN::dimensions cannot be < 1\";\n }\n #end\n zpp_inner=new ZPP_MatMN(rows,cols);\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"{ \";\n var fst=true;\n for(i in 0...rows){\n if(!fst)ret+=\"; \";\n fst=false;\n for(j in 0...cols)ret+=x(i,j)+\" \";\n }\n ret+=\"}\";\n return ret;\n }\n /**\n * Transpose matrix, returning a new Matrix.\n *\n * @return The transposed matrix.\n */\n public function transpose():MatMN{\n var ret=new MatMN(cols,rows);\n for(i in 0...rows){\n for(j in 0...cols)ret.setx(j,i,x(i,j));\n }\n return ret;\n }\n /**\n * Multiple this matrix with another.\n *

\n * This operation is only valid if the number of columns\n * in this matrix, is equal to the number of rows in the input\n * matrix.\n *
\n * The result of the multiplication is returned as a new matrix.\n *\n * @param matrix The matrix to multiple with.\n * @return The result of the multiplication\n * @throws If matrix dimensions are not compatible.\n */\n public function mul(matrix:MatMN):MatMN{\n var y=matrix;\n #if(!NAPE_RELEASE_BUILD)\n if(cols!=y.rows){\n throw \"Error: Matrix dimensions aren't compatible\";\n }\n #end\n var ret=new MatMN(rows,y.cols);\n for(i in 0...rows){\n for(j in 0...y.cols){\n var v=0.0;\n for(k in 0...cols)v+=x(i,k)*y.x(k,j);\n ret.setx(i,j,v);\n }\n }\n return ret;\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing the results of a ray cast operation.\n *

\n * These objects are allocated from an object pool and can\n * be released back to that pool by calling its dispose method.\n */\n@:final#if nape_swc@:keep #end\nclass RayResult{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexRayResult=null;\n /**\n * The normal of the surface at intersection.\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.normal;\n }\n /**\n * The distance to the intersection.\n */\n #if nape_swc@:isVar #end\n public var distance(get_distance,never):Float;\n inline function get_distance():Float{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.toiDistance;\n }\n /**\n * Whether this intersection is with the inner surface of an object.\n */\n #if nape_swc@:isVar #end\n public var inner(get_inner,never):Bool;\n inline function get_inner():Bool{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.inner;\n }\n /**\n * The shape which was intersected.\n */\n #if nape_swc@:isVar #end\n public var shape(get_shape,never):Shape;\n inline function get_shape():Shape{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.shape;\n }\n /**\n * @private\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexRayResult.internal)throw \"Error: RayResult cannot be instantiated derp!\";\n #end\n }\n /**\n * Release RayResult object to pool.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n zpp_inner.free();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return \"{ shape: \"+shape+\" distance: \"+distance+\" ?inner: \"+inner+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass RayResultIterator{\n /**\n * @private\n */\n public var zpp_inner:RayResultList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:RayResultIterator=null;\n /**\n * @private\n */\n public var zpp_next:RayResultIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_RayResultList.internal)throw \"Error: Cannot instantiate \"+\"RayResult\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:RayResultList){\n var ret=if(zpp_pool==null){\n ZPP_RayResultList.internal=true;\n var ret=new RayResultIterator();\n ZPP_RayResultList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:RayResult = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:RayResult = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:RayResult = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass RayResultList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_RayResultList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than RayResult\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new RayResultList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,RayResult)#else Std.is(i,RayResult)#end)throw \"Error: Array contains non \"+\"RayResult\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new RayResultList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:RayResult):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):RayResult{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n else zpp_inner.inner.add(obj);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():RayResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():RayResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:RayResult):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return RayResultIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new RayResultList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"RayResult\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:RayResultList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_RayResultList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:RayResult->Void):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=RayResultIterator.zpp_pool;\n RayResultIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:RayResult->Bool):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Note that in many cases of a Vec2 object being returned by a Nape function\n * the Vec2 object will be marked internally as an 'immutable' Vec2. This will\n * always be documented and trying to mutate such a Vec2 will result in an\n * error being thrown.\n *

\n * Vec2 objects can make use of a global object pool, attempting to make use\n * of a disposed Vec2 will also result in an error with the object pool\n * working in a FILO order to increase the likelihood of such misuse being\n * caught.\n *

\n * Additionally Vec2 objects can be created as 'weak'. Passing a weak Vec2 to\n * any Nape function as an argument will result in the automatic disposal of\n * the Vec2 once the method has finished with it. There may be exceptions to\n * this rule which will also be documented; a notable case being the appending\n * of a weak Vec2 to a Nape Vec2List in which case the disposal of the weak\n * Vec2 is performed when that Vec2List is handed to a Nape function instead.\n *

\n * Example:\n *
\n * var vertices = Polygon.box(20, 20, true);\n * var polygon = new Polygon(vertices);\n * 
\n * In this example, passing true to the Polygon.box method means\n * that we will be returned a Vec2List containing only 'weak' Vec2s. Upon\n * passing this Vec2List to the Polygon constructor, all of the Vec2s from\n * that list will be automatically disposed.\n */\n@:final#if nape_swc@:keep #end\nclass Vec2{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec2=null;\n /**\n * @private\n */\n public var zpp_pool:Vec2=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * Allocate a weak Vec2 from global object pool.\n *

\n * This object which will be automaticaly released back to the object pool\n * when supplied as an argument to a Nape function.\n *

\n * Note that Vec2.weak(x, y) is exactly equivalent to \n * Vec2.get(x, y, true).\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordiante for the vector. (default 0)\n * @return The allocated weak Vec2 with given x/y values.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function weak(x:Float=0,y:Float=0):Vec2{\n return get(x,y,true);\n }\n /**\n * Allocates a Vec2 from the global object pool.\n *

\n * Note that Vec2.get(x, y, true) is exactly equivalent to\n * Vec2.weak(x, y) and should be preferred.\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordinate for the vector. (default 0)\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to object pool when passed as an\n * argument to a Nape function. (default false)\n * @return The allocated, possibly weak Vec2 with given x/y values.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float=0,y:Float=0,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n var ret;\n {\n if(ZPP_PubPool.poolVec2==null){\n ret=new Vec2();\n #if NAPE_POOL_STATS Vec2.POOL_TOT++;\n Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolVec2;\n ZPP_PubPool.poolVec2=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextVec2)ZPP_PubPool.nextVec2=null;\n #end\n #if NAPE_POOL_STATS Vec2.POOL_CNT--;\n Vec2.POOL_ADD++;\n #end\n }\n };\n if(ret.zpp_inner==null){\n ret.zpp_inner=ZPP_Vec2.get(x,y);\n ret.zpp_inner.outer=ret;\n }\n else{\n ret.setxy(x,y);\n }\n ret.zpp_inner.weak=weak;\n return ret;\n }\n /**\n * Release this Vec2 to global object pool.\n *

\n * Once diposed this Vec2\n * will be accessible to Nape internals for re-allocation and should\n * not be touched (Good practice would be to set any references to this\n * Vec2 to null to help ensure this).\n *

\n * In debug mode, should you attempt to access this Vec2 after disposal\n * and the Vec2 is still in the object pool, you will be given an Error.\n * The object pool operates on a First-In-Last-Out principal in debug\n * mode to help catch these sort of errors.\n * @throws # If this vector has already been disposed.\n * @throws # If this vector is immutable.\n * @throws # If this vector is in use in some other manner, such as being\n * an element of a Polygon's vertex list.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._inuse){\n throw \"Error: This Vec2 is not disposable\";\n }\n #end\n var inner=zpp_inner;\n zpp_inner.outer=null;\n zpp_inner=null;\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"Vec2\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextVec2!=null)ZPP_PubPool.nextVec2.zpp_pool=o;\n else ZPP_PubPool.poolVec2=o;\n ZPP_PubPool.nextVec2=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolVec2;\n ZPP_PubPool.poolVec2=o;\n #end\n #if NAPE_POOL_STATS Vec2.POOL_CNT++;\n Vec2.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n {\n var o=inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n /**\n * Construct a new Vec2.\n *

\n * This constructor will obviously not make use of\n * the global object pool: Vec2.get should be used in\n * preference noting that new Vec2(x, y) is semantically\n * equivalent to Vec2.get(x, y).\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordinate for the vector. (default 0)\n * @return The newly constructed Vec2 object with given x/y values.\n */\n public function new(x:Float=0,y:Float=0){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n zpp_inner=ZPP_Vec2.get(x,y);\n zpp_inner.outer=this;\n }\n /**\n * Produce a copy of this Vec2.\n *

\n * The Vec2 will be allocated from the global object pool.\n *

\n * As would be expected, if you produce a copy of an 'immutable' Vec2, then\n * the copy will be 'mutable'.\n *\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to the object pool when passed as an\n * argument to any Nape function. (default false)\n * @return The possibly weak copy of this Vec2.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function copy(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(x,y,weak);\n }\n #if(flash9||openfl||nme)\n /**\n * Allocate a Vec2 from AS3 Point object.\n *

\n * This Vec2 will be allocated from the global object pool.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param point The AS3 Point to initialise Vec2 with\n * @param weak If true, then a weak Vec2 will be allocated which will\n * be automatically released to the object pool when\n * pass as an argument to any Nape function.\n * (default false)\n * @return The possibly weak Vec2 allocated with same values as\n * input Point object.\n * @throws # If the point argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromPoint(point:flash.geom.Point,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot create Vec2 from null Point object\";\n }\n if((point.x!=point.x)||(point.y!=point.y)){\n throw \"Error: Error: Vec2 components cannot be NaN\";\n }\n #end\n return Vec2.get(point.x,point.y,weak);\n }\n /**\n * Create an AS3 Point object from Vec2.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param output If supplied, this Point will have its x/y\n * set instead of creating a new Point.\n * @return The AS3 Point object representing Vec2.\n * @throws # If this vector has been disposed of.\n */\n #if nape_swc@:keep #end\n public function toPoint(output:flash.geom.Point=null):flash.geom.Point{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(output==null)output=new flash.geom.Point();\n output.x=x;\n output.y=y;\n return output;\n }\n #end\n /**\n * Allocate a Vec2 given polar coordinates.\n *

\n * This Vec2 will be allocated from the global object pool.\n *

\n * This method will assign x/y values equal respectively to:\n * length*Math.cos(angle),\n * length*Math.sin(angle)\n *\n * @param length The length of the Vec2. This value may be negative.\n * @param angle The angle of the Vec2 as measured in radians clockwise\n * from the positive x axis.\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to the object pool when passed as\n * an argument to any Nape function. (default false)\n * @return The possibly weak Vec2 allocated with given polar values.\n */\n #if nape_swc@:keep #end\n public static function fromPolar(length:Float,angle:Float,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec2::length cannot be NaN\";\n }\n if((angle!=angle)){\n throw \"Error: Vec2::angle cannot be NaN\";\n }\n #end\n return Vec2.get(length*Math.cos(angle),length*Math.sin(angle),weak);\n }\n /**\n * x coordinate of vector.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.x;\n }\n inline function set_x(x:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n if(this.x!=x){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)){\n throw \"Error: Vec2::\"+\"x\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.x=x;\n zpp_inner.invalidate();\n }\n }\n return get_x();\n }\n /**\n * y coordinate of vector.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.y;\n }\n inline function set_y(y:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n if(this.y!=y){\n #if(!NAPE_RELEASE_BUILD)\n if((y!=y)){\n throw \"Error: Vec2::\"+\"y\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.y=y;\n zpp_inner.invalidate();\n }\n }\n return get_y();\n }\n /**\n * Length of this Vec2.\n *

\n * This value can be set and may be set to negative values so that\n * vec.length *= -1 is a valid - if sub-optimal - way of\n * negating a Vec2.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var length(get_length,set_length):Float;\n inline function get_length():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Math.sqrt((this.x*this.x+this.y*this.y));\n }\n inline function set_length(length:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec2::length cannot be NaN\";\n }\n if((this.x*this.x+this.y*this.y)==0){\n throw \"Error: Cannot set length of a zero vector\";\n }\n #end\n {\n var t=(length/Math.sqrt((this.x*this.x+this.y*this.y)));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"length/Math.sqrt((this.x*this.x+this.y*this.y))\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n zpp_inner.invalidate();\n }\n return get_length();\n }\n /**\n * Compute squared length of this Vec2.\n *

\n * This is exactly the same as performing vec.length *\n * vec.length except for being more effecient.\n *\n * @return The squared length of this Vec2.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function lsq():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return(this.x*this.x+this.y*this.y);\n }\n /**\n * Set values of this Vec2 to those of the argument.\n *

\n * Note that vec.set(p) is semantically equivalent to\n * vec.setxy(p.x, p.y).\n *\n * @param vector The Vec2 to set the values of this Vec2 with.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector, or vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function set(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot assign null Vec2\";\n }\n #end\n var ret=setxy(vector.x,vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Compute square distance between two points.\n *\n * @param a The first point Vec2.\n * @param b The second point Vec2.\n * @return Squared distance between points.\n * @throws # If a, b are disposed of or null.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function dsq(a:Vec2,b:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(a!=null&&a.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(b!=null&&b.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(a==null||b==null)throw \"Error: Cannot compute squared distance between null Vec2\";\n #end\n var ret=ZPP_VecMath.vec_dsq(a.x,a.y,b.x,b.y);\n ({\n if(({\n a.zpp_inner.weak;\n })){\n a.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n b.zpp_inner.weak;\n })){\n b.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Compute distance between two points.\n *\n * @param a The first point Vec2.\n * @param b The second point Vec2.\n * @return Distance between points.\n * @throws # If a, b are disposed of or null.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function distance(a:Vec2,b:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(a!=null&&a.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(b!=null&&b.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(a==null||b==null)throw \"Error: Cannot compute squared distance between null Vec2\";\n #end\n var ret=Math.sqrt(ZPP_VecMath.vec_dsq(a.x,a.y,b.x,b.y));\n ({\n if(({\n a.zpp_inner.weak;\n })){\n a.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n b.zpp_inner.weak;\n })){\n b.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Set values of this Vec2 given pair of x/y values.\n *\n * @param x The x value to set this Vec2's x value to.\n * @param y The y value to set this Vec2's y value to.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function setxy(x:Float,y:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n if(!(this.x==x&&this.y==y)){\n {\n zpp_inner.x=x;\n zpp_inner.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.x!=zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.y!=zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Angle of this Vec2.\n *\n * Measured in radians as measured clockwise from the positive x axis.\n * The value will be given in the range -pi to pi.\n *

\n * If the x/y values of this Vec2 are both 0, then the angle value will\n * default to 0.\n *

\n * This value can also be set (to any value) so that vec.angle +=\n * Math.PI is a valid - if sub-optimial - way of negating a Vec2.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var angle(get_angle,set_angle):Float;\n inline function get_angle():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(x==y&&x==0){\n return 0.0;\n }\n else{\n return Math.atan2(y,x);\n }\n }\n inline function set_angle(angle:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Vec2::angle cannot be NaN\";\n }\n #end\n var l=length;\n setxy(l*Math.cos(angle),l*Math.sin(angle));\n }\n return get_angle();\n }\n /**\n * Rotate Vec2 in-place by given number of radians..\n *

\n * Rotation performed in the clockwise direction.\n *

\n * The Vec2 will be mutated, with it's new x/y values being the result\n * of the rotation.\n *\n * @param angle The number of radians to rotate Vec2 by in the clockwise\n * direction.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n #if nape_swc@:keep #end\n public function rotate(angle:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Cannot rotate Vec2 by NaN\";\n }\n #end\n if((angle%(Math.PI*2))!=0){\n var ax=Math.sin(angle);\n var ay=Math.cos(angle);\n {\n var t=(ay*zpp_inner.x-ax*zpp_inner.y);\n zpp_inner.y=(zpp_inner.x*ax+zpp_inner.y*ay);\n zpp_inner.x=t;\n };\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Reflect given Vec2 in plane whose normal is this Vec2.\n *

\n * @param vec The vector to be reflected.\n * @param weak If true, the returned Vec2 will be automatically released\n * to object pool when used in another Nape function (default false)\n * @return The reflected Vec2.\n * @throws # If this vector or argument has been disposed.\n * @throws # If this vector has zero length.\n */\n #if nape_swc@:keep #end\n public function reflect(vec:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vec!=null&&vec.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot reflect in zero vector\";\n }\n #end\n var normal=this.copy(true).normalise();\n var ret=vec.sub(normal.muleq(2*normal.dot(vec)),weak);\n ({\n if(({\n vec.zpp_inner.weak;\n })){\n vec.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Normalise this vector.\n *

\n * Equivalent to setting the length of the vector to 1, and also to the\n * (less-optimal) this.set(this.unit()).\n *\n * @return A reference to 'this' vector.\n * @throws # If this vector has been disposed of or is immutable.\n * @throws # If length of this vector is 0.\n */\n #if nape_swc@:keep #end\n public function normalise():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot normalise vector of length 0\";\n }\n #end\n {\n var d=(this.x*this.x+this.y*this.y);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"this.\"+\")\");\n #end\n };\n var imag=1.0/Math.sqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n };\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Return normalisation of this vector.\n *\n * @param weak If true then the allocated Vec2 will be automatically\n * released to the global object pool when used as an argument\n * to a Nape function. (default false)\n * @return A copy of this vector, normalised.\n * @throws # If this vector has been disposed of.\n * @throws # If length of this vector is 0.\n */\n #if nape_swc@:keep #end\n public function unit(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot normalise vector of length 0\";\n }\n #end\n var scale=1/ZPP_Math.sqrt((this.x*this.x+this.y*this.y));\n return Vec2.get(x*scale,y*scale,weak);\n }\n /**\n * Add another vector to this vector.\n *

\n * Returns a newly allocated vector so that\n * this vector is not modified.\n *

\n * @param vector The vector to add to this vector. This value can not be\n * null\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the sum of this\n * and the input vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function add(vector:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n var ret=Vec2.get(x+vector.x,y+vector.y,weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Add a multiple of a vector to this vector.\n *

\n * This operation is equivalent to:\n *
\n     * this.add(vector.mul(scalar, true));\n     * 
\n *

\n * Returns a newly allocated vector so that\n * this vector is not modified.\n *

\n * @param vector The vector to add to this vector. This value can not be\n * null\n * @param scalar The scalar multiplier for the vector being added.\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the sum of this\n * and the input vector by scalar multiplier.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function addMul(vector:Vec2,scalar:Float,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n var ret=Vec2.get(x+(vector.x*scalar),y+(vector.y*scalar),weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Subtract another vector from this vector.\n *

\n * Returns a newly allocated vector so that this vector is not mutated.\n *\n * @param vector The vector to subtract from this vector. This value can\n * not be null\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the subtraction of\n * the input vector from this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function sub(vector:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot subtract null vectors\";\n }\n #end\n var ret=Vec2.get(x-vector.x,y-vector.y,weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Multiply this vector with a number.\n *

\n * Returns a newly allocated vector so that this vector is not mutated.\n *\n * @param scalar The number to multiply this vector with.\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the multiplication\n * of this vector and the input number.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function mul(scalar:Float,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((scalar!=scalar)){\n throw \"Error: Cannot multiply with NaN\";\n }\n #end\n return Vec2.get(x*scalar,y*scalar,weak);\n }\n /**\n * Add another vector into this vector.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec1.set(vec1.add(vec2))\n *\n * @param vector The vector to add into this vector.\n * @return A reference to this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function addeq(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n setxy(x+vector.x,y+vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Subtract another vector from this vector.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec1.set(vec1.sub(vec2))\n *\n * @param vector The vector to subtract from this vector.\n * @return A reference to this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function subeq(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot subtract null vectors\";\n }\n #end\n setxy(x-vector.x,y-vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Multiply this vector with a number.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec.set(vec.mul(scalar))\n *\n * @param scalar The number to multiply this vector with.\n * @return A reference to this vector.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n #if nape_swc@:keep #end\n public function muleq(scalar:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((scalar!=scalar)){\n throw \"Error: Cannot multiply with NaN\";\n }\n #end\n return setxy(x*scalar,y*scalar);\n }\n /**\n * Dot product with another vector.\n *

\n * The dot product is equal to the product of the length of each\n * vector, multiplied by the cosine of the smallest angle between them.\n *

\n * If one of the vectors is of length 1. Then the dot product is the\n * length of the projection of the other vector onto it which may be\n * computed (assuming 'this' is of length 1) like:\n * vec1.mul(vec1.dot(vec2))\n *\n * @param vector The vector to compute dot product with.\n * @return The dot product of this vector and the other.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function dot(vector:Vec2):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot take dot product with null vector\";\n }\n #end\n var ret=(x*vector.x+y*vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Cross product with another vector.\n *

\n * Also known as the perp-dot product, this operation represents\n * the determinant of the matrix formed by having the 2 columns\n * as the two vectors. This is also the z-value of a 3D cross product\n * if you extend the input vectors with a z-value of 0.\n *

\n * Though not technically a cross-product in the way a 3D cross product\n * is, it shares many mathematical similarities.\n *

\n * If one of the vectors is of length 1. Then the cross product is the\n * length of the projection of the other vector onto the\n * right-perpendicular of the unit vector.\n *

\n * The cross and dot product are related like:\n * vec1.cross(vec2) == vec1.perp().dot(vec2)\n * Hence the name 'perp-dot'\n *

\n * Another useful property is that if the cross-product of two vectors\n * is 0, then the vectors are collinear, if positive then the second\n * vector is 'to the right' of the first vector, and if negative then\n * the second vector is 'to the left' of the first vector.\n *\n * @param vector The vector to compute cross product with.\n * @return The cross product of this vector and the other.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function cross(vector:Vec2):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot take cross product with null vector\";\n }\n #end\n var ret=(vector.y*x-vector.x*y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * The right-perpendicular to this vector.\n *

\n * Computes the result of rotating this vector by 90 degrees clockwise\n * returning a newly allocated vector.\n *

\n * This is semantically equivalent to (the less optimal)\n * vec.copy().rotate(Math.PI/2)\n *

\n * The cross and dot product are related like:\n * vec1.cross(vec2) == vec1.perp().dot(vec2)\n * Hence the name 'perp-dot'\n *\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an argument\n * to another Nape function. (default false)\n * @return The possibly weakly allocated, right-perpendicular to this\n * vector.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function perp(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(-y,x,weak);\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.toString();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass Vec2Iterator{\n /**\n * @private\n */\n public var zpp_inner:Vec2List=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:Vec2Iterator=null;\n /**\n * @private\n */\n public var zpp_next:Vec2Iterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Vec2List.internal)throw \"Error: Cannot instantiate \"+\"Vec2\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:Vec2List){\n var ret=if(zpp_pool==null){\n ZPP_Vec2List.internal=true;\n var ret=new Vec2Iterator();\n ZPP_Vec2List.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Vec2 = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Vec2 = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Vec2 = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!true@:final #end\n#if nape_swc@:keep #end\nclass Vec2List{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec2List=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if false inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Vec2\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new Vec2List();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Vec2)#else Std.is(i,Vec2)#end)throw \"Error: Array contains non \"+\"Vec2\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new Vec2List();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Vec2):Bool{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Vec2{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function add(obj:Vec2):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public function empty(){\n #if false if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public function iterator(){\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return Vec2Iterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new Vec2List();\n for(i in this)ret.push(deep?i.copy():i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:Vec2List):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_Vec2List();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function foreach(lambda:Vec2->Void):Vec2List{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=Vec2Iterator.zpp_pool;\n Vec2Iterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Vec2->Bool):Vec2List{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * In many instances a Vec3 will be accessible from Nape which is marked\n * as immutable, these cases will be documented and modifying such a Vec3\n * will result in an error.\n */\n@:final#if nape_swc@:keep #end\nclass Vec3{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec3=null;\n /**\n * @private\n */\n public var zpp_pool:Vec3=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * The x component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.x;\n }\n inline function set_x(x:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.x=x;\n }\n return get_x();\n }\n /**\n * The y component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.y;\n }\n inline function set_y(y:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.y=y;\n }\n return get_y();\n }\n /**\n * The z component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var z(get_z,set_z):Float;\n inline function get_z():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.z;\n }\n inline function set_z(z:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.z=z;\n }\n return get_z();\n }\n /**\n * Allocate a Vec3 from the global object pool.\n *

\n * Use of this method should always be preferred to the constructor.\n *\n * @param x The x component of Vec3. (default 0)\n * @param y The y component of Vec3. (default 0)\n * @param z The z component of Vec3. (default 0)\n * @return A Vec3 allocated from global object pool with given components.\n */\n public static function get(x:Float=0,y:Float=0,z:Float=0):Vec3{\n var ret;\n {\n if(ZPP_PubPool.poolVec3==null){\n ret=new Vec3();\n #if NAPE_POOL_STATS Vec3.POOL_TOT++;\n Vec3.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolVec3;\n ZPP_PubPool.poolVec3=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextVec3)ZPP_PubPool.nextVec3=null;\n #end\n #if NAPE_POOL_STATS Vec3.POOL_CNT--;\n Vec3.POOL_ADD++;\n #end\n }\n };\n ret.setxyz(x,y,z);\n ret.zpp_inner.immutable=false;\n ret.zpp_inner._validate=null;\n return ret;\n }\n /**\n * Construct a new Vec3.\n *

\n * This method should not generally be used with preference for the\n * static get method which will make use of the global object pool.\n *\n * @param x The x component of Vec3. (default 0)\n * @param y The y component of Vec3. (default 0)\n * @param z The z component of Vec3. (default 0)\n * @return A newly constructed Vec3 with given components.\n */\n public function new(x:Float=0,y:Float=0,z:Float=0){\n zpp_inner=new ZPP_Vec3();\n zpp_inner.outer=this;\n {\n {\n this.x=x;\n this.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n this.z=z;\n };\n }\n /**\n * Produce a copy of this Vec3.\n *\n * @return The copy of this Vec3.\n * @throws # If this Vec3 has been disposed of.\n public function copy():Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec3.get(x,y,z);\n }\n /**\n * Release Vec3 object to global object pool.\n *\n * @throws # If this Vec3 has already been disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: This Vec3 is not disposable\";\n }\n #end\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"Vec3\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextVec3!=null)ZPP_PubPool.nextVec3.zpp_pool=o;\n else ZPP_PubPool.poolVec3=o;\n ZPP_PubPool.nextVec3=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolVec3;\n ZPP_PubPool.poolVec3=o;\n #end\n #if NAPE_POOL_STATS Vec3.POOL_CNT++;\n Vec3.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n }\n /**\n * Length of Vec3.\n *

\n * This value may also be set to any value including negatives, though\n * an error will be thrown if length of the Vec3 is already 0 as such\n * a scaling would be undefined. As well as if this Vec3 has been disposed\n * of, or is immutable.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var length(get_length,set_length):Float;\n inline function get_length():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Math.sqrt(((this.x*this.x+this.y*this.y)+this.z*this.z));\n }\n inline function set_length(length:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec3::length cannot be NaN\";\n }\n if(((this.x*this.x+this.y*this.y)+this.z*this.z)==0){\n throw \"Error: Cannot set length of a zero vector\";\n }\n #end\n {\n var t=((length/this.length));\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n this.z*=t;\n };\n }\n return get_length();\n }\n /**\n * Compute squared length of Vec3.\n *\n * @return The squared length of this Vec3.\n * @throws # If the Vec3 has been disposed of.\n */\n #if nape_swc@:keep #end\n public function lsq():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return((this.x*this.x+this.y*this.y)+this.z*this.z);\n }\n /**\n * Set values of this Vec3 from another.\n *\n * @param vector The vector to set values from.\n * @return A reference to this Vec3.\n * @throws # If the vector argument is null.\n * @throws # If this, or the vector argument are disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function set(vector:Vec3):Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot assign null Vec3\";\n }\n #end\n return setxyz(vector.x,vector.y,vector.z);\n }\n /**\n * Set values of this Vec3 from numbers.\n *\n * @param x The new x component value for this vector.\n * @param y The new y component value for this vector.\n * @param z The new z component value for this vector.\n * @return A reference to this Vec3.\n * @throws # If this Vec3 has been disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function setxyz(x:Float,y:Float,z:Float):Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n {\n this.x=x;\n this.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n this.z=z;\n };\n return this;\n }\n /**\n * Produce copy of the xy components of Vec3.\n *

\n * This function will return a new Vec2 completely seperate\n * from this Vec3 with values equal to the xy components of\n * this Vec3.\n *\n * @param weak If true, then the allocated Vec2 will be weak\n * so that when used as an argument to a Nape\n * function it will be automatically released back\n * to the global object pool. (default false)\n * @return An allocated Vec2 representing the xy components of\n * this vector.\n */\n public function xy(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(x,y,weak);\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return \"{ x: \"+x+\" y: \"+y+\" z: \"+z+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration represents the winding of a Polygon.\n *

\n * To appreciate what the winding of a polygon means, think of a polygon who's\n * vertices are the numbers on a clock face.\n *\n * If the vertices are ordered 12 -> 1 -> 2 ... -> 12\n * then this polygon is clockwise wound. The reverse order would mean the\n * polygon is wound anticlockwise.\n */\n@:final#if nape_swc@:keep #end\nclass Winding{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"Winding\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==UNDEFINED)return\"UNDEFINED\";\n else if(this==CLOCKWISE)return\"CLOCKWISE\";\n else if(this==ANTICLOCKWISE)return\"ANTICLOCKWISE\";\n else return \"\";\n }\n /**\n * Value represents that the polygon has no discernible, or ambiguous winding\n *

\n * This may be because the polygon is degenerate, or because it is self\n * intersecting. In either case it is not well defined to say that the winding\n * is either clockwise or anticlockwise.\n */\n #if nape_swc@:isVar #end\n public static var UNDEFINED(get_UNDEFINED,never):Winding;\n inline static function get_UNDEFINED(){\n if(ZPP_Flags.Winding_UNDEFINED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_UNDEFINED=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_UNDEFINED;\n }\n /**\n * Value represents that the polygon is wound clockwise.\n */\n #if nape_swc@:isVar #end\n public static var CLOCKWISE(get_CLOCKWISE,never):Winding;\n inline static function get_CLOCKWISE(){\n if(ZPP_Flags.Winding_CLOCKWISE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_CLOCKWISE=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_CLOCKWISE;\n }\n /**\n * Value represents that the polygon is wound anticlockwise.\n */\n #if nape_swc@:isVar #end\n public static var ANTICLOCKWISE(get_ANTICLOCKWISE,never):Winding;\n inline static function get_ANTICLOCKWISE(){\n if(ZPP_Flags.Winding_ANTICLOCKWISE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_ANTICLOCKWISE=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_ANTICLOCKWISE;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass Interactor{\n /**\n * @private\n */\n public var zpp_inner_i:ZPP_Interactor=null;\n /**\n * Unique id of this Interactor.\n */\n #if nape_swc@:isVar #end\n public var id(get_id,never):Int;\n inline function get_id():Int{\n return zpp_inner_i.id;\n }\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner_i.userData==null){\n zpp_inner_i.userData=cast{};\n }\n return zpp_inner_i.userData;\n }\n /**\n * Fast equivalent to Std.is(interactor, Shape)\n * @return true if this Interactor is a Shape.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isShape(){\n return zpp_inner_i.ishape!=null;\n }\n /**\n * Fast equivalent to Std.is(interactor, Body)\n * @return true if this Interactor is a Body.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isBody(){\n return zpp_inner_i.ibody!=null;\n }\n /**\n * Fast equivalent to Std.is(interactor, Compound)\n * @return true if this Interactor is a Compound.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isCompound(){\n return zpp_inner_i.icompound!=null;\n }\n /**\n * Fast equivalent to cast(interactor, Shape)\n */\n #if nape_swc@:isVar #end\n public var castShape(get_castShape,never):Null;\n inline function get_castShape():Null{\n return if(isShape())zpp_inner_i.ishape.outer else null;\n }\n /**\n * Fast equivalent to cast(interactor, Body)\n */\n #if nape_swc@:isVar #end\n public var castBody(get_castBody,never):Null;\n inline function get_castBody():Null{\n return if(isBody())zpp_inner_i.ibody.outer else null;\n }\n /**\n * Fast equivalent to cast(interactor, Compound)\n */\n #if nape_swc@:isVar #end\n public var castCompound(get_castCompound,never):Null;\n inline function get_castCompound():Null{\n return if(isCompound())zpp_inner_i.icompound.outer else null;\n }\n /**\n * InteractionGroup assigned to this Interactor.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var group(get_group,set_group):Null;\n inline function get_group():Null{\n return if(zpp_inner_i.group==null)null else zpp_inner_i.group.outer;\n }\n inline function set_group(group:Null):Null{\n {\n zpp_inner_i.immutable_midstep(\"Interactor::group\");\n zpp_inner_i.setGroup(group==null?null:group.zpp_inner);\n }\n return get_group();\n }\n /**\n * Set of CbType's assigned to this Interactor.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var cbTypes(get_cbTypes,never):CbTypeList;\n inline function get_cbTypes():CbTypeList{\n if(zpp_inner_i.wrap_cbTypes==null)zpp_inner_i.setupcbTypes();\n return zpp_inner_i.wrap_cbTypes;\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Cannot instantiate an Interactor, only Shape/Body/Compound\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"\";\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing a physics Rigid Body.\n */\n@:final#if nape_swc@:keep #end\nclass Body extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Body=null;\n /**\n * Set to disable debug drawing/\n *

\n * When true, this Body will not be drawn during debug draw operations\n * unless specifically given as argument to Debug draw() method.\n * @default true\n */\n public var debugDraw:Bool=true;\n /**\n * Type of body.\n *

\n * This value can be changed even if Body is inside of a Space.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,set_type):BodyType;\n inline function get_type():BodyType{\n return ZPP_Body.types[zpp_inner.type];\n }\n inline function set_type(type:BodyType):BodyType{\n {\n zpp_inner.immutable_midstep(\"Body::type\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.type!=type){\n #if(!NAPE_RELEASE_BUILD)\n if(type==null)throw \"Error: Cannot use null BodyType\";\n #end\n var ntype=type==BodyType.DYNAMIC?ZPP_Flags.id_BodyType_DYNAMIC:type==BodyType.KINEMATIC?ZPP_Flags.id_BodyType_KINEMATIC:ZPP_Flags.id_BodyType_STATIC;\n if(ntype==ZPP_Flags.id_BodyType_STATIC&&zpp_inner.space!=null){\n {\n zpp_inner.velx=0;\n zpp_inner.vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.velx!=zpp_inner.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.vely!=zpp_inner.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n zpp_inner.angvel=0;\n }\n zpp_inner.invalidate_type();\n if(zpp_inner.space!=null)zpp_inner.space.transmitType(zpp_inner,ntype);\n else zpp_inner.type=ntype;\n }\n }\n return get_type();\n }\n /**\n * Mark object for continuous collisions against other dynamic Bodies\n *

\n * If true, then this Body will undergo continuous collisions with other\n * dynamic Bodies. This flag has no effect for non-dynamic Bodies.\n *

\n * This flag should only be set for very fast, small moving dynamic bodies,\n * and due to the way continuous collisions are resolved it is not wise to\n * enable this for a large group of bodies that interact together as it\n * will lead to visual stalling.\n *
\n * Bullets also do not play well when existing in a group with respect to\n * continuous collisions against kinematic objects and may cause\n * tunnelling against the kinematic.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var isBullet(get_isBullet,set_isBullet):Bool;\n inline function get_isBullet():Bool{\n return zpp_inner.bulletEnabled;\n }\n inline function set_isBullet(isBullet:Bool):Bool{\n {\n zpp_inner.bulletEnabled=isBullet;\n }\n return get_isBullet();\n }\n /**\n * Declare object should never be collided continuously\n *

\n * When performing continuous collisions, Nape will check both Bodies to see\n * if either has opted-out of CCD. If either Body has this flag true, then\n * no CCD will be performed for that pair.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var disableCCD(get_disableCCD,set_disableCCD):Bool;\n inline function get_disableCCD():Bool{\n return zpp_inner.disableCCD;\n }\n inline function set_disableCCD(disableCCD:Bool):Bool{\n {\n zpp_inner.disableCCD=disableCCD;\n }\n return get_disableCCD();\n }\n /**\n * Integrate body forward in time, taking only velocities into account.\n *\n * @param deltaTime The time to integrate body by. This value may be negative to\n * integrate back in time.\n * @return A refernce to 'this' Body\n */\n #if nape_swc@:keep #end\n public function integrate(deltaTime:Float){\n #if(!NAPE_RELEASE_BUILD)\n if((deltaTime!=deltaTime))throw \"Cannot integrate by NaN time\";\n #end\n zpp_inner.immutable_midstep(\"Body::space\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(deltaTime==0)return this;\n var cur=this.zpp_inner;\n cur.sweepTime=0;\n cur.sweep_angvel=cur.angvel;\n cur.sweepIntegrate(deltaTime);\n cur.invalidate_pos();\n cur.invalidate_rot();\n cur.sweepTime=0;\n return this;\n }\n /**\n * Fast equivalent to body.type == BodyType.STATIC\n * @return True if body is Static.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isStatic(){\n return zpp_inner.isStatic();\n }\n /**\n * Fast equivalent to body.type == BodyType.DYNAMIC\n * @return True if body is Dynamic.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isDynamic(){\n return zpp_inner.isDynamic();\n }\n /**\n * Fast equivalent to body.type == BodyType.KINEMATIC\n * @return True if body is Kinematic.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isKinematic(){\n return zpp_inner.isKinematic();\n }\n /**\n * List of shapes owned by Body.\n *

\n * Appending a Shape to this list is equivalent to shape.body = this\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n return zpp_inner.wrap_shapes;\n }\n /**\n * Compound this Body belongs to.\n *

\n * If this Body belongs to a Compound, then the Compound 'owns' this Body and\n * it is the Compound which would be added/removed from a Space rather than\n * this Body.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n if(this.compound!=compound){\n if(this.compound!=null)this.compound.bodies.remove(this);\n if(compound!=null)compound.bodies.add(this);\n }\n }\n return get_compound();\n }\n /**\n * Space this Body is assigned to.\n *

\n * When this Body is part of a Compound, this value is immutable.\n *
\n * When a Body is part of a Compound it is owned by that Compound and it\n * is the Compound that is added/removed from a Space.\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set\";\n #end\n zpp_inner.immutable_midstep(\"Body::space\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.space!=space){\n if(this.space!=null)zpp_inner.component.woken=false;\n if(this.space!=null)this.space.bodies.remove(this);\n if(space!=null)space.bodies.add(this);\n }\n }\n return get_space();\n }\n /**\n * Set of active arbiters related to this Body.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n if(zpp_inner.wrap_arbiters==null)zpp_inner.wrap_arbiters=ZPP_ArbiterList.get(zpp_inner.arbiters,true);\n return zpp_inner.wrap_arbiters;\n }\n /**\n * Whether this body is sleeping.\n *

\n * This value is immutable, In Nape you do not ever need to manually wake up a Body.\n * It will always be done automatically without error.\n *

\n * To manually put a Body to sleep is against the very nature of Nape API\n * and so is excluded from the core of Nape. If you really want to do this\n * then you should make use of the nape-hacks module.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.space==null)throw \"Error: isSleeping makes no sense if the object is not contained within a Space\";\n #end\n return zpp_inner.component.sleeping;\n }\n /**\n * Set of constraints using this Body.\n *

\n * This list contains those constraints that are inside of a Space only.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n if(zpp_inner.wrap_constraints==null)zpp_inner.wrap_constraints=ZPP_ConstraintList.get(zpp_inner.constraints,true);\n return zpp_inner.wrap_constraints;\n }\n /**\n * Construct a new Body.\n *

\n * @param type The type of Body to create. (default DYNAMIC)\n * @param position The initial position for object. (default (0,0))\n * @return The newly constructed Body.\n * @throws # If position is non-null, and has been disposed of.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(type:BodyType=null,position:Vec2=null){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner=new ZPP_Body();\n zpp_inner.outer=this;\n zpp_inner.outer_i=this;\n zpp_inner_i=zpp_inner;\n if(position!=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.posx=position.x;\n zpp_inner.posy=position.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posx!=zpp_inner.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"position.x\"+\",in y: \"+\"position.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posy!=zpp_inner.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"position.x\"+\",in y: \"+\"position.y\"+\")\");\n #end\n };\n };\n }\n else{\n zpp_inner.posx=0;\n zpp_inner.posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posx!=zpp_inner.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posy!=zpp_inner.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n this.type=type==null?BodyType.DYNAMIC:type;\n if(position!=null)({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n zpp_inner_i.insert_cbtype(CbType.ANY_BODY.zpp_inner);\n }\n /**\n * Construct an exact copy of this Body.\n *

\n * All properties will be exactly copied, with Shapes also\n * being copied with the copied Body's and Shape's userData\n * objects being assigned the same fields as the existing ones with\n * values copied over by reference for object types.\n *\n * @return A copy of this Body.\n */\n #if nape_swc@:keep #end\n public function copy(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world cannot be copied\";\n #end\n return zpp_inner.copy();\n }\n /**\n * Position of Body's origin in px.\n *

\n * This value can be set and is equivalent to: this.position.set(value)\n *

\n * Attempting to set this value on a static Body that is in a Space will result\n * in a debug build error.\n *

\n * Please note that for kinematic objects, setting this value is equiavalent\n * to 'teleporting' the object, and for normal movement you should be using\n * the kinematic body's velocity.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var position(get_position,set_position):Vec2;\n inline function get_position():Vec2{\n if(zpp_inner.wrap_pos==null)zpp_inner.setupPosition();\n return zpp_inner.wrap_pos;\n }\n inline function set_position(position:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Body::\"+\"position\"+\" cannot be null\";\n #end\n this.position.set(position);\n }\n return get_position();\n }\n /**\n * Linear velocity of Body's origin in px/s.\n *

\n * This value can be set and is equivalent to: this.velocity.set(value)\n *

\n * A static body cannot have its velocity set.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var velocity(get_velocity,set_velocity):Vec2;\n inline function get_velocity():Vec2{\n if(zpp_inner.wrap_vel==null)zpp_inner.setupVelocity();\n return zpp_inner.wrap_vel;\n }\n inline function set_velocity(velocity:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(velocity!=null&&velocity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(velocity==null)throw \"Error: Body::\"+\"velocity\"+\" cannot be null\";\n #end\n this.velocity.set(velocity);\n }\n return get_velocity();\n }\n /**\n * Set velocities to achieve desired position at end of time step.\n *

\n * This function is a utility to help with animating kinematic bodies.\n * Kinematic bodies should be moved through velocity, but it is often\n * easier to think in terms of position.\n *

\n * This method will set linear and angular velocities so that the target\n * position/rotation is achieved at end of time step.\n *\n * @param targetPosition The target position for Body.\n * @param targetRotation The target rotation for Body.\n * @param deltaTime The time step for next call to space.step().\n * @throws # If targetPosition is null or disposed of.\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function setVelocityFromTarget(targetPosition:Vec2,targetRotation:Float,deltaTime:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(targetPosition!=null&&targetPosition.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(targetPosition==null)throw \"Cannot set velocity for null target position\";\n if(deltaTime==0)throw \"deltaTime cannot be 0 for setVelocityFromTarget\";\n #end\n var idt=(1/deltaTime);\n this.velocity.set(targetPosition.sub(this.position,true).muleq(idt));\n this.angularVel=(targetRotation-this.rotation)*idt;\n ({\n if(({\n targetPosition.zpp_inner.weak;\n })){\n targetPosition.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Additional kinematic velocity of Body in px/s.\n *

\n * A bodies 'kinematic' velocity is an added velocity bias used in all physics\n * computations but that will not effect how the Body moves directly.\n *

\n * Even a static body can be given a kinematic velocity, and can be used for\n * such things as giving a body of water a fluid-velocity for fluid drag\n * computations.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var kinematicVel(get_kinematicVel,set_kinematicVel):Vec2;\n inline function get_kinematicVel():Vec2{\n if(zpp_inner.wrap_kinvel==null)zpp_inner.setupkinvel();\n return zpp_inner.wrap_kinvel;\n }\n inline function set_kinematicVel(kinematicVel:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(kinematicVel!=null&&kinematicVel.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(kinematicVel==null)throw \"Error: Body::\"+\"kinematicVel\"+\" cannot be null\";\n #end\n this.kinematicVel.set(kinematicVel);\n }\n return get_kinematicVel();\n }\n /**\n * Additional surface velocity for Body in px/s.\n *

\n * A bodies 'surface' velocity is an added velocity bias that is rotated to match\n * the angle of the contact surface used in contact physics and will not\n * effect how the Body moves directly.\n *

\n * Even a static body can be given a surface velocity, and can be used for\n * such things as conveyor belts (By setting the x-component of surfaceVel).\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var surfaceVel(get_surfaceVel,set_surfaceVel):Vec2;\n inline function get_surfaceVel():Vec2{\n if(zpp_inner.wrap_svel==null)zpp_inner.setupsvel();\n return zpp_inner.wrap_svel;\n }\n inline function set_surfaceVel(surfaceVel:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(surfaceVel!=null&&surfaceVel.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(surfaceVel==null)throw \"Error: Body::\"+\"surfaceVel\"+\" cannot be null\";\n #end\n this.surfaceVel.set(surfaceVel);\n }\n return get_surfaceVel();\n }\n /**\n * Accumulated force acting on body in px.kg/s/s\n *

\n * This value is not used internally for any physics computations.\n *

\n * You may set this property only on dynamic bodies.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var force(get_force,set_force):Vec2;\n inline function get_force():Vec2{\n if(zpp_inner.wrap_force==null)zpp_inner.setupForce();\n return zpp_inner.wrap_force;\n }\n inline function set_force(force:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(force!=null&&force.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(force==null)throw \"Error: Body::\"+\"force\"+\" cannot be null\";\n #end\n this.force.set(force);\n }\n return get_force();\n }\n /**\n * This property represents the velocity seen by constraint physics.\n *

\n * You should not need to use this property unless writing your own\n * constraints using the UserConstraint API.\n */\n #if nape_swc@:isVar #end\n public var constraintVelocity(get_constraintVelocity,never):Vec3;\n inline function get_constraintVelocity():Vec3{\n if(zpp_inner.wrapcvel==null)zpp_inner.setup_cvel();\n return zpp_inner.wrapcvel;\n }\n /**\n * Rotation of Body in clockwise rad.\n *

\n * Attempting to set this value on a static Body that is in a Space will result\n * in a debug build error.\n *

\n * Please note that for kinematic objects, setting this value is equiavalent\n * to 'teleporting' the object, and for normal movement you should be using\n * the kinematic body's angularVel.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var rotation(get_rotation,set_rotation):Float;\n inline function get_rotation():Float{\n return zpp_inner.rot;\n }\n inline function set_rotation(rotation:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::rotation\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(isStatic()&&zpp_inner.space!=null)throw \"Error: Static objects cannot be rotated once inside a Space\";\n #end\n if(this.rotation!=rotation){\n #if(!NAPE_RELEASE_BUILD)\n if((rotation!=rotation))throw \"Error: Body::rotation cannot be NaN\";\n #end\n zpp_inner.rot=rotation;\n zpp_inner.invalidate_rot();\n zpp_inner.wake();\n }\n }\n return get_rotation();\n }\n /**\n * Angular velocity of Body in clockwise rad/s\n *

\n * A static body cannot have its angular velocity set.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var angularVel(get_angularVel,set_angularVel):Float;\n inline function get_angularVel():Float{\n return zpp_inner.angvel;\n }\n inline function set_angularVel(angularVel:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.angularVel!=angularVel){\n #if(!NAPE_RELEASE_BUILD)\n if((angularVel!=angularVel))throw \"Error: Body::angularVel cannot be NaN\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.isStatic())throw \"Error: A static object cannot be given a velocity\";\n #end\n zpp_inner.angvel=angularVel;\n zpp_inner.invalidate_wake();\n }\n }\n return get_angularVel();\n }\n /**\n * Additional kinematic angular velocity of Body in rad/s.\n *

\n * A bodies 'kinematic' velocity is an added velocity bias used in all physics\n * computations but that will not effect how the Body moves directly.\n *

\n * Even a static body can be given a kinematic velocity, and can be used for\n * such things as giving a body of water a fluid-velocity for fluid drag\n * computations.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var kinAngVel(get_kinAngVel,set_kinAngVel):Float;\n inline function get_kinAngVel():Float{\n return zpp_inner.kinangvel;\n }\n inline function set_kinAngVel(kinAngVel:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.kinAngVel!=kinAngVel){\n #if(!NAPE_RELEASE_BUILD)\n if((kinAngVel!=kinAngVel))throw \"Error: Body::kinAngVel cannot be NaN\";\n #end\n zpp_inner.kinangvel=kinAngVel;\n zpp_inner.invalidate_wake();\n }\n }\n return get_kinAngVel();\n }\n /**\n * Accumulated torque acting on body in px.px.kg/s/s\n *

\n * This value is not used internally for any physics computations.\n *

\n * You may set this property only on dynamic bodies.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var torque(get_torque,set_torque):Float;\n inline function get_torque():Float{\n return zpp_inner.torque;\n }\n inline function set_torque(torque:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!isDynamic())throw \"Error: Non-dynamic body cannot have torque applied.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((torque!=torque))throw \"Error: Body::torque cannot be NaN\";\n #end\n if(this.torque!=torque){\n zpp_inner.torque=torque;\n zpp_inner.invalidate_wake();\n }\n }\n return get_torque();\n }\n /**\n * Bounding box of Body in world space.\n *

\n * This value can be accessed even if there are no Shapes in the Body, but\n * attempting to query its values whilst there are no Shapes will result\n * in a debug build error.\n *

\n * This AABB is immutable.\n */\n #if nape_swc@:isVar #end\n public var bounds(get_bounds,never):AABB;\n inline function get_bounds():AABB{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no bounds\";\n #end\n return zpp_inner.aabb.wrapper();\n }\n /**\n * Whether dynamic Body is permitted to be moved by physics linearly.\n *

\n * When this field is false, no physics will be able to cause a change in the\n * bodies linear velocity (It can still move, but only if you tell it to like\n * a kinematic body).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var allowMovement(get_allowMovement,set_allowMovement):Bool;\n inline function get_allowMovement():Bool{\n return!zpp_inner.nomove;\n }\n inline function set_allowMovement(allowMovement:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Body::\"+allowMovement);\n if(this.allowMovement!=allowMovement){\n zpp_inner.nomove=!allowMovement;\n zpp_inner.invalidate_mass();\n }\n }\n return get_allowMovement();\n }\n /**\n * Whether dynamic Body is permitted to be rotated by physics.\n *

\n * When this field is false, no physics will be able to cause a change in the\n * bodies angular velocity (It can still rotate, but only if you tell it to like\n * a kinematic body).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var allowRotation(get_allowRotation,set_allowRotation):Bool;\n inline function get_allowRotation():Bool{\n return!zpp_inner.norotate;\n }\n inline function set_allowRotation(allowRotation:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Body::\"+allowRotation);\n if(this.allowRotation!=allowRotation){\n zpp_inner.norotate=!allowRotation;\n zpp_inner.invalidate_inertia();\n }\n }\n return get_allowRotation();\n }\n /**\n * Method of mass computation for Body.\n *

\n * This value will be set implicitly to FIXED when mass property is set.\n *
Setting back to DEFAULT will then set mass implicitly back to the default\n * computed mass.\n *\n * @default MassMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var massMode(get_massMode,set_massMode):MassMode;\n inline function get_massMode():MassMode{\n return[MassMode.DEFAULT,MassMode.FIXED][zpp_inner.massMode];\n }\n inline function set_massMode(massMode:MassMode):MassMode{\n {\n zpp_inner.immutable_midstep(\"Body::massMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(massMode==null)throw \"Error: cannot use null massMode\";\n #end\n zpp_inner.massMode=massMode==MassMode.DEFAULT?ZPP_Flags.id_MassMode_DEFAULT:ZPP_Flags.id_MassMode_FIXED;\n zpp_inner.invalidate_mass();\n }\n return get_massMode();\n }\n /**\n * Mass to be used for a Body in User built constraints.\n *

\n * This value is given as the inverse mass of the Body taking into account\n * Body type (Static and Kinematic Bodies will have constraintMass of 0)\n * as well as properties like allowMovement.\n */\n #if nape_swc@:isVar #end\n public var constraintMass(get_constraintMass,never):Float;\n inline function get_constraintMass():Float{\n if(!zpp_inner.world)zpp_inner.validate_mass();\n return zpp_inner.smass;\n }\n /**\n * Mass of the Body.\n *

\n * This value is computed by default based on the Body's Shape's areas and\n * Material densities.\n *
\n * When massMode is DEFAULT, accessing this value for an empty Body will thus\n * give an error as the value is undefined.\n *

\n * Setting this value will permit you to give a fixed mass to the Body\n * implicitly changing the massMode to MassMode.FIXED\n */\n #if nape_swc@:isVar #end\n public var mass(get_mass,set_mass):Float;\n inline function get_mass():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no mass\";\n #end\n zpp_inner.validate_mass();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.shapes.empty())throw \"Error: Given current mass mode, Body::mass only makes sense if it contains shapes\";\n #end\n return zpp_inner.cmass;\n }\n inline function set_mass(mass:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::mass\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((mass!=mass))throw \"Error: Mass cannot be NaN\";\n if(mass<=0)throw \"Error: Mass must be strictly positive\";\n if(mass>=ZPP_Const.POSINF())throw \"Error: Mass cannot be infinite, use allowMovement = false instead\";\n #end\n zpp_inner.massMode=ZPP_Flags.id_MassMode_FIXED;\n zpp_inner.cmass=mass;\n zpp_inner.invalidate_mass();\n }\n return get_mass();\n }\n /**\n * Method of computing mass as seen by gravity.\n *

\n * This value will be implicitly set by modifying gravMass or gravMassScale properties.\n *\n * @default GravMassMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var gravMassMode(get_gravMassMode,set_gravMassMode):GravMassMode;\n inline function get_gravMassMode():GravMassMode{\n return[GravMassMode.DEFAULT,GravMassMode.FIXED,GravMassMode.SCALED][zpp_inner.massMode];\n }\n inline function set_gravMassMode(gravMassMode:GravMassMode):GravMassMode{\n {\n zpp_inner.immutable_midstep(\"Body::gravMassMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(gravMassMode==null)throw \"Error: Cannot use null gravMassMode\";\n #end\n zpp_inner.gravMassMode=gravMassMode==GravMassMode.SCALED?ZPP_Flags.id_GravMassMode_SCALED:gravMassMode==GravMassMode.DEFAULT?ZPP_Flags.id_GravMassMode_DEFAULT:ZPP_Flags.id_GravMassMode_FIXED;\n zpp_inner.invalidate_gravMass();\n }\n return get_gravMassMode();\n }\n /**\n * Mass used in gravity computations in a Space.\n *

\n * Setting this value will implicitly change the gravMassMode to FIXED.\n *
\n * Set to 0 to disable gravity for this Body.\n */\n #if nape_swc@:isVar #end\n public var gravMass(get_gravMass,set_gravMass):Float;\n inline function get_gravMass():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no gravMass\";\n #end\n zpp_inner.validate_gravMass();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty()){\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.gravMassMode!=ZPP_Flags.id_GravMassMode_FIXED)throw \"Error: Given current mass/gravMass modes; Body::gravMass only makes sense if it contains Shapes\";\n }\n #end\n return zpp_inner.gravMass;\n }\n inline function set_gravMass(gravMass:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::gravMass\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((gravMass!=gravMass))throw \"Error: gravMass cannot be NaN\";\n #end\n zpp_inner.gravMassMode=ZPP_Flags.id_GravMassMode_FIXED;\n zpp_inner.gravMass=gravMass;\n zpp_inner.invalidate_gravMass();\n }\n return get_gravMass();\n }\n /**\n * Mass scale used in computation of gravity for Body in Space.\n *

\n * Setting this value will implicitly change the gravMassMode to SCALED.\n *
\n * When set, the gravMass of Body will be computed as this scaling factor\n * multiplied with the Body's mass.\n */\n #if nape_swc@:isVar #end\n public var gravMassScale(get_gravMassScale,set_gravMassScale):Float;\n inline function get_gravMassScale():Float{\n zpp_inner.validate_gravMassScale();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty()){\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)throw \"Error: Given current mass/gravMass modes; Body::gravMassScale only makes sense if it contains Shapes\";\n }\n #end\n return zpp_inner.gravMassScale;\n }\n inline function set_gravMassScale(gravMassScale:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::gravMassScale\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((gravMassScale!=gravMassScale))throw \"Error: gravMassScale cannot be NaN\";\n #end\n zpp_inner.gravMassMode=ZPP_Flags.id_GravMassMode_SCALED;\n zpp_inner.gravMassScale=gravMassScale;\n zpp_inner.invalidate_gravMassScale();\n }\n return get_gravMassScale();\n }\n /**\n * Method of computing Body moment of inertia.\n *

\n * This value will be set implicitly by modifying Body inertia property.\n *\n * @default InertiaMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var inertiaMode(get_inertiaMode,set_inertiaMode):InertiaMode;\n inline function get_inertiaMode():InertiaMode{\n return[InertiaMode.DEFAULT,InertiaMode.FIXED][zpp_inner.inertiaMode];\n }\n inline function set_inertiaMode(inertiaMode:InertiaMode):InertiaMode{\n {\n zpp_inner.immutable_midstep(\"Body::inertiaMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(inertiaMode==null)throw \"Error: Cannot use null InertiaMode\";\n #end\n zpp_inner.inertiaMode=inertiaMode==InertiaMode.FIXED?ZPP_Flags.id_InertiaMode_FIXED:ZPP_Flags.id_InertiaMode_DEFAULT;\n zpp_inner.invalidate_inertia();\n }\n return get_inertiaMode();\n }\n /**\n * Moment of inertia to be used in user defined Constraints.\n *

\n * This value is equal to the inverse inertia of the Body taking into account\n * Body type (Static and Kinematic bodies will have constraintInertia of 0).\n * As well as properties like allowRotation.\n */\n #if nape_swc@:isVar #end\n public var constraintInertia(get_constraintInertia,never):Float;\n inline function get_constraintInertia():Float{\n if(!zpp_inner.world)zpp_inner.validate_inertia();\n return zpp_inner.sinertia;\n }\n /**\n * Moment of inertia of this Body.\n *

\n * Setting this value will implicitly change the inertiaMode to FIXED.\n */\n #if nape_swc@:isVar #end\n public var inertia(get_inertia,set_inertia):Float;\n inline function get_inertia():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no inertia\";\n #end\n zpp_inner.validate_inertia();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT&&shapes.empty())throw \"Error: Given current inertia mode flag, Body::inertia only makes sense if Body contains Shapes\";\n #end\n return zpp_inner.cinertia;\n }\n inline function set_inertia(inertia:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::inertia\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((inertia!=inertia))throw \"Error: Inertia cannot be NaN\";\n if(inertia<=0)throw \"Error: Inertia must be strictly positive\";\n if(inertia>=ZPP_Const.POSINF())throw \"Error: Inertia cannot be infinite, use allowRotation = false instead\";\n #end\n zpp_inner.inertiaMode=ZPP_Flags.id_InertiaMode_FIXED;\n zpp_inner.cinertia=inertia;\n zpp_inner.invalidate_inertia();\n }\n return get_inertia();\n }\n /**\n * Compute set of bodies connected via constraints.\n *

\n * Only constraints that are inside of a Space will be considered the\n * same way that the body's constraints list only tracks constraints\n * that are part of a simulation.\n *\n * @param depth Control the depth limit of the graph search. Negative\n * values indicate an unlimited search. A depth value of\n * 0 would cause only the current Body to be returned.\n * (default -1)\n * @param output An optional list to append results to, if left as null\n * then a new list is created.\n * @return A list of the connected bodies up to\n * the given graph depth.\n */\n #if nape_swc@:keep #end\n public function connectedBodies(depth:Int=-1,output:BodyList=null):BodyList{\n return zpp_inner.connectedBodies(depth,output);\n }\n /**\n * Compute set of bodies interacting with this body.\n *\n * @param type When not equal to null, this parameter controls what sort\n * of interaction we permit in the search.\n * @param depth Control the depth limit of the graph search. Negative\n * values indicate an unlimited search. A depth value of\n * 0 would cause only the current Body to be returned.\n * (default -1)\n * @param output An optional list to append results to, if left as null\n * then a new list is created.\n * @return A list of the interacting bodies up to\n * the given graph depth.\n */\n #if nape_swc@:keep #end\n public function interactingBodies(type:InteractionType=null,depth:Int=-1,output:BodyList=null){\n var arbiter_type=if(type==null){\n ZPP_Arbiter.COL|ZPP_Arbiter.SENSOR|ZPP_Arbiter.FLUID;\n }\n else if(type==InteractionType.COLLISION)ZPP_Arbiter.COL else if(type==InteractionType.SENSOR)ZPP_Arbiter.SENSOR else ZPP_Arbiter.FLUID;\n return zpp_inner.interactingBodies(arbiter_type,depth,output);\n }\n /**\n * Determine how much this body is being crushed.\n *

\n * This is an approximate value, computed as:\n * crushFactor = (sum(magnitude(impulse)) - magnitude(sum(impulse))) / mass\n *

\n * In this way, it is a mass and time step invariant value which is 0 when all impulses\n * are acting on body in the same direction, and has maximum value when impulses\n * act in opposing directions 'crushing' the Body.\n *\n * @return A positive value representing an approximation to how much the\n * body is being crushed.\n * @throws # If body is not in a Space.\n */\n #if nape_swc@:keep #end\n public function crushFactor():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(space==null)throw \"Error: Makes no sense to see how much an object not taking part in a simulation is being crushed\";\n #end\n var msum=0.0;\n var jsum=Vec2.get();\n for(arb in arbiters){\n var imp3=arb.totalImpulse(this);\n var imp=imp3.xy();\n jsum.addeq(imp);\n msum+=imp.length;\n imp.dispose();\n imp3.dispose();\n }\n for(con in constraints){\n var imp3=con.bodyImpulse(this);\n var imp=imp3.xy();\n jsum.addeq(imp);\n msum+=imp.length;\n imp.dispose();\n imp3.dispose();\n }\n var ret=(msum-jsum.length)/(this.mass*space.zpp_inner.pre_dt);\n jsum.dispose();\n return ret;\n }\n /**\n * Transform a point from Body's local coordinates to world coordinates.\n *\n * @param point The point to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function localPointToWorld(point:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(zpp_inner.axisy*point.x-zpp_inner.axisx*point.y);\n tempy=(point.x*zpp_inner.axisx+point.y*zpp_inner.axisy);\n };\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx+zpp_inner.posx,tempy+zpp_inner.posy,weak);\n }\n /**\n * Transform a point from world coordinates to Body's local coordinates.\n *\n * @param point The point to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function worldPointToLocal(point:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n var pointx:Float=0.0;\n var pointy:Float=0.0;\n {\n pointx=point.x-zpp_inner.posx;\n pointy=point.y-zpp_inner.posy;\n };\n {\n tempx=pointx*zpp_inner.axisy+pointy*zpp_inner.axisx;\n tempy=pointy*zpp_inner.axisy-pointx*zpp_inner.axisx;\n };\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Transform vector from Body's local coordinates into world coordinates.\n *

\n *\n * @param vector The vector to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If vector is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function localVectorToWorld(vector:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(zpp_inner.axisy*vector.x-zpp_inner.axisx*vector.y);\n tempy=(vector.x*zpp_inner.axisx+vector.y*zpp_inner.axisy);\n };\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Transform vector from world coordinates to Body's local coordinates\n *

\n *\n * @param vector The vector to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If vector is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function worldVectorToLocal(vector:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=vector.x*zpp_inner.axisy+vector.y*zpp_inner.axisx;\n tempy=vector.y*zpp_inner.axisy-vector.x*zpp_inner.axisx;\n };\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Apply impulse to a point on Body.\n *

\n * If position argument is not given, then body.position is assumed so that impulse\n * is applied at centre of Body.\n *\n * @param impulse The impulse to apply given in world coordinates.\n * @param pos The position to apply impulse given in world coordinates.\n * (default body.position)\n * @param sleepable This parameter can be set to true, in the case that you\n * are constantly applying an impulse which is dependent only\n * on the position/velocity of the body meaning that application\n * of this impulse does not need to prevent the object from sleeping.\n * When true, and the body is sleeping, this method call will not\n * apply any impulse.\n * (default false).\n * @throws # If impulse is null or disposed of.\n * @throws # If pos is non-null and disposed of.\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function applyImpulse(impulse:Vec2,pos:Vec2=null,sleepable:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(impulse!=null&&impulse.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(pos!=null&&pos.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(impulse==null)throw \"Error: Cannot apply null impulse to Body\";\n #end\n if(sleepable&&isSleeping){\n ({\n if(({\n impulse.zpp_inner.weak;\n })){\n impulse.dispose();\n true;\n }\n else{\n false;\n }\n });\n if(pos!=null){\n ({\n if(({\n pos.zpp_inner.weak;\n })){\n pos.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n return this;\n }\n zpp_inner.validate_mass();\n {\n var t=(zpp_inner.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"zpp_inner.vel\"+\",in b: \"+\"impulse.\"+\",in s: \"+\"zpp_inner.imass\"+\")\");\n #end\n };\n zpp_inner.velx+=impulse.x*t;\n zpp_inner.vely+=impulse.y*t;\n };\n if(pos!=null){\n var rx:Float=0.0;\n var ry:Float=0.0;\n {\n rx=pos.x-zpp_inner.posx;\n ry=pos.y-zpp_inner.posy;\n };\n zpp_inner.validate_inertia();\n zpp_inner.angvel+=(impulse.y*rx-impulse.x*ry)*zpp_inner.iinertia;\n ({\n if(({\n pos.zpp_inner.weak;\n })){\n pos.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n if(!sleepable){\n if(isDynamic())zpp_inner.invalidate_wake();\n }\n ({\n if(({\n impulse.zpp_inner.weak;\n })){\n impulse.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Apply a pure angular impulse to Body.\n *\n * @param impulse The angular impulse to apply.\n * @param sleepable This parameter can be set to true, in the case that you\n * are constantly applying an impulse which is dependent only\n * on the position/velocity of the body meaning that application\n * of this impulse does not need to prevent the object from sleeping.\n * When true, and the body is sleeping, this method call will not\n * apply any impulse.\n * (default false).\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function applyAngularImpulse(impulse:Float,sleepable:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(sleepable&&isSleeping){\n return this;\n }\n zpp_inner.validate_inertia();\n zpp_inner.angvel+=impulse*zpp_inner.iinertia;\n if(!sleepable){\n if(isDynamic())zpp_inner.invalidate_wake();\n }\n return this;\n }\n /**\n * Translate each shape in local coordinates.\n *

\n * This operation does not effect the Body's position, but the position\n * of the shapes 'inside' of the Body.\n *\n * @param translation The local translation to apply to Shapes.\n * @return A reference to this Body.\n * @throws # If translation is null or has been disposed of.\n * @throws # If this Body is static, and inside of a Space.\n */\n #if nape_swc@:keep #end\n public function translateShapes(translation:Vec2){\n zpp_inner.immutable_midstep(\"Body::translateShapes()\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(translation==null)throw \"Error: Cannot displace by null Vec2\";\n #end\n var weak=translation.zpp_inner.weak;\n translation.zpp_inner.weak=false;\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.translate(translation);\n cx_ite=cx_ite.next;\n }\n };\n translation.zpp_inner.weak=weak;\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Rotate each shape in local coordinates.\n *

\n * This operation does not effect the Body's rotation, but rotates\n * each of the shapes 'inside' of the Body.\n *\n * @param angle The angle to rotate shapes by in clockwise radians.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n */\n #if nape_swc@:keep #end\n public function rotateShapes(angle:Float){\n zpp_inner.immutable_midstep(\"Body::rotateShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.rotate(angle);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Scale each shape in local coordinates.\n *

\n * This operation does not affect the Body itself, but affects each\n * Shape 'inside' of the Body instead.\n *\n * @param scaleX The x-coordinate factor of scaling.\n * @param scaleY The y-coordinate factor of scaling.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If Body contains Circle shapes, and scaleX != scaleY\n */\n #if nape_swc@:keep #end\n public function scaleShapes(scaleX:Float,scaleY:Float){\n zpp_inner.immutable_midstep(\"Body::scaleShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.scale(scaleX,scaleY);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Transform each shape in local coordiantes.\n *

\n * This operation does not affect the Body itself, but affects each\n * Shape 'inside' of the Body instead.\n *\n * @param matrix The transformation matrix to apply to each Shape.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If matrix is null or singular.\n * @throws # If Body contains Circle shapes, and input matrix is\n * not equiorthogonal.\n */\n #if nape_swc@:keep #end\n public function transformShapes(matrix:Mat23){\n zpp_inner.immutable_midstep(\"Body::transformShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.transform(matrix);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Align rigid body so that its origin is also its centre of mass.\n *

\n * This operation will both translate the Shapes inside of the Body,\n * as well as translating the Body itself so that its 'apparent' position\n * has not been modified.\n *

\n * Alignment of Rigid bodies is necessary for dynamic bodies so that\n * they will interact and rotate as expected.\n *

\n * Simple Body's created with a single Polygon.box() or basic Circle\n * will already be aligned.\n *\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function align(){\n zpp_inner.immutable_midstep(\"Body::align()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty())throw \"Error: Cannot align empty Body\";\n #end\n zpp_inner.validate_localCOM();\n var dx=Vec2.get(-zpp_inner.localCOMx,-zpp_inner.localCOMy);\n translateShapes(dx);\n var dx2=localVectorToWorld(dx);\n position.subeq(dx2);\n if(zpp_inner.pre_posx
\n * Please note that this method is equivalent to teleporting the body,\n * the same way direct manipulation of position and rotation is.\n *\n * @param centre The centre of rotation in world coordinates.\n * @param angle The angle to rotate body by in clockwise radians.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If centre is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function rotate(centre:Vec2,angle:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(centre!=null&¢re.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(centre==null)throw \"Error: Cannot rotate about a null Vec2\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle))throw \"Error: Cannot rotate by NaN radians\";\n #end\n var weak=centre.zpp_inner.weak;\n centre.zpp_inner.weak=false;\n var del=position.sub(centre);\n del.rotate(angle);\n position=centre.add(del,true);\n del.dispose();\n rotation+=angle;\n centre.zpp_inner.weak=weak;\n ({\n if(({\n centre.zpp_inner.weak;\n })){\n centre.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Set material of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.material = material)\n *\n * @param material The material to set Shape's material to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeMaterials(material:Material){\n zpp_inner.immutable_midstep(\"Body::setShapeMaterials()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.material=material;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Set interaction filter of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.filter = filter)\n *\n * @param filter The filter to set Shape's filter to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeFilters(filter:InteractionFilter){\n zpp_inner.immutable_midstep(\"Body::setShapeFilters()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.filter=filter;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Set fluidProperties of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.fluidProperties = fluidProperties)\n *\n * @param fluidProperties The fluidProperties to set Shape's fluidProperties to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeFluidProperties(fluidProperties:FluidProperties){\n zpp_inner.immutable_midstep(\"Body::setShapeFluidProperties()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.fluidProperties=fluidProperties;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Local centre of mass of Body.\n *

\n * This value can be accessed even if Body has no shapes, but attempting\n * to query its values will result in a debug build error.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var localCOM(get_localCOM,never):Vec2;\n inline function get_localCOM():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no \"+\"localCOM\";\n #end\n if(zpp_inner.wrap_localCOM==null){\n zpp_inner.wrap_localCOM=Vec2.get(zpp_inner.localCOMx,zpp_inner.localCOMy);\n zpp_inner.wrap_localCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_localCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_localCOM.zpp_inner._validate=zpp_inner.getlocalCOM;\n }\n return zpp_inner.wrap_localCOM;\n }\n /**\n * World centre of mass of Body.\n *

\n * This value can be accessed even if Body has no shapes, but attempting\n * to query its values will result in a debug build error.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldCOM(get_worldCOM,never):Vec2;\n inline function get_worldCOM():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no \"+\"worldCOM\";\n #end\n if(zpp_inner.wrap_worldCOM==null){\n zpp_inner.wrap_worldCOM=Vec2.get(zpp_inner.worldCOMx,zpp_inner.worldCOMy);\n zpp_inner.wrap_worldCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_worldCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_worldCOM.zpp_inner._validate=zpp_inner.getworldCOM;\n }\n return zpp_inner.wrap_worldCOM;\n }\n /**\n * Evaluate sum effect of all normal contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.normalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all tangent contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.tangentImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function totalContactsImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.totalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all rolling friction contact impulses on Body.\n *





\n * Constraint impulses are not effected by the body argument.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered\n * when evaluating contact impulses.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type==ZPP_Arbiter.SENSOR)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n var imp=arb.wrapper().totalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n {\n var cx_ite=zpp_inner.constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n {\n if(con.active){\n var imp=con.outer.bodyImpulse(this);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Determine if point is contained in Body.\n *\n * @param point The point to test containment for in world coordinates.\n * @return True if point is contained.\n * @throws # If point is null or has been disposed.\n */\n #if nape_swc@:keep #end\n public function contains(point:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot check containment of null point\";\n #end\n var wasWeak=point.zpp_inner.weak;\n point.zpp_inner.weak=false;\n var retvar;\n {\n retvar=false;\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.outer.contains(point)){\n retvar=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n point.zpp_inner.weak=wasWeak;\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return retvar;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n return(zpp_inner.world?\"(space::world\":(\"(\"+(isDynamic()?\"dynamic\":isStatic()?\"static\":\"kinematic\")))+\")#\"+id;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass BodyIterator{\n /**\n * @private\n */\n public var zpp_inner:BodyList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:BodyIterator=null;\n /**\n * @private\n */\n public var zpp_next:BodyIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_BodyList.internal)throw \"Error: Cannot instantiate \"+\"Body\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:BodyList){\n var ret=if(zpp_pool==null){\n ZPP_BodyList.internal=true;\n var ret=new BodyIterator();\n ZPP_BodyList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Body = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Body = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Body = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass BodyList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_BodyList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Body\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new BodyList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Body)#else Std.is(i,Body)#end)throw \"Error: Array contains non \"+\"Body\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new BodyList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Body):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Body{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Body):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return BodyIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new BodyList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Body\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:BodyList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_BodyList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Body->Void):BodyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=BodyIterator.zpp_pool;\n BodyIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Body->Bool):BodyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This compound owns its constituents and works in the callback system and with\n * respect to adding/removing from a Space as a single object.\n *
\n *       ____Cmp1_____\n *      /    /    \   \\n * Body1 Body2--Joint Cmp2\n *   |     |        \  |\n * Shp1  Shp2        Body3\n *                     |\n *                    Shp3\n * 
\n * For example if you have a complex car built with several bodies and\n * constraints you might store this in a Compound providing an easy way\n * of removing/adding/copying the Car as well as being able to get a single\n * callback for when the car collides with something.\n *

\n * When you add a compound to a Space, all of it's constituents get added\n * and furthermore, those constituents cannot be added seperately.\n */\n@:final#if nape_swc@:keep #end\nclass Compound extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Compound=null;\n /**\n * List of bodies directly owned by this Compound.\n *

\n * This list does not include those bodies belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var bodies(get_bodies,never):BodyList;\n inline function get_bodies():BodyList{\n return zpp_inner.wrap_bodies;\n }\n /**\n * List of constraints directly owned by this Compound.\n *

\n * This list does not include those constraints belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n return zpp_inner.wrap_constraints;\n }\n /**\n * List of compounds directly owned by this Compound.\n *

\n * This list does not include those compounds belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var compounds(get_compounds,never):CompoundList;\n inline function get_compounds():CompoundList{\n return zpp_inner.wrap_compounds;\n }\n /**\n * Compound that this compound belongs to.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n zpp_inner.immutable_midstep(\"Compound::compound\");\n if(this.compound!=compound){\n if(this.compound!=null)this.compound.compounds.remove(this);\n if(compound!=null)compound.compounds.add(this);\n }\n }\n return get_compound();\n }\n /**\n * Space this compound belongs to.\n *

\n * This value is immutable when this compound belongs to another parent Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null)throw \"Error: Cannot set the space of an inner Compound, only the root Compound space can be set\";\n #end\n zpp_inner.immutable_midstep(\"Compound::space\");\n if(this.space!=space){\n if(this.space!=null)this.space.compounds.remove(this);\n if(space!=null)space.compounds.add(this);\n }\n }\n return get_space();\n }\n /**\n * Construct a new Compound.\n *\n * @result The constructed Compound.\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner=new ZPP_Compound();\n zpp_inner.outer=this;\n zpp_inner.outer_i=this;\n zpp_inner_i=zpp_inner;\n zpp_inner.insert_cbtype(CbType.ANY_COMPOUND.zpp_inner);\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n return \"Compound\"+this.id;\n }\n /**\n * Produce an exact copy of this Compound.\n *

\n * This copy will remap owned constraints so that their body properties\n * refer to the newly copied bodies also owned by this compound.\n *

\n * If this compound tree contains any constraints that make references\n * to outside of this compound; then these properties will be made null.\n *
\n     *       ____Cmp1____               [Cmp2.copy()]\n     *      /    /        \\n     * Body1 Body2___     Cmp2        null    Cmp2'\n     *   |     |     \     /  \         \    /    \\n     * Shp1  Shp2     Joint--Body3       Joint'--Body3'\n     *                         |                   |\n     *                        Shp3               Shp3'\n     * 
\n * For instance if copying Cmp1 then all is well, but if we copy Cmp2 the\n * copied Joint will have one of it's body references null as that body is\n * not owned directly, or indirectly by the compound.\n */\n public function copy(){\n return zpp_inner.copy();\n }\n /**\n * Breaking compound apart in-place.\n *

\n * This method will destroy the compound, moving all of it's components\n * to the assigned Space if this is the root compound, otherwise to the\n * parent compound.\n *

\n * Apart from being easier than doing this manually it also means that we\n * do not have to temporarigly remove objects from the space meaning that\n * things like PreListener ignored interactions will be unaffected.\n */\n public function breakApart(){\n zpp_inner.breakApart();\n }\n /**\n * Method to iterate over all bodies contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitBodies\";\n #end\n for(b in bodies)lambda(b);\n for(c in compounds)c.visitBodies(lambda);\n }\n /**\n * Method to iterate over all constraints contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Constraint.\n * @throws # If lambda is null.\n */\n public function visitConstraints(lambda:Constraint->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitConstraints\";\n #end\n for(c in constraints)lambda(c);\n for(c in compounds)c.visitConstraints(lambda);\n }\n /**\n * Method to iterate over all compounds contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Compound.\n * @throws # If lambda is null.\n */\n public function visitCompounds(lambda:Compound->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitConstraints\";\n #end\n for(c in compounds){\n lambda(c);\n c.visitCompounds(lambda);\n }\n }\n /**\n * Compute centre of mass of Compound.\n *\n * @param weak If true, the returned Vec2 will be automatically released\n * to the object pool when passed as an argument to a Nape\n * function. (default false)\n * @return The centre of mass of compound.\n * @throws # If Compound has no Bodies contained directly or indirectly\n * that contain at least one Shape.\n */\n public function COM(weak:Bool=false){\n var ret=Vec2.get(0,0,weak);\n var total=0.0;\n visitBodies(function(b){\n if(!b.shapes.empty()){\n ret.addeq(b.worldCOM.mul(b.mass,true));\n total+=b.mass;\n }\n });\n #if(!NAPE_RELEASE_BUILD)\n if(total==0.0)throw \"Error: COM of an empty Compound is undefined silly\";\n #end\n ret.muleq(1/total);\n return ret;\n }\n /**\n * Translate entire compound.\n *

\n * This is equivalent to: compound.visitBodies(function (b) b.translate(translation))\n *\n * @param translation The translation to apply to the Compound.\n * @return A reference to this Compound.\n * @throws # If translation is null or disposed of.\n * @throws # If any Body in the compound is static, and this compound is in a Space.\n */\n public function translate(translation:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(translation==null)throw \"Error: Cannot translate by null Vec2\";\n #end\n var weak=translation.zpp_inner.weak;\n translation.zpp_inner.weak=false;\n visitBodies(function(b)b.position.addeq(translation));\n translation.zpp_inner.weak=weak;\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Rotate entire compound about a point.\n *

\n * This is equivalent to: compound.visitBodies(function (b) b.rotate(centre, angle))\n *\n * @param centre The centre of rotation in world coordinates.\n * @param angle The clockwise angle of rotation in radians.\n * @return A reference to this Compound.\n * @throws # If centre is null or disposed of.\n * @throws # If any Body in the compound is static, and this compound is in a Space.\n */\n public function rotate(centre:Vec2,angle:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(centre!=null&¢re.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(centre==null)throw \"Error: Cannot rotate about a null Vec2\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle))throw \"Error: Cannot rotate by NaN radians\";\n #end\n var weak=centre.zpp_inner.weak;\n centre.zpp_inner.weak=false;\n visitBodies(function(b)b.rotate(centre,angle));\n centre.zpp_inner.weak=weak;\n ({\n if(({\n centre.zpp_inner.weak;\n })){\n centre.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CompoundIterator{\n /**\n * @private\n */\n public var zpp_inner:CompoundList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:CompoundIterator=null;\n /**\n * @private\n */\n public var zpp_next:CompoundIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_CompoundList.internal)throw \"Error: Cannot instantiate \"+\"Compound\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:CompoundList){\n var ret=if(zpp_pool==null){\n ZPP_CompoundList.internal=true;\n var ret=new CompoundIterator();\n ZPP_CompoundList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Compound = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Compound = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Compound = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CompoundList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CompoundList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Compound\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new CompoundList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Compound)#else Std.is(i,Compound)#end)throw \"Error: Array contains non \"+\"Compound\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new CompoundList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Compound):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Compound{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Compound{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Compound{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Compound):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return CompoundIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new CompoundList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Compound\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:CompoundList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_CompoundList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Compound->Void):CompoundList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=CompoundIterator.zpp_pool;\n CompoundIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Compound->Bool):CompoundList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Construct a new FluidProperties objects.\n *\n * @param density The density of the fluid in g/px/px. (default 1)\n * @param viscosity The viscosity of the fluid for drag computations in kg/px/s\n * (default 1)\n * @return The constructed FluidProperties object.\n */\n public function new(density:Float=1,viscosity:Float=1){\n {\n if(ZPP_FluidProperties.zpp_pool==null){\n zpp_inner=new ZPP_FluidProperties();\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_TOT++;\n ZPP_FluidProperties.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT--;\n ZPP_FluidProperties.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.density=density;\n this.viscosity=viscosity;\n }\n /**\n * Produce a copy of this FluidProperties object.\n *

\n * The copied object will be identical in all properties with the the\n * copied userData being assigned the same fields as 'this' Shape with the\n * same values copied over by reference for object types.\n *\n * @return The copied FluidProperties.\n */\n #if nape_swc@:keep #end\n public function copy(){\n var ret=new FluidProperties(density,viscosity);\n if(zpp_inner.userData!=null)ret.zpp_inner.userData=Reflect.copy(zpp_inner.userData);\n ret.gravity=this.gravity;\n return ret;\n }\n /**\n * Density of fluid.\n *

\n * This value, like Material density is of g/pixel/pixel.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var density(get_density,set_density):Float;\n inline function get_density():Float{\n return zpp_inner.density*(\"density\"==\"density\"?1000:1);\n }\n inline function set_density(density:Float):Float{\n {\n if(density!=this.density){\n #if(!NAPE_RELEASE_BUILD)\n if((density!=density))throw \"Error: FluidProperties::\"+\"density\"+\" cannot be NaN\";\n if(\"density\"!=\"density\"&&density<0)throw \"Error: FluidProperties::\"+\"density\"+\" (\"+density+\") must be >= 0\";\n #end\n zpp_inner.density=density/(\"density\"==\"density\"?1000:1);\n zpp_inner.invalidate();\n }\n }\n return get_density();\n }\n /**\n * Viscosity of fluid.\n *

\n * This value is used in drag comutations, the higher the viscosity the\n * more quickly objects will come to rest in the fluid.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var viscosity(get_viscosity,set_viscosity):Float;\n inline function get_viscosity():Float{\n return zpp_inner.viscosity*(\"viscosity\"==\"density\"?1000:1);\n }\n inline function set_viscosity(viscosity:Float):Float{\n {\n if(viscosity!=this.viscosity){\n #if(!NAPE_RELEASE_BUILD)\n if((viscosity!=viscosity))throw \"Error: FluidProperties::\"+\"viscosity\"+\" cannot be NaN\";\n if(\"viscosity\"!=\"density\"&&viscosity<0)throw \"Error: FluidProperties::\"+\"viscosity\"+\" (\"+viscosity+\") must be >= 0\";\n #end\n zpp_inner.viscosity=viscosity/(\"viscosity\"==\"density\"?1000:1);\n zpp_inner.invalidate();\n }\n }\n return get_viscosity();\n }\n /**\n * Local gravity for buoyancy computations.\n *

\n * When this value is not null, it will be used in place of the Space gravity\n * when performing buoyancy computations.\n */\n #if nape_swc@:isVar #end\n public var gravity(get_gravity,set_gravity):Null;\n inline function get_gravity():Null{\n return zpp_inner.wrap_gravity;\n }\n inline function set_gravity(gravity:Null):Null{\n {\n if(gravity==null){\n if(zpp_inner.wrap_gravity!=null){\n zpp_inner.wrap_gravity.zpp_inner._inuse=false;\n zpp_inner.wrap_gravity.dispose();\n zpp_inner.wrap_gravity=null;\n }\n }\n else{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(zpp_inner.wrap_gravity==null)zpp_inner.getgravity();\n this.gravity.set(gravity);\n }\n }\n return get_gravity();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"{ density: \"+density+\" viscosity: \"+viscosity+\" gravity: \"+gravity+\" }\";\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of GravMassMode values for a Body.\n */\n@:final#if nape_swc@:keep #end\nclass GravMassMode{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"GravMassMode\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==DEFAULT)return\"DEFAULT\";\n else if(this==FIXED)return\"FIXED\";\n else if(this==SCALED)return\"SCALED\";\n else return \"\";\n }\n /**\n * Default method of computation.\n *

\n * Mass seen by gravity equal to the Body mass.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):GravMassMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.GravMassMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_DEFAULT=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Mass seen by gravity set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):GravMassMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.GravMassMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_FIXED=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_FIXED;\n }\n /**\n * Scaled method of computation.\n *

\n * Mass seen by gravity computed as a factor of the Body mass with\n * scaling factor set by user.\n */\n #if nape_swc@:isVar #end\n public static var SCALED(get_SCALED,never):GravMassMode;\n inline static function get_SCALED(){\n if(ZPP_Flags.GravMassMode_SCALED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_SCALED=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_SCALED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of InertiaMode values for a Body.\n */\n@:final#if nape_swc@:keep #end\nclass InertiaMode{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"InertiaMode\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==DEFAULT)return\"DEFAULT\";\n else if(this==FIXED)return\"FIXED\";\n else return \"\";\n }\n /**\n * Default method of computation.\n *

\n * Moment of inertia will be computed based on Body's Shape's inertias and densities.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):InertiaMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.InertiaMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InertiaMode_DEFAULT=new InertiaMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InertiaMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Moment of inertia set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):InertiaMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.InertiaMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InertiaMode_FIXED=new InertiaMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InertiaMode_FIXED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractorIterator{\n /**\n * @private\n */\n public var zpp_inner:InteractorList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:InteractorIterator=null;\n /**\n * @private\n */\n public var zpp_next:InteractorIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_InteractorList.internal)throw \"Error: Cannot instantiate \"+\"Interactor\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:InteractorList){\n var ret=if(zpp_pool==null){\n ZPP_InteractorList.internal=true;\n var ret=new InteractorIterator();\n ZPP_InteractorList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Interactor = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Interactor = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Interactor = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractorList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractorList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Interactor\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new InteractorList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Interactor)#else Std.is(i,Interactor)#end)throw \"Error: Array contains non \"+\"Interactor\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new InteractorList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Interactor):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner_i);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Interactor{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner_i);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner_i);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner_i);\n }\n else zpp_inner.inner.add(obj.zpp_inner_i);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Interactor{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer_i;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Interactor{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer_i;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Interactor):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner_i){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner_i);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return InteractorIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new InteractorList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Interactor\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:InteractorList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_InteractorList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Interactor->Void):InteractorList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=InteractorIterator.zpp_pool;\n InteractorIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Interactor->Bool):InteractorList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Mass will be computed based on Body's Shape's areas and densities.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):MassMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.MassMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.MassMode_DEFAULT=new MassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.MassMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Mass set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):MassMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.MassMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.MassMode_FIXED=new MassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.MassMode_FIXED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Material property providing physical attributes to a Shape.\n */\n@:final#if nape_swc@:keep #end\nclass Material{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Material=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Construct a new Material object.\n *\n * @param elasticity The coeffecient of elasticity for material.\n * (default 0.0)\n * @param dynamicFriction The coeffecient of dynamic friction for\n * material. (default 1.0)\n * @param staticFriction The coeffecient of static friction for\n * material. (default 2.0)\n * @param density The density of the shape using this material in units\n * of g/pixel/pixel. (default 1.0)\n * @param rollingFriction The coeffecient of rolling friction for material\n * used in circle friction computations. (default 0.001)\n * @return The constructed Material object.\n */\n public function new(elasticity:Float=0.0,dynamicFriction:Float=1.0,staticFriction:Float=2.0,density:Float=1,rollingFriction:Float=0.001){\n {\n if(ZPP_Material.zpp_pool==null){\n zpp_inner=new ZPP_Material();\n #if NAPE_POOL_STATS ZPP_Material.POOL_TOT++;\n ZPP_Material.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT--;\n ZPP_Material.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.elasticity=elasticity;\n this.dynamicFriction=dynamicFriction;\n this.staticFriction=staticFriction;\n this.density=density;\n this.rollingFriction=rollingFriction;\n }\n /**\n * Produce a copy of this Material object.\n *

\n * The copied object will be identical in all properties with the the\n * copied userData being assigned the same fields as 'this' Shape with the\n * same values copied over by reference for object types.\n *\n * @return The copied Material.\n */\n #if nape_swc@:keep #end\n public function copy(){\n var ret=new Material(elasticity,dynamicFriction,staticFriction,density,rollingFriction);\n if(zpp_inner.userData!=null)ret.zpp_inner.userData=Reflect.copy(zpp_inner.userData);\n return ret;\n }\n /**\n * Elasticity of material.\n *

\n * This property may take any value. Coeffecients of elasticity are combined\n * by taking their average, and then clamping to the range [0,1]. In this way\n * you may give very large values (even infinites) to this property to bias\n * the result of combining elasticities.\n *

\n * A combined, clamped value of 0 results in no bouncing whatsoever.\n *
\n * A combine, clamped value of 1 results in complete elasticity where if\n * possible, the objects will not lose any energy at all.\n *\n * @default 0.0\n */\n #if nape_swc@:isVar #end\n public var elasticity(get_elasticity,set_elasticity):Float;\n inline function get_elasticity():Float{\n return zpp_inner.elasticity*(\"elasticity\"==\"density\"?1000:1);\n }\n inline function set_elasticity(elasticity:Float):Float{\n {\n if(elasticity!=this.elasticity){\n #if(!NAPE_RELEASE_BUILD)\n if((elasticity!=elasticity))throw \"Error: Material::\"+\"elasticity\"+\" cannot be NaN\";\n if(\"elasticity\"==\"density\"&&elasticity<0)throw \"Error: Material::density must be positive\";\n if(\"elasticity\"!=\"elasticity\"&&elasticity<0)throw \"Error: Material::\"+\"elasticity\"+\" cannot be negative\";\n #end\n zpp_inner.elasticity=elasticity/(\"elasticity\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_elasticity();\n }\n /**\n * Coeffecient of dynamic friction for material.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * dynamicFriction are combined by taking the square root of their product.\n *

\n * The higher this value the more quickly objects will slow down from speed\n * when sliding.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var dynamicFriction(get_dynamicFriction,set_dynamicFriction):Float;\n inline function get_dynamicFriction():Float{\n return zpp_inner.dynamicFriction*(\"dynamicFriction\"==\"density\"?1000:1);\n }\n inline function set_dynamicFriction(dynamicFriction:Float):Float{\n {\n if(dynamicFriction!=this.dynamicFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((dynamicFriction!=dynamicFriction))throw \"Error: Material::\"+\"dynamicFriction\"+\" cannot be NaN\";\n if(\"dynamicFriction\"==\"density\"&&dynamicFriction<0)throw \"Error: Material::density must be positive\";\n if(\"dynamicFriction\"!=\"elasticity\"&&dynamicFriction<0)throw \"Error: Material::\"+\"dynamicFriction\"+\" cannot be negative\";\n #end\n zpp_inner.dynamicFriction=dynamicFriction/(\"dynamicFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ANGDRAG|ZPP_Material.ARBITERS);\n }\n }\n return get_dynamicFriction();\n }\n /**\n * Coeffecient of static friction for material.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * staticFriction are combined by taking the square root of their product.\n *

\n * The higher this value the more quickly objects will come to rest once moving\n * very slowly, and the harder it will be to cause the objcet to begin to slide.\n *\n * @default 2\n */\n #if nape_swc@:isVar #end\n public var staticFriction(get_staticFriction,set_staticFriction):Float;\n inline function get_staticFriction():Float{\n return zpp_inner.staticFriction*(\"staticFriction\"==\"density\"?1000:1);\n }\n inline function set_staticFriction(staticFriction:Float):Float{\n {\n if(staticFriction!=this.staticFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((staticFriction!=staticFriction))throw \"Error: Material::\"+\"staticFriction\"+\" cannot be NaN\";\n if(\"staticFriction\"==\"density\"&&staticFriction<0)throw \"Error: Material::density must be positive\";\n if(\"staticFriction\"!=\"elasticity\"&&staticFriction<0)throw \"Error: Material::\"+\"staticFriction\"+\" cannot be negative\";\n #end\n zpp_inner.staticFriction=staticFriction/(\"staticFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_staticFriction();\n }\n /**\n * Density of Shape's using this Material.\n *

\n * This property has units of g/pixel/pixel, not Kg/pixel/pixel for the\n * simple reason that we get more reasonable values like 1 instead of 0.001\n * to attain reasonable mass values for Bodys.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var density(get_density,set_density):Float;\n inline function get_density():Float{\n return zpp_inner.density*(\"density\"==\"density\"?1000:1);\n }\n inline function set_density(density:Float):Float{\n {\n if(density!=this.density){\n #if(!NAPE_RELEASE_BUILD)\n if((density!=density))throw \"Error: Material::\"+\"density\"+\" cannot be NaN\";\n if(\"density\"==\"density\"&&density<0)throw \"Error: Material::density must be positive\";\n if(\"density\"!=\"elasticity\"&&density<0)throw \"Error: Material::\"+\"density\"+\" cannot be negative\";\n #end\n zpp_inner.density=density/(\"density\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.PROPS);\n }\n }\n return get_density();\n }\n /**\n * Coeffecient of rolling friction for circle interactions.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * staticFriction are combined by taking the square root of their product.\n *

\n * The higher this value, the more quickly a rolling circle - which would\n * otherwise roll forever ignoring drag and numerical issues - will come to\n * rest.\n *\n * @default 0.01\n */\n #if nape_swc@:isVar #end\n public var rollingFriction(get_rollingFriction,set_rollingFriction):Float;\n inline function get_rollingFriction():Float{\n return zpp_inner.rollingFriction*(\"rollingFriction\"==\"density\"?1000:1);\n }\n inline function set_rollingFriction(rollingFriction:Float):Float{\n {\n if(rollingFriction!=this.rollingFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((rollingFriction!=rollingFriction))throw \"Error: Material::\"+\"rollingFriction\"+\" cannot be NaN\";\n if(\"rollingFriction\"==\"density\"&&rollingFriction<0)throw \"Error: Material::density must be positive\";\n if(\"rollingFriction\"!=\"elasticity\"&&rollingFriction<0)throw \"Error: Material::\"+\"rollingFriction\"+\" cannot be negative\";\n #end\n zpp_inner.rollingFriction=rollingFriction/(\"rollingFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_rollingFriction();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"{ elasticity: \"+elasticity+\" dynamicFriction: \"+dynamicFriction+\" staticFriction: \"+staticFriction+\" density: \"+density+\" rollingFriction: \"+rollingFriction+\" }\";\n }\n /**\n * Predefined constructor for a wood style Material.\n *\n * @return new Material(0.4,0.2,0.38,0.7,0.005)\n */\n #if nape_swc@:keep #end\n public static function wood(){\n return new Material(0.4,0.2,0.38,0.7,0.005);\n }\n /**\n * Predefined constructor for a steel style Material.\n *\n * @return new Material(0.2,0.57,0.74,7.8,0.001)\n */\n #if nape_swc@:keep #end\n public static function steel(){\n return new Material(0.2,0.57,0.74,7.8,0.001);\n }\n /**\n * Predefined constructor for a ice style Material.\n *\n * @return new Material(0.3,0.03,0.1,0.9,0.0001)\n */\n #if nape_swc@:keep #end\n public static function ice(){\n return new Material(0.3,0.03,0.1,0.9,0.0001);\n }\n /**\n * Predefined constructor for a rubber style Material.\n *\n * @return new Material(0.8,1.0,1.4,1.5,0.01)\n */\n #if nape_swc@:keep #end\n public static function rubber(){\n return new Material(0.8,1.0,1.4,1.5,0.01);\n }\n /**\n * Predefined constructor for a glass style Material.\n *\n * @return new Material(0.4,0.4,0.94,2.6,0.002)\n */\n #if nape_swc@:keep #end\n public static function glass(){\n return new Material(0.4,0.4,0.94,2.6,0.002);\n }\n /**\n * Predefined constructor for a sand style Material.\n *\n * @return new Material(-1.0,0.45,0.6,1.6,16.0)\n */\n #if nape_swc@:keep #end\n public static function sand(){\n return new Material(-1.0,0.45,0.6,1.6,16.0);\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for Nape Shape's\n */\n#if nape_swc@:keep #end\nclass Shape extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Shape=null;\n /**\n * Type of shape.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ShapeType;\n inline function get_type():ShapeType{\n return ZPP_Shape.types[zpp_inner.type];\n }\n /**\n * Faster equivalent to type == ShapeType.CIRCLE\n *\n * @return True if shape is a Circle type.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isCircle(){\n return zpp_inner.isCircle();\n }\n /**\n * Faster equivalent to type == ShapeType.POLYGON\n *\n * @return True if shape is a Polygon type.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isPolygon(){\n return zpp_inner.isPolygon();\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n function new(){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Shape cannot be instantiated derp!\";\n #end\n }\n /**\n * Body this Shape is assigned to.\n *

\n * This value can be set to add Shape to the given Body, and set to null\n * to remove it from its present Body.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var body(get_body,set_body):Null;\n inline function get_body():Null{\n return if(zpp_inner.body!=null)zpp_inner.body.outer else null;\n }\n inline function set_body(body:Null):Null{\n {\n zpp_inner.immutable_midstep(\"Shape::body\");\n if(this.body!=body){\n if(zpp_inner.body!=null)this.body.shapes.remove(this);\n if(body!=null)body.shapes.add(this);\n }\n }\n return get_body();\n }\n /**\n * Faster equivalent to casting this to Circle type\n */\n #if nape_swc@:isVar #end\n public var castCircle(get_castCircle,never):Null;\n inline function get_castCircle():Null{\n return if(isCircle())zpp_inner.circle.outer_zn else null;\n }\n /**\n * Faster equivalent to casting this to Polygon type\n */\n #if nape_swc@:isVar #end\n public var castPolygon(get_castPolygon,never):Null;\n inline function get_castPolygon():Null{\n return if(isPolygon())zpp_inner.polygon.outer_zn else null;\n }\n /**\n * World space centre of mass of this Shape.\n *

\n * This value can be accessed even if Shape is not in a Body, but\n * attempting to query the values of it will return an error in debug\n * builds unless the Shape is in a Body.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldCOM(get_worldCOM,never):Vec2;\n inline function get_worldCOM():Vec2{\n if(zpp_inner.wrap_worldCOM==null){\n zpp_inner.wrap_worldCOM=Vec2.get(zpp_inner.worldCOMx,zpp_inner.worldCOMy);\n zpp_inner.wrap_worldCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_worldCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_worldCOM.zpp_inner._validate=zpp_inner.getworldCOM;\n }\n return zpp_inner.wrap_worldCOM;\n }\n /**\n * Local space centre of mass of this Shape.\n *

\n * This Vec2 can be set and is equivalent to performing the necessary\n * translation of the Shape in local coordinates, and also equivalent\n * to this.localCOM.set(value).\n *
\n * Setting this value whilst this shape is part of a static Body that\n * is part of a Space is not permitted.\n */\n #if nape_swc@:isVar #end\n public var localCOM(get_localCOM,set_localCOM):Vec2;\n inline function get_localCOM():Vec2{\n if(zpp_inner.wrap_localCOM==null){\n if(isCircle())zpp_inner.circle.setupLocalCOM();\n else zpp_inner.polygon.setupLocalCOM();\n }\n return zpp_inner.wrap_localCOM;\n }\n inline function set_localCOM(localCOM:Vec2):Vec2{\n {\n zpp_inner.immutable_midstep(\"Body::localCOM\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(localCOM!=null&&localCOM.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(localCOM==null)throw \"Error: Shape::localCOM cannot be null\";\n #end\n this.localCOM.set(localCOM);\n }\n return get_localCOM();\n }\n /**\n * Area of the Hhape.\n */\n #if nape_swc@:isVar #end\n public var area(get_area,never):Float;\n inline function get_area():Float{\n zpp_inner.validate_area_inertia();\n return zpp_inner.area;\n }\n /**\n * Non-mass weighted moment of inertia for Shape.\n */\n #if nape_swc@:isVar #end\n public var inertia(get_inertia,never):Float;\n inline function get_inertia():Float{\n zpp_inner.validate_area_inertia();\n return zpp_inner.inertia;\n }\n /**\n * Coeffecient of angular fluid drag for this Shape.\n */\n #if nape_swc@:isVar #end\n public var angDrag(get_angDrag,never):Float;\n inline function get_angDrag():Float{\n zpp_inner.validate_angDrag();\n return zpp_inner.angDrag;\n }\n /**\n * Material used by this shape.\n *\n * @default new Material()\n */\n #if nape_swc@:isVar #end\n public var material(get_material,set_material):Material;\n inline function get_material():Material{\n return zpp_inner.material.wrapper();\n }\n inline function set_material(material:Material):Material{\n {\n zpp_inner.immutable_midstep(\"Shape::material\");\n #if(!NAPE_RELEASE_BUILD)\n if(material==null)throw \"Error: Cannot assign null as Shape material\";\n #end\n zpp_inner.setMaterial(material.zpp_inner);\n }\n return get_material();\n }\n /**\n * InteractionFilter used by this shape.\n *\n * @default new InteractionFilter()\n */\n #if nape_swc@:isVar #end\n public var filter(get_filter,set_filter):InteractionFilter;\n inline function get_filter():InteractionFilter{\n return zpp_inner.filter.wrapper();\n }\n inline function set_filter(filter:InteractionFilter):InteractionFilter{\n {\n zpp_inner.immutable_midstep(\"Shape::filter\");\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: Cannot assign null as Shape filter\";\n #end\n zpp_inner.setFilter(filter.zpp_inner);\n }\n return get_filter();\n }\n /**\n * FluidProperties used by this shape.\n *

\n * This object provides information for buoyancy and fluid drag computations\n * when this shape is interacting as a fluid.\n *\n * @default new FluidProperties();\n */\n #if nape_swc@:isVar #end\n public var fluidProperties(get_fluidProperties,set_fluidProperties):FluidProperties;\n inline function get_fluidProperties():FluidProperties{\n zpp_inner.immutable_midstep(\"Shape::fluidProperties\");\n if(zpp_inner.fluidProperties==null)zpp_inner.setFluid(new FluidProperties().zpp_inner);\n return zpp_inner.fluidProperties.wrapper();\n }\n inline function set_fluidProperties(fluidProperties:FluidProperties):FluidProperties{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(fluidProperties==null)throw \"Error: Cannot assign null as Shape fluidProperties, disable fluids by setting fluidEnabled to false\";\n #end\n zpp_inner.setFluid(fluidProperties.zpp_inner);\n }\n return get_fluidProperties();\n }\n /**\n * Whether this shape is able to interact as a fluid.\n *

\n * Unless this field is true, this Shape can never interact as a fluid.\n *

\n * Just because this field is true however, does not mean this shape will always\n * interact as a fluid, the final result is down to the combination of\n * InteractionFilters on the pairing of shapes and sensory interaction\n * takes higher priority.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var fluidEnabled(get_fluidEnabled,set_fluidEnabled):Bool;\n inline function get_fluidEnabled():Bool{\n return zpp_inner.fluidEnabled;\n }\n inline function set_fluidEnabled(fluidEnabled:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Shape::fluidEnabled\");\n zpp_inner.fluidEnabled=fluidEnabled;\n if(fluidEnabled&&zpp_inner.fluidProperties==null)this.fluidProperties=new FluidProperties();\n zpp_inner.wake();\n }\n return get_fluidEnabled();\n }\n /**\n * Whether this shape is able to interact as sensor.\n *

\n * Unless this field is true, this Shape can never interact as a sensor.\n *

\n * Just because this field is true however, does not mean this shape will always\n * interact as a sensor, the final result is down to the combination of\n * InteractionFilters on the pairing of shapes. Sensor interaction has highest priority.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var sensorEnabled(get_sensorEnabled,set_sensorEnabled):Bool;\n inline function get_sensorEnabled():Bool{\n return zpp_inner.sensorEnabled;\n }\n inline function set_sensorEnabled(sensorEnabled:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Shape::sensorEnabled\");\n zpp_inner.sensorEnabled=sensorEnabled;\n zpp_inner.wake();\n }\n return get_sensorEnabled();\n }\n /**\n * World space bounding box for this shape.\n *

\n * This value can be accessed even if the Shape is not part of a Body,\n * however attempting to query its values would result in an error in\n * debug builds.\n *

\n * This AABB is immutable.\n */\n #if nape_swc@:isVar #end\n public var bounds(get_bounds,never):AABB;\n inline function get_bounds():AABB{\n return zpp_inner.aabb.wrapper();\n }\n /**\n * Translate this shape in its local coordinate system.\n *

\n * This is equivalent to: shape.localCOM.addeq(displacement)\n *\n * @param translation The local translation to apply to Shape.\n * @return A reference to 'this' Shape.\n * @throws # If translation is null or has been disposed of.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function translate(translation:Vec2){\n zpp_inner.immutable_midstep(\"Shape::translate()\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(translation==null)throw \"Error: Cannot displace Shape by null Vec2\";\n #end\n if(translation.lsq()>0){\n if(isCircle())zpp_inner.circle.__translate(translation.x,translation.y);\n else zpp_inner.polygon.__translate(translation.x,translation.y);\n }\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Scale this shape in its local coordinate system.\n *

\n * For Circle shapes, scalex and scaley must be exactly equal.\n *\n * @param scalex The x-coordinate scaling to apply to Shape.\n * @param scaley The y-coordinate scaling to apply to Shape.\n * @return A reference to 'this' Shape.\n * @throws # If this shape is part of a static body that is inside of a Space.\n * @throws # If scalex or scaley is 0. Negative values 'are' permitted.\n */\n #if nape_swc@:keep #end\n public function scale(scalex:Float,scaley:Float){\n zpp_inner.immutable_midstep(\"Shape::scale()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if((scalex!=scalex)||(scaley!=scaley))throw \"Error: Cannot scale Shape by NaN\";\n if(scalex==0||scaley==0)throw \"Error: Cannot Scale shape by a factor of 0\";\n #end\n if(isCircle()){\n var d=scalex*scalex-scaley*scaley;\n if(d*d<(Config.epsilon*Config.epsilon)){\n zpp_inner.circle.__scale(scalex,scaley);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot perform a non equal scaling on a Circle\";\n #end\n }\n }\n else zpp_inner.polygon.__scale(scalex,scaley);\n return this;\n }\n /**\n * Rotate this shape in its local coordinate system.\n *\n * @param angle The number of radians to rotate this Shape by in a clockwise\n * direction.\n * @return A reference to 'this' Shape.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function rotate(angle:Float){\n zpp_inner.immutable_midstep(\"Shape::rotate()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if((angle!=angle))throw \"Error: Cannot rotate Shape by NaN\";\n #end\n var dr=angle%(2*Math.PI);\n if(dr!=0.0){\n var cos=Math.cos(angle);\n var sin=Math.sin(angle);\n if(isCircle())zpp_inner.circle.__rotate(sin,cos);\n else zpp_inner.polygon.__rotate(sin,cos);\n }\n return this;\n }\n /**\n * Apply local transformation matrix to Shape.\n *

\n * For Circle shapes, the matrix must be equiorthogonal.\n *\n * @param matrix The matrix to transform Shape by.\n * @return A reference to 'this' Shape.\n * @throws # If matrix is null or singular.\n * @throws # If shape is a Circle, and matrix is not equiorthogonal.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function transform(matrix:Mat23){\n zpp_inner.immutable_midstep(\"Shape::transform()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(matrix==null)throw \"Error: Cannot transform Shape by null matrix\";\n if(matrix.singular())throw \"Error: Cannot transform Shape by a singular matrix\";\n #end\n if(isCircle()){\n if(matrix.equiorthogonal()){\n zpp_inner.circle.__transform(matrix);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot transform Circle by a non equiorthogonal matrix\";\n #end\n }\n }\n else zpp_inner.polygon.__transform(matrix);\n return this;\n }\n /**\n * Test containment of world-space coordinate in Shape.\n *

\n * This Shape must be part of a Body so that world coordinates are\n * defined.\n *\n * @param point The point to check for containment.\n * @return True if point is contained within the Shape.\n * @throws If point is null or disposed of.\n * @throws If this shape is not part of a Body.\n */\n #if nape_swc@:keep #end\n public function contains(point:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Cannot check null point for containment\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Shape is not well defined without a Body\";\n #end\n ZPP_Geom.validateShape(zpp_inner);\n point.zpp_inner.validate();\n var ret=ZPP_Collide.shapeContains(zpp_inner,point.zpp_inner);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Produce an exact copy of this Shape.\n *

\n * The copied shape will be identical with the copied Shape's userData\n * object being assigned the same fields as 'this' Shape with the same\n * values copied over by reference for object types.\n *\n * @return A copy of this shape.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return zpp_inner.copy();\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=isCircle()?\"Circle\":\"Polygon\";\n return ret+\"#\"+id;\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Shape subtype representing a Circle\n */\n@:final#if nape_swc@:keep #end\nclass Circle extends Shape{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_Circle=null;\n /**\n * Construct a new Circle\n *\n * @param radius The radius of the circle, this value must be positive.\n * @param localCOM The local offset for the circle. (default (0,0))\n * @param material The material for this circle. (default new Material())\n * @param filter The interaction filter for this circle.\n * (default new InteractionFilter())\n * @return The constructed Circle\n * @throws # If radius is not strictly positive\n * @throws # If localCOM is non-null, but has been disposed of.\n */\n #if flib@:keep function flibopts_3(){}\n #end\n public function new(radius:Float,localCOM:Vec2=null,material:Material=null,filter:InteractionFilter=null){\n #if(!NAPE_RELEASE_BUILD)\n Shape.zpp_internalAlloc=true;\n super();\n Shape.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner_zn=new ZPP_Circle();\n zpp_inner_zn.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner=zpp_inner_zn;\n zpp_inner_i=zpp_inner;\n zpp_inner_i.outer_i=this;\n this.radius=radius;\n if(localCOM==null){\n zpp_inner.localCOMx=0;\n zpp_inner.localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMx!=zpp_inner.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMy!=zpp_inner.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n else{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(localCOM!=null&&localCOM.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.localCOMx=localCOM.x;\n zpp_inner.localCOMy=localCOM.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMx!=zpp_inner.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"localCOM.x\"+\",in y: \"+\"localCOM.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMy!=zpp_inner.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"localCOM.x\"+\",in y: \"+\"localCOM.y\"+\")\");\n #end\n };\n };\n ({\n if(({\n localCOM.zpp_inner.weak;\n })){\n localCOM.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n if(material==null){\n if(ZPP_Material.zpp_pool==null){\n zpp_inner.material=new ZPP_Material();\n #if NAPE_POOL_STATS ZPP_Material.POOL_TOT++;\n ZPP_Material.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner.material=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=zpp_inner.material.next;\n zpp_inner.material.next=null;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT--;\n ZPP_Material.POOL_ADD++;\n #end\n }\n zpp_inner.material.alloc();\n };\n else this.material=material;\n if(filter==null){\n if(ZPP_InteractionFilter.zpp_pool==null){\n zpp_inner.filter=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner.filter=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=zpp_inner.filter.next;\n zpp_inner.filter.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n zpp_inner.filter.alloc();\n };\n else this.filter=filter;\n zpp_inner_i.insert_cbtype(CbType.ANY_SHAPE.zpp_inner);\n }\n /**\n * Radius of circle\n *

\n * This value must be strictly positive, and attempting to set this value\n * whilst this Circle is part of a static Body inside a Space will result\n * in a debug time error.\n */\n #if nape_swc@:isVar #end\n public var radius(get_radius,set_radius):Float;\n inline function get_radius():Float{\n return zpp_inner_zn.radius;\n }\n inline function set_radius(radius:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Circle::radius\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.isStatic()&&zpp_inner.body.space!=null)throw \"Error: Cannot modifiy radius of Circle contained in static object once added to space\";\n #end\n if(radius!=this.radius){\n #if(!NAPE_RELEASE_BUILD)\n if((radius!=radius))throw \"Error: Circle::radius cannot be NaN\";\n if(radius Config.epsilon\";\n if(radius>ZPP_Const.FMAX)throw \"Error: Circle::radius (\"+radius+\") must be < PR(Const).FMAX\";\n #end\n zpp_inner_zn.radius=radius;\n zpp_inner_zn.invalidate_radius();\n }\n }\n return get_radius();\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Edge class providing internal details of Polygon.\n */\n@:final#if nape_swc@:keep #end\nclass Edge{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Edge=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Edge.internal)throw \"Error: Cannot instantiate an Edge derp!\";\n #end\n }\n /**\n * Reference to Polygon this Edge belongs to.\n */\n #if nape_swc@:isVar #end\n public var polygon(get_polygon,never):Polygon;\n inline function get_polygon():Polygon{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n return zpp_inner.polygon.outer_zn;\n }\n /**\n * Normal of edge in local coordinates.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var localNormal(get_localNormal,never):Vec2;\n inline function get_localNormal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n if(zpp_inner.wrap_lnorm==null)zpp_inner.getlnorm();\n return zpp_inner.wrap_lnorm;\n }\n /**\n * Normal of edge in world coordinates.\n *

\n * This Vec2 is immutable, and may be accessed even if the related Polygon\n * is not part of a Body but queries to its values will result in a debug\n * build error.\n */\n #if nape_swc@:isVar #end\n public var worldNormal(get_worldNormal,never):Vec2;\n inline function get_worldNormal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n if(zpp_inner.wrap_gnorm==null)zpp_inner.getgnorm();\n return zpp_inner.wrap_gnorm;\n }\n /**\n * Length of edge.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Float;\n inline function get_length():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.length;\n }\n /**\n * Local projection of polygon onto edge axis.\n */\n #if nape_swc@:isVar #end\n public var localProjection(get_localProjection,never):Float;\n inline function get_localProjection():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lprojection;\n }\n /**\n * World projection of polygon to edge axis.\n *

\n * This value can only be accessed if related Polygon is part of a Body.\n */\n #if nape_swc@:isVar #end\n public var worldProjection(get_worldProjection,never):Float;\n inline function get_worldProjection():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n if(zpp_inner.polygon.body==null)throw \"Error: Edge world projection only makes sense for Polygons contained within a rigid body\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gprojection;\n }\n /**\n * Reference to first local vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var localVertex1(get_localVertex1,never):Vec2;\n inline function get_localVertex1():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lp0.wrapper();\n }\n /**\n * Reference to second local vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var localVertex2(get_localVertex2,never):Vec2;\n inline function get_localVertex2():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lp1.wrapper();\n }\n /**\n * Reference to first world vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var worldVertex1(get_worldVertex1,never):Vec2;\n inline function get_worldVertex1():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gp0.wrapper();\n }\n /**\n * Reference to second world vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var worldVertex2(get_worldVertex2,never):Vec2;\n inline function get_worldVertex2():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gp1.wrapper();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(zpp_inner.polygon==null)return \"Edge(object-pooled)\";\n else if(zpp_inner.polygon.body==null){\n zpp_inner.polygon.validate_laxi();\n return \"{ localNormal : \"+(\"{ x: \"+zpp_inner.lnormx+\" y: \"+zpp_inner.lnormy+\" }\")+\" }\";\n }\n else{\n zpp_inner.polygon.validate_gaxi();\n return \"{ localNormal : \"+(\"{ x: \"+zpp_inner.lnormx+\" y: \"+zpp_inner.lnormy+\" }\")+\" worldNormal : \"+(\"{ x: \"+zpp_inner.gnormx+\" y: \"+zpp_inner.gnormy+\" }\")+\" }\";\n }\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass EdgeIterator{\n /**\n * @private\n */\n public var zpp_inner:EdgeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:EdgeIterator=null;\n /**\n * @private\n */\n public var zpp_next:EdgeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_EdgeList.internal)throw \"Error: Cannot instantiate \"+\"Edge\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:EdgeList){\n var ret=if(zpp_pool==null){\n ZPP_EdgeList.internal=true;\n var ret=new EdgeIterator();\n ZPP_EdgeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Edge = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Edge = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Edge = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass EdgeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_EdgeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Edge\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new EdgeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Edge)#else Std.is(i,Edge)#end)throw \"Error: Array contains non \"+\"Edge\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new EdgeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Edge):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Edge{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(index==length-1?index:length-2-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Edge{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Edge{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Edge):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return EdgeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new EdgeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Edge\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:EdgeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_EdgeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Edge->Void):EdgeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=EdgeIterator.zpp_pool;\n EdgeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Edge->Bool):EdgeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Can be used to simulate any convex polygon.\n */\n@:final#if nape_swc@:keep #end\nclass Polygon extends Shape{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_Polygon=null;\n /**\n * Construct a polygon representing a rectangle.\n *

\n * For a dynamic object, you may consider use of the box method instead\n * as dynamic bodies will only respond as expected if their centre of mass\n * is equal to the origin.\n *

\n * The generate polygon will have coordinates equal to:\n *
\n     * (x, y) -> (x + width, y + height)\n     * 
\n * Negative values of width/height are permitted so that the given x/y values\n * may not necessarigly be the top-left corner of rectangle.\n *\n * @param x The x coordinate of rectangle.\n * @param y The y coordinate of rectangle.\n * @param width The width of the ractangle. This value may be negative.\n * @param height The height of the rectangle This value may be negative.\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the given rectangle.\n */\n #if nape_swc@:keep #end\n public static function rect(x:Float,y:Float,width:Float,height:Float,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)||(width!=width)||(height!=height))throw \"Error: Polygon.rect cannot accept NaN arguments\";\n #end\n return[Vec2.get(x,y,weak),Vec2.get(x+width,y,weak),Vec2.get(x+width,y+height,weak),Vec2.get(x,y+height,weak)];\n }\n /**\n * Construct a polygon representing an origin centred box.\n *

\n * This method is equivalent to calling: Polygon.rect(-width/2,-height/2,width,height)\n *\n * @param width The width of the box (This value may be negative but will\n * make no difference).\n * @param height The height of the box (This value may be negative but will\n * make no difference).\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the given box.\n */\n #if nape_swc@:keep #end\n public static function box(width:Float,height:Float,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((width!=width)||(height!=height))throw \"Error: Polygon.box cannot accept NaN arguments\";\n #end\n return rect(-width/2,-height/2,width,height,weak);\n }\n /**\n * Construct a regular polygon centred at origin.\n *

\n * Vertices are created at positions on the edge of an ellipsoid of given\n * radii, when radii are not equal the vertices will not have an equal\n * angle between them; it will be as though an actual regular polygon were\n * created, and then squashed to conform to the input radii.\n *\n * @param xRadius The x radius of polygon before angleOffset rotation.\n * @param yRadius The y radius of polygon before angleOffset rotation.\n * @param edgeCount The number of edges/vertices in polygon.\n * @param angleOffset The clockwise angular offset to generate vertices at\n * in radians. (default 0.0)\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the polygon.\n */\n #if nape_swc@:keep #end\n public static function regular(xRadius:Float,yRadius:Float,edgeCount:Int,angleOffset=0.0,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((xRadius!=xRadius)||(yRadius!=yRadius)||(angleOffset!=angleOffset))throw \"Error: Polygon.regular cannot accept NaN arguments\";\n #end\n var ret=[];\n var dangle=Math.PI*2/edgeCount;\n for(i in 0...edgeCount){\n var ang=i*dangle+angleOffset;\n var x=Vec2.get(Math.cos(ang)*xRadius,Math.sin(ang)*yRadius,weak);\n ret.push(x);\n }\n return ret;\n }\n /**\n * Local coordinates of vertices.\n *

\n * This list can be modified, but modifications to a Polygon that is\n * part of a static Body inside of a Space will given an error in\n * debug builds.\n */\n #if nape_swc@:isVar #end\n public var localVerts(get_localVerts,never):Vec2List;\n inline function get_localVerts():Vec2List{\n if(zpp_inner_zn.wrap_lverts==null)zpp_inner_zn.getlverts();\n return zpp_inner_zn.wrap_lverts;\n }\n /**\n * World coordinates of vertices.\n *

\n * This list can be accessed, but any queries of values will result\n * in an error in debug builds unless this Polygon is part of a Body.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldVerts(get_worldVerts,never):Vec2List;\n inline function get_worldVerts():Vec2List{\n if(zpp_inner_zn.wrap_gverts==null)zpp_inner_zn.getgverts();\n return zpp_inner_zn.wrap_gverts;\n }\n /**\n * Set of edges on polygon.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var edges(get_edges,never):EdgeList;\n inline function get_edges():EdgeList{\n if(zpp_inner_zn.wrap_edges==null)zpp_inner_zn.getedges();\n return zpp_inner_zn.wrap_edges;\n }\n /**\n * Determine validity of polygon for use in a Nape simulation.\n */\n #if nape_swc@:keep #end\n public function validity():ValidationResult{\n return zpp_inner_zn.valid();\n }\n /**\n * Construct a new Polygon.\n *

\n * The localVerts parameter is typed Dynamic and may be one of:\n * Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *\n * @param localVerts The local vertices of polygon.\n * @param material The material for this polygon. (default new Material())\n * @param filter The interaction filter for this polygon.\n * (default new InteractionFilter())\n * @return The constructed Polygon.\n * @throws # If localVerts is null, or not of the expected Type.\n * @throws # If localVerts contains any disposed or null Vec2.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(localVerts:Dynamic,material:Material=null,filter:InteractionFilter=null){\n #if(!NAPE_RELEASE_BUILD)\n Shape.zpp_internalAlloc=true;\n super();\n Shape.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(localVerts==null)throw \"Error: localVerts cannot be null\";\n #end\n zpp_inner_zn=new ZPP_Polygon();\n zpp_inner_zn.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner=zpp_inner_zn;\n zpp_inner_i=zpp_inner;\n zpp_inner_i.outer_i=this;\n {\n if(#if flash untyped __is__(localVerts,Array)#else Std.is(localVerts,Array)#end){\n var lv:Array=localVerts;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var x:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n }\n else if(#if flash10 untyped __is__(localVerts,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=localVerts;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var x:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n #end\n }\n else if(#if flash untyped __is__(localVerts,Vec2List)#else Std.is(localVerts,Vec2List)#end){\n var lv:Vec2List=localVerts;\n for(x in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(x==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n }\n else if(#if flash untyped __is__(localVerts,GeomPoly)#else Std.is(localVerts,GeomPoly)#end){\n var lv:GeomPoly=localVerts;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var x=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n this.localVerts.push(x.copy());\n x.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n {\n if(#if flash untyped __is__(localVerts,Array)#else Std.is(localVerts,Array)#end){\n var lv:Array=localVerts;\n var i=0;\n while(i=localVerts;\n if(!lv.fixed){\n var i:Int=0;\n while(i compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ShapeIterator{\n /**\n * @private\n */\n public var zpp_inner:ShapeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ShapeIterator=null;\n /**\n * @private\n */\n public var zpp_next:ShapeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ShapeList.internal)throw \"Error: Cannot instantiate \"+\"Shape\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ShapeList){\n var ret=if(zpp_pool==null){\n ZPP_ShapeList.internal=true;\n var ret=new ShapeIterator();\n ZPP_ShapeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Shape = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Shape = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Shape = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ShapeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ShapeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Shape\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ShapeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Shape)#else Std.is(i,Shape)#end)throw \"Error: Array contains non \"+\"Shape\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ShapeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Shape):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Shape{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Shape):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ShapeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ShapeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Shape\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ShapeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ShapeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Shape->Void):ShapeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ShapeIterator.zpp_pool;\n ShapeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Shape->Bool):ShapeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This broadphase uses a pair of binary trees with objects inserted based\n * on containment of their AABB.\n *

\n * This is a general purpose broadphase which does not suffer for objects\n * of varying sizes, or objects moving very quickly and is well set for such\n * acts as ray casting and spatial queries like objectsInAABB of the Space type.\n *

\n * This is the default broadphase nape will use.\n */\n #if nape_swc@:isVar #end\n public static var DYNAMIC_AABB_TREE(get_DYNAMIC_AABB_TREE,never):Broadphase;\n inline static function get_DYNAMIC_AABB_TREE(){\n if(ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE=new Broadphase();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE;\n }\n /**\n * Sweep and prune broadphase.\n *

\n * This is a very simple broadphase using the x-axis to keep objects\n * sorted by their minimum x coordinate.\n *

\n * Performance of this broadphase is generally good and in some circumstances\n * superior to the DYNAMIC_AABB_TREE broadphase.\n *

\n * This broadphase will however be much slower for things such as ray casts and\n * spatial queries like objectsInAABB on the Space type.\n * Also in cases where lots of objects are moving very quickly or when there is a\n * large variety in the size of objects.\n *

\n * Due to the simplicity of this broadphase, it serves as a good test should you\n * ever feel there might be something going wrong with the DYNAMIC_AABB_TREE\n * broadphase type.\n */\n #if nape_swc@:isVar #end\n public static var SWEEP_AND_PRUNE(get_SWEEP_AND_PRUNE,never):Broadphase;\n inline static function get_SWEEP_AND_PRUNE(){\n if(ZPP_Flags.Broadphase_SWEEP_AND_PRUNE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Broadphase_SWEEP_AND_PRUNE=new Broadphase();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Broadphase_SWEEP_AND_PRUNE;\n }\n}\n","package nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * The heart of all Nape simulations.\n */\n@:final#if nape_swc@:keep #end\nclass Space{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Space=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Space gravity.\n *

\n * Units are of pixels/second/second\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var gravity(get_gravity,set_gravity):Vec2;\n inline function get_gravity():Vec2{\n if(zpp_inner.wrap_gravity==null)zpp_inner.getgravity();\n return zpp_inner.wrap_gravity;\n }\n inline function set_gravity(gravity:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(gravity==null)throw \"Error: Space::gravity cannot be null\";\n #end\n this.gravity.set(gravity);\n }\n return get_gravity();\n }\n /**\n * Broadphase type in use.\n */\n #if nape_swc@:isVar #end\n public var broadphase(get_broadphase,never):Broadphase;\n inline function get_broadphase():Broadphase{\n return zpp_inner.bphase.is_sweep?Broadphase.SWEEP_AND_PRUNE:Broadphase.DYNAMIC_AABB_TREE;\n }\n /**\n * Flag controlling sorting of contact points.\n *

\n * If true, then collisions will be resolved in an order defined by their\n * penetration depths. This can be shown to improve stability of the physics\n * as well as making simulations more consistent regardless of which broadphase\n * is used.\n *

\n * Having sorting enabled obviously incurs a cost, and you may consider\n * disabling it if you are having issues with performance (Though things\n * such as number of physics iterations will have much greater bearing on\n * performance than this, especcialy since enabling this may permit you\n * to use less iterations).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var sortContacts(get_sortContacts,set_sortContacts):Bool;\n inline function get_sortContacts():Bool{\n return zpp_inner.sortcontacts;\n }\n inline function set_sortContacts(sortContacts:Bool):Bool{\n {\n zpp_inner.sortcontacts=sortContacts;\n }\n return get_sortContacts();\n }\n /**\n * Angular drag applied to all bodies in Space.\n *

\n * This represents the fraction of a body's angular velocity which will be\n * removed per second. This value has no unit attached.\n *\n * @default 0.015\n */\n #if nape_swc@:isVar #end\n public var worldAngularDrag(get_worldAngularDrag,set_worldAngularDrag):Float;\n inline function get_worldAngularDrag():Float{\n return zpp_inner.global_ang_drag;\n }\n inline function set_worldAngularDrag(worldAngularDrag:Float):Float{\n {\n var d=worldAngularDrag;\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d))throw \"Error: Space::worldAngularDrag cannot be NaN\";\n #end\n zpp_inner.global_ang_drag=d;\n }\n return get_worldAngularDrag();\n }\n /**\n * Linear drag applied to all bodies in Space.\n *

\n * This represents the fraction of a body's linear velocity which will be\n * removed per second. This value has no unit attached.\n *\n * @default 0.015\n */\n #if nape_swc@:isVar #end\n public var worldLinearDrag(get_worldLinearDrag,set_worldLinearDrag):Float;\n inline function get_worldLinearDrag():Float{\n return zpp_inner.global_lin_drag;\n }\n inline function set_worldLinearDrag(worldLinearDrag:Float):Float{\n {\n var d=worldLinearDrag;\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d))throw \"Error: Space::worldLinearDrag cannot be NaN\";\n #end\n zpp_inner.global_lin_drag=d;\n }\n return get_worldLinearDrag();\n }\n /**\n * List of all Compounds directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Compound to this Space equivalent to: compound.space = space\n *

\n * This list is only those compounds directly placed in the space, any\n * compound that is a child of another compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var compounds(get_compounds,never):CompoundList;\n inline function get_compounds():CompoundList{\n return zpp_inner.wrap_compounds;\n }\n /**\n * List of all Bodys directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Body to this Space equivalent to: body.space = space\n *

\n * This list is only those bodies directly placed in the space, any\n * body that is a child of a Compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var bodies(get_bodies,never):BodyList;\n inline function get_bodies():BodyList{\n return zpp_inner.wrap_bodies;\n }\n /**\n * List of all active dynamic Bodies in space.\n *

\n * This list contains all dynamic bodies that are awake regardless of their containment in a Compound.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var liveBodies(get_liveBodies,never):BodyList;\n inline function get_liveBodies():BodyList{\n return zpp_inner.wrap_live;\n }\n /**\n * List of all Constraints directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Constraint to this Space equivalent to: constraint.space = space\n *

\n * This list is only those bodies directly placed in the space, any\n * constraint that is a child of a Compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n return zpp_inner.wrap_constraints;\n }\n /**\n * List of all active Constraints in space.\n *

\n * This list contains all constraints regardless of their containment in a Compound.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var liveConstraints(get_liveConstraints,never):ConstraintList;\n inline function get_liveConstraints():ConstraintList{\n return zpp_inner.wrap_livecon;\n }\n /**\n * Apply given function to all bodies in space.\n *

\n * This method is a way to iterate over 'every' Body in the Space\n * regardless of containment in a Compound.\n *\n * @param lambda The function to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitBodies\";\n #end\n for(b in bodies)lambda(b);\n for(c in compounds)c.visitBodies(lambda);\n }\n /**\n * Apply given function to all constraints in space.\n *

\n * This method is a way to iterate over 'every' Constraint in the Space\n * regardless of containment in a Compound.\n *\n * @param lambda The function to apply to each Constraint.\n * @throws # If lambda is null.\n */\n public function visitConstraints(lambda:Constraint->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitConstraints\";\n #end\n for(c in constraints)lambda(c);\n for(c in compounds)c.visitConstraints(lambda);\n }\n /**\n * Apply given function to all compounds in space.\n *

\n * This method is a way to iterate over 'every' Compound in the Space\n * regardless of containment in another Compound.\n *\n * @param lambda The function to apply to each Compound.\n * @throws # If lambda is null.\n */\n public function visitCompounds(lambda:Compound->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitCompounds\";\n #end\n for(c in compounds){\n lambda(c);\n c.visitCompounds(lambda);\n }\n }\n /**\n * Static, immutable Body for constraint purposes.\n *

\n * This is a completely static, uncollidable, uninteractable Body\n * with no Shapes, that cannot be modified in any way.\n *

\n * Its purpose is to provide a means for attaching Constraints\n * from one Body to the Space itself, for instance pinning a body\n * against a static point in space.\n */\n #if nape_swc@:isVar #end\n public var world(get_world,never):Body;\n inline function get_world():Body{\n return zpp_inner.__static;\n }\n /**\n * List of all active arbiters in Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n if(zpp_inner.wrap_arbiters==null){\n var ret=new ZPP_SpaceArbiterList();\n ret.space=zpp_inner;\n zpp_inner.wrap_arbiters=ret;\n }\n return zpp_inner.wrap_arbiters;\n }\n /**\n * List of all Listeners in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Listener to this Space equivalent to: listener.space = space\n */\n #if nape_swc@:isVar #end\n public var listeners(get_listeners,never):ListenerList;\n inline function get_listeners():ListenerList{\n return zpp_inner.wrap_listeners;\n }\n /**\n * Clear the Space of all objects.\n *

\n * Things such as the elapsed simulation time, and time step will too be\n * reset to 0.\n *

\n * Parameters such as gravity, and worldLinearDrag will be untouched by\n * this operation.\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.midstep)throw \"Error: Space::clear() cannot be called during space step()\";\n #end\n zpp_inner.clear();\n }\n /**\n * Step simulation forward in time.\n *\n * @param deltaTime The number of seconds to simulate. For 60fps physics\n * you would use a value of 1/60.\n * @param velocityIterations The number of iterations to use in resolving\n * errors in the velocities of objects. This is\n * together with collision detection the most\n * expensive phase of a simulation update, as well\n * as the most important for stable results.\n * (default 10)\n * @param positionIterations The number of iterations to use in resolving\n * errors in the positions of objects. This is\n * far more lightweight than velocity iterations,\n * as well as being less important for the\n * stability of results. (default 10)\n * @throws # If deltaTime is not strictly positive.\n * @throws # If either of the number of iterations is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function step(deltaTime:Float,velocityIterations:Int=10,positionIterations:Int=10){\n #if(!NAPE_RELEASE_BUILD)\n if((deltaTime!=deltaTime))throw \"Error: deltaTime cannot be NaN\";\n if(deltaTime<=0)throw \"Error: deltaTime must be strictly positive\";\n if(velocityIterations<=0)throw \"Error: must use atleast one velocity iteration\";\n if(positionIterations<=0)throw \"Error: must use atleast one position iteration\";\n #end\n zpp_inner.step(deltaTime,velocityIterations,positionIterations);\n }\n /**\n * The time stamp of this Space object.\n *

\n * This is equal to the number of times that space.step(..) has been invoked.\n */\n #if nape_swc@:isVar #end\n public var timeStamp(get_timeStamp,never):Int;\n inline function get_timeStamp():Int{\n return zpp_inner.stamp;\n }\n /**\n * The elapsed simulation time.\n *

\n * This is the total amount of 'time' that has elapsed in the Space simulation.\n */\n #if nape_swc@:isVar #end\n public var elapsedTime(get_elapsedTime,never):Float;\n inline function get_elapsedTime():Float{\n return zpp_inner.time;\n }\n /**\n * Construct a new Space object.\n *\n * @param gravity The gravity of this space. (default (0,0))\n * @param broadphase The broadphase type to use. (default DYNAMIC_AABB_TREE)\n * @return The constructed Space object.\n * @throws # If gravity is non-null, and has been disposed of.\n */\n public function new(gravity:Vec2=null,broadphase:Broadphase=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner=new ZPP_Space(gravity==null?null:gravity.zpp_inner,broadphase);\n zpp_inner.outer=this;\n if(gravity!=null)({\n if(({\n gravity.zpp_inner.weak;\n })){\n gravity.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n /**\n * Determine the interaction type that would occur between a pair of Shapes.\n *

\n * This function takes into account everything possible, and ignoring the\n * callback system will tell you precisely the type of interaction (if any\n * at all) which will occur between these Shapes.\n *

\n * This function can only work if the Shapes belong to a Body.\n *

\n * This function can only make use of any constraints 'ignore' property\n * to determine if 'null' should be returned if the constraints being used\n * are inside of a Space.\n *\n * @param shape1 The first Shape to test.\n * @param shape2 The second Shape to test.\n * @return The interaction type that will occur between these shapes, or null\n * if no interaction will occur.\n * @throws # If either shape is null, or is not contained within a body.\n */\n #if nape_swc@:keep #end\n public function interactionType(shape1:Shape,shape2:Shape):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(shape1==null||shape2==null)throw \"Error: Cannot evaluate interaction type for null shapes\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape1.body==null||shape2.body==null)throw \"Error: Cannot evaluate interaction type for shapes not part of a Body\";\n #end\n if(shape1.body.isStatic()&&shape2.body.isStatic())return null;\n if(shape1.body==shape2.body)return null;\n var s1=shape1.zpp_inner;\n var s2=shape2.zpp_inner;\n return switch(zpp_inner.interactionType(s1,s2,s1.body,s2.body)){\n case 0:InteractionType.FLUID;\n case 1:InteractionType.COLLISION;\n case 2:InteractionType.SENSOR;\n default:null;\n }\n }\n /**\n * Evaluate all Shapes under a given Point.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param point The point to evaluate shapes.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the Shapes containing the given point.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function shapesUnderPoint(point:Vec2,filter:InteractionFilter=null,output:ShapeList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot evaluate shapes under a null point :)\";\n #end\n var ret=zpp_inner.shapesUnderPoint(point.x,point.y,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Bodies under a given Point.\n *

\n * If the filter argument is non-null, then only bodies with a shape containing\n * the given point whose filter agrees to 'collide' will be considered.\n *\n * @param point The point to evaluate bodies.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the Bodies containing the given point.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function bodiesUnderPoint(point:Vec2,filter:InteractionFilter=null,output:BodyList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot evaluate objects under a null point :)\";\n #end\n var ret=zpp_inner.bodiesUnderPoint(point.x,point.y,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Shapes given an AABB.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param aabb The bounding box to query shapes by,\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param strict If false, then the Shape's bounding box will be used to\n * classify the Shape, instead of the Shape itself.\n * (default true)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given AABB.\n * @throws # If AABB is null, or is degenerate.\n */\n #if nape_swc@:keep #end\n public function shapesInAABB(aabb:AABB,containment:Bool=false,strict:Bool=true,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(aabb==null)throw \"Error: Cannot evaluate shapes in a null AABB :)\";\n if(aabb.width==0||aabb.height==0)throw \"Error: Cannot evaluate shapes in degenerate AABB :/\";\n #end\n return zpp_inner.shapesInAABB(aabb,strict,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Bodies given an AABB.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the AABB, whose filter agrees to collide\n * will be considered.\n *\n * @param aabb The bounding box to query bodies by,\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered.\n * (default false)\n * @param strict If false, then the body's shape's bounding box will be used to\n * classify the shapes of the body, instead of the Shape itself.\n * (default true)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given AABB.\n * @throws # If AABB is null, or is degenerate.\n */\n #if nape_swc@:keep #end\n public function bodiesInAABB(aabb:AABB,containment:Bool=false,strict:Bool=true,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(aabb==null)throw \"Error: Cannot evaluate objects in a null AABB :)\";\n if(aabb.width==0||aabb.height==0)throw \"Error: Cannot evaluate objects in degenerate AABB :/\";\n #end\n return zpp_inner.bodiesInAABB(aabb,strict,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Shapes given a circle.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param position The position of the centre of the circle.\n * @param radius The radius of the circle.\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given circle.\n * @throws # If positions is null or disposed of.\n * @throws # If radius is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function shapesInCircle(position:Vec2,radius:Float,containment:Bool=false,filter:InteractionFilter=null,output:ShapeList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Cannot evaluate shapes at null circle :)\";\n if((radius!=radius))throw \"Error: Circle radius cannot be NaN\";\n if(radius<=0)throw \"Error: Circle radius must be strictly positive\";\n #end\n var ret=zpp_inner.shapesInCircle(position,radius,containment,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Bodies given a circle.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the circle, whose filter agrees to collide\n * will be considered.\n *\n * @param position The position of the centre of the circle.\n * @param radius The radius of the circle.\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered. If a\n * filter is supplied, only shapes that agree to collide\n * will be used in this containment check.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given circle.\n * @throws # If positions is null or disposed of.\n * @throws # If radius is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function bodiesInCircle(position:Vec2,radius:Float,containment:Bool=false,filter:InteractionFilter=null,output:BodyList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Cannot evaluate objects at null circle :)\";\n if((radius!=radius))throw \"Error: Circle radius cannot be NaN\";\n if(radius<=0)throw \"Error: Circle radius must be strictly positive\";\n #end\n var ret=zpp_inner.bodiesInCircle(position,radius,containment,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Shapes given another shape.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered. The input shape's own filter\n * is never used in this method. The input shape is considered a purely\n * geometric object.\n *

\n * The input shape must be part of a Body so as to be well defined.\n *\n * @param shape The shape to use in classifying other shapes.\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given shape.\n * @throws # If shape is null or not part of a body.\n * @throws # If shape is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function shapesInShape(shape:Shape,containment:Bool=false,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot evaluate shapes in a null shapes :)\";\n if(shape.body==null)throw \"Error: Query shape needs to be inside a Body to be well defined :)\";\n if(shape.isPolygon()){\n var res=shape.zpp_inner.polygon.valid();\n if(res!=ValidationResult.VALID)throw \"Error: Polygon query shape is invalid : \"+res.toString();\n }\n #end\n return zpp_inner.shapesInShape(shape.zpp_inner,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Bodies given a shape.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the input shape, whose filter agrees to collide\n * will be considered. The input shape is considered a purely geometric\n *

\n * The input shape must be part of a Body so as to be well defined.\n *\n * @param shape The shape to use in classifying other shapes.\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the bodies for given shape.\n * @throws # If shape is null or not part of a body.\n * @throws # If shape is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function bodiesInShape(shape:Shape,containment:Bool=false,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot evaluate bodies in a null shapes :)\";\n if(shape.body==null)throw \"Error: Query shape needs to be inside a Body to be well defined :)\";\n if(shape.isPolygon()){\n var res=shape.zpp_inner.polygon.valid();\n if(res!=ValidationResult.VALID)throw \"Error: Polygon query shape is invalid : \"+res.toString();\n }\n #end\n return zpp_inner.bodiesInShape(shape.zpp_inner,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Shapes given a Body.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered. The input body's shape's own filters\n * are never used in this method. The input body is considered a purely\n * geometric object.\n *\n * @param body The body to use in classifying other shapes.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given body.\n * @throws # If body is null.\n * @throws # If body has a shape that is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function shapesInBody(body:Body,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Cannot evaluate shapes in null body\";\n #end\n var ret=(output==null?new ShapeList():output);\n for(shape in body.shapes){\n var cur=shapesInShape(shape,false,filter,ret);\n }\n return ret;\n }\n /**\n * Evaluate all Bodies given a Body.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the input body, whose filter agrees to collide\n * will be considered. The input body is considered a purely geometric\n *\n * @param body The body to use in classifying other bodies.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the bodies for given body.\n * @throws # If body is null.\n * @throws # If body has a shape that is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function bodiesInBody(body:Body,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Cannot evaluate shapes in null body\";\n #end\n var ret=(output==null?new BodyList():output);\n for(shape in body.shapes){\n var cur=bodiesInShape(shape,false,filter,ret);\n }\n return ret;\n }\n /**\n * Perform a convex cast for soonest collision.\n *

\n * This method will return only the soonest collision result (if any), to find\n * more than this, use the convexMultiCast method. The shape will not be\n * swept further than the time delta provided.\n * Shapes already intersecting\n * the sweep shape at t = 0 are ignored.\n *

\n * If the filter argument is null, then all shapes will be collidable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param shape The Shape to be cast through space. This shape must belong\n * to a body whose velocity is used to define the sweep.\n * @param deltaTime The amount of time to sweep the shape forward.\n * @param liveSweep If true, then moving objects in the space will have their motion considered during the sweep. Otherwise; like with normal rayCast, objects in the space are considered un-moving for the cast. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @return The soonest result (if any) of convex intersection.\n * @throws # If shape is null, or not part of a body.\n * @throws # If deltaTime is negative.\n */\n #if nape_swc@:keep #end\n public function convexCast(shape:Shape,deltaTime:Float,liveSweep:Bool=false,filter:InteractionFilter=null):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot cast null shape :)\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape.body==null)throw \"Error: Shape must belong to a body to be cast.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(deltaTime<0||(deltaTime!=deltaTime))throw \"Error: deltaTime must be positive\";\n #end\n return zpp_inner.convexCast(shape.zpp_inner,deltaTime,filter,liveSweep);\n }\n /**\n * Perform a convex cast for all collisions in time order.\n *

\n * This method will return all collisions, or an empty list if there are none.\n * The shape will not be\n * swept further than the time delta provided. Shapes already intersecting\n * the sweep shape at t = 0 are ignored.\n *

\n * If the filter argument is null, then all shapes will be collidable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param shape The Shape to be cast through space. This shape must belong\n * to a body whose velocity is used to define the sweep.\n * @param deltaTime The amount of time to sweep the shape forward.\n * @param liveSweep If true, then moving objects in the space will have their motion considered during the sweep. Otherwise; like with normal rayCast, objects in the space are considered un-moving for the cast. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output A list to append results to instead of allocating a new one (default null)\n * @return The collision results in time order.\n * @throws # If shape is null, or not part of a body.\n * @throws # If deltaTime is negative.\n */\n #if nape_swc@:keep #end\n public function convexMultiCast(shape:Shape,deltaTime:Float,liveSweep:Bool=false,filter:InteractionFilter=null,output:ConvexResultList):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot cast null shape :)\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape.body==null)throw \"Error: Shape must belong to a body to be cast.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(deltaTime<0||(deltaTime!=deltaTime))throw \"Error: deltaTime must be positive\";\n #end\n return zpp_inner.convexMultiCast(shape.zpp_inner,deltaTime,filter,liveSweep,output);\n }\n /**\n * Perform a ray cast for closest result.\n *

\n * This method will return only the closest result (if any), to find more\n * the first result, use the rayMultiCast method. The ray will not be\n * cast beyond its maxDistance.\n *

\n * If the filter argument is null, then all shapes will be intersectable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param ray The ray to cast through space.\n * @param inner If true then inner surfaces of shapes will also be intersected.\n * otherwise only the outer surfaces. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @return The closest result (if any) of ray intersection.\n * @throws # If ray is null.\n */\n #if nape_swc@:keep #end\n public function rayCast(ray:Ray,inner:Bool=false,filter:InteractionFilter=null):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(ray==null)throw \"Error: Cannot cast null ray :)\";\n #end\n return zpp_inner.rayCast(ray,inner,filter);\n }\n /**\n * Perform a ray cast for all valid results.\n *

\n * This method will return all intersections (in distance order) of ray\n * with shapes in the space up to the ray's maxDistance.\n *

\n * If the filter argument is null, then all shapes will be intersectable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param ray The ray to cast through space.\n * @param inner If true then inner surfaces of shapes will also be intersected.\n * otherwise only the outer surfaces. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output A list to append results to instead of allocating a new one (default null)\n * @return All valid results of ray cast in distance order from closest to furthest.\n * @throws # If ray is null.\n */\n #if nape_swc@:keep #end\n public function rayMultiCast(ray:Ray,inner:Bool=false,filter:InteractionFilter=null,output:RayResultList=null):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(ray==null)throw \"Error: Cannot cast null ray :)\";\n #end\n return zpp_inner.rayMultiCast(ray,inner,filter,output);\n }\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.nape;\n\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport haxe.Timer;\n\nimport nape.geom.Vec2;\nimport nape.phys.Body;\nimport nape.phys.BodyType;\nimport nape.shape.Circle;\nimport nape.shape.Polygon;\nimport nape.space.Space;\nimport nape.phys.Material;\n\nclass Main extends Application {\n\n\tvar _floor:Body;\n\tvar _space:Space;\n\tvar _balls:Array;\n\tvar _pballs:Array;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\t_balls = [];\n\t\t_pballs = [];\n\t\t_setUpPhysics();\n\t\tonUpdate = _onUpdate;\n\t\tvar timer:Timer = new Timer(1000);\n\t\ttimer.run = _addBall;\n\t\t_addBall();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x6699FF;\n\t\tautoResize = false;\n\t\twidth = 800;\n\t\theight = 600;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_space.step(1 / 60);\n\n\t\tfor(i in 0 ... _pballs.length) {\n\t\t\t_balls[i].position.x = _pballs[i].position.x;\n\t\t\t_balls[i].position.y = _pballs[i].position.y;\n\t\t\t_balls[i].rotation = _pballs[i].rotation;\n\t\t}\n\t}\n\n\tfunction _setUpPhysics() {\n\t\tvar gravity = Vec2.weak(0, 600);\n\t\t_space = new Space(gravity);\n\n\t\t_floor = new Body(BodyType.STATIC);\n\t\t_floor.setShapeMaterials(Material.wood());\n\t\t_floor.shapes.add(new Polygon(Polygon.rect(0, 595, 800, 1)));\n\t\t_floor.space = _space;\n\t}\n\n\tfunction _addBall() {\n\t\tvar ball:Sprite = new Sprite(Texture.fromImage(\"assets/nape/ball.png\"));\n\t\tball.anchor.set(0.5, 0.5);\n\t\t_balls.push(ball);\n\t\tstage.addChild(ball);\n\n\t\tvar pball:Body = new Body(BodyType.DYNAMIC);\n\t\tpball.shapes.add(new Circle(10));\n\t\tpball.position.setxy(Std.random(800), 0);\n\t\tpball.angularVel = 0;\n\t\tpball.allowRotation = true;\n\n\t\tpball.setShapeMaterials(Material.rubber());\n\t\tpball.space = _space;\n\t\t_pballs.push(pball);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}","package zpp_nape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_ID{\n \n public static var _Constraint:Int=0;\n public static function Constraint(){\n return _Constraint++;\n }\n public static var _Interactor:Int=0;\n public static function Interactor(){\n return _Interactor++;\n }\n public static var _CbType:Int=0;\n public static function CbType(){\n return _CbType++;\n }\n public static var _CbSet:Int=0;\n public static function CbSet(){\n return _CbSet++;\n }\n public static var _Listener:Int=0;\n public static function Listener(){\n return _Listener++;\n }\n public static var _ZPP_SimpleVert:Int=0;\n public static function ZPP_SimpleVert(){\n return _ZPP_SimpleVert++;\n }\n public static var _ZPP_SimpleSeg:Int=0;\n public static function ZPP_SimpleSeg(){\n return _ZPP_SimpleSeg++;\n }\n public static var _Space:Int=0;\n public static function Space(){\n return _Space++;\n }\n public static var _InteractionGroup:Int=0;\n public static function InteractionGroup(){\n return _InteractionGroup++;\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Callback{\n public var outer_body:Null=null;\n public var outer_con:Null=null;\n public var outer_int:Null=null;\n #if(!NAPE_RELEASE_BUILD)\n public static var internal=false;\n #end\n public function wrapper_body(){\n if(outer_body==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_body=new BodyCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_body.zpp_inner=this;\n }\n return outer_body;\n }\n public function wrapper_con(){\n if(outer_con==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_con=new ConstraintCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_con.zpp_inner=this;\n }\n return outer_con;\n }\n public function wrapper_int(){\n if(outer_int==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_int=new InteractionCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_int.zpp_inner=this;\n }\n genarbs();\n return outer_int;\n }\n public var event:Int=0;\n public var listener:ZPP_Listener=null;\n public var space:ZPP_Space=null;\n public var index:Int=0;\n public var next:ZPP_Callback=null;\n public var prev:ZPP_Callback=null;\n public var length:Int=0;\n public function push(obj:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"push null?\");\n #end\n };\n if(prev!=null)prev.next=obj;\n else next=obj;\n obj.prev=prev;\n obj.next=null;\n prev=obj;\n length++;\n }\n public function push_rev(obj:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"push_rev null?\");\n #end\n };\n if(next!=null)next.prev=obj;\n else prev=obj;\n obj.next=next;\n obj.prev=null;\n next=obj;\n length++;\n }\n public function pop():ZPP_Callback{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n next!=null;\n };\n if(!res)throw \"assert(\"+\"next!=null\"+\") :: \"+(\"empty queue\");\n #end\n };\n var ret=next;\n next=ret.next;\n if(next==null)prev=null;\n else next.prev=null;\n length--;\n return ret;\n }\n public function pop_rev():ZPP_Callback{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n prev!=null;\n };\n if(!res)throw \"assert(\"+\"prev!=null\"+\") :: \"+(\"empty queue\");\n #end\n };\n var ret=prev;\n prev=ret.prev;\n if(prev==null)next=null;\n else prev.next=null;\n length--;\n return ret;\n }\n public function empty(){\n return next==null;\n }\n public function clear(){\n while(!empty())pop();\n }\n public function splice(o:ZPP_Callback){\n var ret=o.next;\n if(o.prev==null){\n next=o.next;\n if(next!=null)next.prev=null;\n else prev=null;\n }\n else{\n o.prev.next=o.next;\n if(o.next!=null)o.next.prev=o.prev;\n else prev=o.prev;\n }\n length--;\n return ret;\n }\n public function rotateL(){\n push(pop());\n }\n public function rotateR(){\n push_rev(pop_rev());\n }\n public function cycleNext(o:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"cyclNext null?\");\n #end\n };\n if(o.next==null)return next;\n else return o.next;\n }\n public function cyclePrev(o:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"cyclPrev null?\");\n #end\n };\n if(o.prev==null)return prev;\n else return o.prev;\n }\n public function at(i:Int){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i>=0&&i=0&&i=0&&i=0&&i0;\n };\n if(!res)throw \"assert(\"+\"count>0\"+\") :: \"+(\"decrementing ref.count into negatives??\");\n #end\n };\n return(--count)==0;\n }\n public function invalidate_pairs():Void{\n {\n var cx_ite=cbpairs.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.invalidate();\n cx_ite=cx_ite.next;\n }\n };\n }\n public var listeners:ZNPList_ZPP_InteractionListener=null;\n public var zip_listeners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_listeners():Void{\n zip_listeners=true;\n #if true invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_listeners():Void{\n if(zip_listeners){\n zip_listeners=false;\n realvalidate_listeners();\n }\n }\n public function realvalidate_listeners(){\n listeners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=listeners.begin();\n var cite=cb.listeners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !listeners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!listeners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if true true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=listeners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public var bodylisteners:ZNPList_ZPP_BodyListener=null;\n public var zip_bodylisteners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_bodylisteners():Void{\n zip_bodylisteners=true;\n #if false invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_bodylisteners():Void{\n if(zip_bodylisteners){\n zip_bodylisteners=false;\n realvalidate_bodylisteners();\n }\n }\n public function realvalidate_bodylisteners(){\n bodylisteners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=bodylisteners.begin();\n var cite=cb.bodylisteners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !bodylisteners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!bodylisteners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if false true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=bodylisteners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public var conlisteners:ZNPList_ZPP_ConstraintListener=null;\n public var zip_conlisteners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_conlisteners():Void{\n zip_conlisteners=true;\n #if false invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_conlisteners():Void{\n if(zip_conlisteners){\n zip_conlisteners=false;\n realvalidate_conlisteners();\n }\n }\n public function realvalidate_conlisteners(){\n conlisteners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=conlisteners.begin();\n var cite=cb.conlisteners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !conlisteners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!conlisteners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if false true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=conlisteners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function validate(){\n \n validate_listeners();\n validate_bodylisteners();\n validate_conlisteners();\n }\n public var interactors:ZNPList_ZPP_Interactor=null;\n public var wrap_interactors:InteractorList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addConstraint(con:ZPP_Constraint){\n constraints.add(con);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addInteractor(intx:ZPP_Interactor){\n interactors.add(intx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remConstraint(con:ZPP_Constraint){\n constraints.remove(con);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remInteractor(intx:ZPP_Interactor){\n interactors.remove(intx);\n }\n public static function setlt(a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n var i=a.cbTypes.begin();\n var j=b.cbTypes.begin();\n while(i!=null&&j!=null){\n var ca=i.elem();\n var cb=j.elem();\n if(ZPP_CbType.setlt(ca,cb))return true;\n if(ZPP_CbType.setlt(cb,ca))return false;\n else{\n i=i.next;\n j=j.next;\n }\n }\n return j!=null&&i==null;\n }\n public function new(){\n cbTypes=new ZNPList_ZPP_CbType();\n \n listeners=new ZNPList_ZPP_InteractionListener();\n zip_listeners=true;\n bodylisteners=new ZNPList_ZPP_BodyListener();\n zip_bodylisteners=true;\n conlisteners=new ZNPList_ZPP_ConstraintListener();\n zip_conlisteners=true;\n constraints=new ZNPList_ZPP_Constraint();\n interactors=new ZNPList_ZPP_Interactor();\n id=ZPP_ID.CbSet();\n cbpairs=new ZNPList_ZPP_CbSetPair();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n constraints.empty();\n };\n if(!res)throw \"assert(\"+\"constraints.empty()\"+\") :: \"+(\"non-empty constraints\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n interactors.empty();\n };\n if(!res)throw \"assert(\"+\"interactors.empty()\"+\") :: \"+(\"non-empty interactors\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n count==0;\n };\n if(!res)throw \"assert(\"+\"count==0\"+\") :: \"+(\"deallocating with count!=0?\");\n #end\n };\n \n listeners.clear();\n zip_listeners=true;\n bodylisteners.clear();\n zip_bodylisteners=true;\n conlisteners.clear();\n zip_conlisteners=true;\n {\n while(!cbTypes.empty()){\n var cb=cbTypes.pop_unsafe();\n cb.cbsets.remove(this);\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbpairs.empty();\n };\n if(!res)throw \"assert(\"+\"cbpairs.empty()\"+\") :: \"+(\"non-empty cbpairs\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_ASSERT public static function assert_cbTypes(cbTypes:ZNPList_ZPP_CbType):Void{\n var pre=null;\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n if(pre!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ZPP_CbType.setlt(pre,cur);\n };\n if(!res)throw \"assert(\"+\"ZPP_CbType.setlt(pre,cur)\"+\") :: \"+(\"cbTypes of CbSet not well-ordered!\");\n #end\n };\n }\n pre=cur;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #end\n public static function get(cbTypes:ZNPList_ZPP_CbType){\n var ret;\n {\n if(ZPP_CbSet.zpp_pool==null){\n ret=new ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_TOT++;\n ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT--;\n ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n var ite=null;\n #if NAPE_ASSERT assert_cbTypes(cbTypes);\n #end\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n ite=ret.cbTypes.insert(ite,cb);\n cb.cbsets.add(ret);\n };\n cx_ite=cx_ite.next;\n }\n };\n return ret;\n }\n #if NAPE_NO_INLINE#else inline #end\n static function compatible(i:ZPP_InteractionListener,a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n return(i.options1.compatible(a.cbTypes)&&i.options2.compatible(b.cbTypes))||(i.options2.compatible(a.cbTypes)&&i.options1.compatible(b.cbTypes));\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function empty_intersection(a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n return a.manager.pair(a,b).empty_intersection();\n }\n public static function single_intersection(a:ZPP_CbSet,b:ZPP_CbSet,i:ZPP_InteractionListener):Bool{\n return a.manager.pair(a,b).single_intersection(i);\n }\n #if NAPE_NO_INLINE#else inline #end\n public static function find_all(a:ZPP_CbSet,b:ZPP_CbSet,event:Int,cb:ZPP_InteractionListener->Void):Void{\n a.manager.pair(a,b).forall(event,cb);\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_CbSetPair{\n public var a:ZPP_CbSet=null;\n public var b:ZPP_CbSet=null;\n public var next:ZPP_CbSetPair=null;\n static public var zpp_pool:ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n a=b=null;\n listeners.clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n zip_listeners=true;\n }\n public function new(){\n listeners=new ZNPList_ZPP_InteractionListener();\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function get(a:ZPP_CbSet,b:ZPP_CbSet):ZPP_CbSetPair{\n var ret;\n {\n if(ZPP_CbSetPair.zpp_pool==null){\n ret=new ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_TOT++;\n ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT--;\n ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n if(ZPP_CbSet.setlt(a,b)){\n ret.a=a;\n ret.b=b;\n }\n else{\n ret.a=b;\n ret.b=a;\n }\n return ret;\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function setlt(x:ZPP_CbSetPair,y:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n (x.a==y.a)==(!ZPP_CbSet.setlt(x.a,y.a)&&!ZPP_CbSet.setlt(y.a,x.a));\n };\n if(!res)throw \"assert(\"+\"(x.a==y.a)==(!ZPP_CbSet.setlt(x.a,y.a)&&!ZPP_CbSet.setlt(y.a,x.a))\"+\") :: \"+(\"Assumption that CbSet's are unique!! Aka we can compare for 'equal' CbSet with == is wrong?? :(\");\n #end\n };\n return ZPP_CbSet.setlt(x.a,y.a)||(x.a==y.a&&ZPP_CbSet.setlt(x.b,y.b));\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function compatible(i:ZPP_InteractionListener):Bool{\n return(i.options1.compatible(a.cbTypes)&&i.options2.compatible(b.cbTypes))||(i.options2.compatible(a.cbTypes)&&i.options1.compatible(b.cbTypes));\n }\n public var zip_listeners:Bool=false;\n public var listeners:ZNPList_ZPP_InteractionListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n zip_listeners=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(zip_listeners){\n zip_listeners=false;\n __validate();\n }\n }\n public function __validate():Void{\n listeners.clear();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !a.zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!a.zip_listeners\"+\") :: \"+(\"a.listeners not validated??\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !b.zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!b.zip_listeners\"+\") :: \"+(\"b.listeners not validated??\");\n #end\n };\n var aite=a.listeners.begin();\n var bite=b.listeners.begin();\n while(aite!=null&&bite!=null){\n var ax=aite.elem();\n var bx=bite.elem();\n if(ax==bx){\n if(compatible(ax)){\n listeners.add(ax);\n }\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_Listener.setlt(ax,bx))aite=aite.next;\n else bite=bite.next;\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty_intersection():Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before empty_intersection\");\n #end\n };\n return listeners.empty();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function single_intersection(i:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before single_intersection\");\n #end\n };\n var ite=listeners.begin();\n return ite!=null&&ite.elem()==i&&ite.next==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function forall(event:Int,cb:ZPP_InteractionListener->Void):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before forall\");\n #end\n };\n {\n var cx_ite=listeners.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x.event==event)cb(x);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbType{\n public var head:ZNPNode_ZPP_CbType=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbType{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbType):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbType):ZPP_CbType{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbType):ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbType.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbType();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_TOT++;\n ZNPNode_ZPP_CbType.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT--;\n ZNPNode_ZPP_CbType.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbType,o:ZPP_CbType):ZNPNode_ZPP_CbType{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbType,o:ZPP_CbType):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbType.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbType();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_TOT++;\n ZNPNode_ZPP_CbType.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT--;\n ZNPNode_ZPP_CbType.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbType\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT++;\n ZNPNode_ZPP_CbType.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbType{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbType):ZNPNode_ZPP_CbType{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbType):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbType;\n var ret:ZNPNode_ZPP_CbType;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbType\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT++;\n ZNPNode_ZPP_CbType.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbType,n:Int):ZNPNode_ZPP_CbType{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbType):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbType{\n return begin().elem();\n }\n public function back():ZPP_CbType{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CallbackSet{\n public var head:ZNPNode_ZPP_CallbackSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CallbackSet{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CallbackSet):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CallbackSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_TOT++;\n ZNPNode_ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT--;\n ZNPNode_ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CallbackSet,o:ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CallbackSet,o:ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CallbackSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_TOT++;\n ZNPNode_ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT--;\n ZNPNode_ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CallbackSet\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT++;\n ZNPNode_ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CallbackSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CallbackSet;\n var ret:ZNPNode_ZPP_CallbackSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CallbackSet\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT++;\n ZNPNode_ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CallbackSet,n:Int):ZNPNode_ZPP_CallbackSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CallbackSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CallbackSet{\n return begin().elem();\n }\n public function back():ZPP_CallbackSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Shape{\n public var head:ZNPNode_ZPP_Shape=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Shape{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Shape):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Shape):ZPP_Shape{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Shape):ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Shape.zpp_pool==null){\n ret=new ZNPNode_ZPP_Shape();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_TOT++;\n ZNPNode_ZPP_Shape.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT--;\n ZNPNode_ZPP_Shape.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Shape,o:ZPP_Shape):ZNPNode_ZPP_Shape{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Shape,o:ZPP_Shape):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Shape.zpp_pool==null){\n ret=new ZNPNode_ZPP_Shape();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_TOT++;\n ZNPNode_ZPP_Shape.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT--;\n ZNPNode_ZPP_Shape.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Shape\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT++;\n ZNPNode_ZPP_Shape.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Shape{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Shape):ZNPNode_ZPP_Shape{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Shape):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Shape;\n var ret:ZNPNode_ZPP_Shape;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Shape\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT++;\n ZNPNode_ZPP_Shape.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Shape,n:Int):ZNPNode_ZPP_Shape{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Shape):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Shape{\n return begin().elem();\n }\n public function back():ZPP_Shape{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Body{\n public var head:ZNPNode_ZPP_Body=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Body{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Body):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Body):ZPP_Body{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Body):ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Body.zpp_pool==null){\n ret=new ZNPNode_ZPP_Body();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_TOT++;\n ZNPNode_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT--;\n ZNPNode_ZPP_Body.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Body,o:ZPP_Body):ZNPNode_ZPP_Body{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Body,o:ZPP_Body):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Body.zpp_pool==null){\n ret=new ZNPNode_ZPP_Body();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_TOT++;\n ZNPNode_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT--;\n ZNPNode_ZPP_Body.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Body\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT++;\n ZNPNode_ZPP_Body.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Body{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Body):ZNPNode_ZPP_Body{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Body):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Body;\n var ret:ZNPNode_ZPP_Body;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Body\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT++;\n ZNPNode_ZPP_Body.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Body,n:Int):ZNPNode_ZPP_Body{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Body):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Body{\n return begin().elem();\n }\n public function back():ZPP_Body{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Constraint{\n public var head:ZNPNode_ZPP_Constraint=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Constraint{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Constraint):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Constraint):ZPP_Constraint{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Constraint):ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Constraint.zpp_pool==null){\n ret=new ZNPNode_ZPP_Constraint();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_TOT++;\n ZNPNode_ZPP_Constraint.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT--;\n ZNPNode_ZPP_Constraint.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Constraint,o:ZPP_Constraint):ZNPNode_ZPP_Constraint{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Constraint,o:ZPP_Constraint):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Constraint.zpp_pool==null){\n ret=new ZNPNode_ZPP_Constraint();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_TOT++;\n ZNPNode_ZPP_Constraint.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT--;\n ZNPNode_ZPP_Constraint.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Constraint\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT++;\n ZNPNode_ZPP_Constraint.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Constraint{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Constraint):ZNPNode_ZPP_Constraint{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Constraint):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Constraint;\n var ret:ZNPNode_ZPP_Constraint;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Constraint\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT++;\n ZNPNode_ZPP_Constraint.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Constraint,n:Int):ZNPNode_ZPP_Constraint{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Constraint):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Constraint{\n return begin().elem();\n }\n public function back():ZPP_Constraint{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Compound{\n public var head:ZNPNode_ZPP_Compound=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Compound{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Compound):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Compound):ZPP_Compound{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Compound):ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Compound.zpp_pool==null){\n ret=new ZNPNode_ZPP_Compound();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_TOT++;\n ZNPNode_ZPP_Compound.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT--;\n ZNPNode_ZPP_Compound.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Compound,o:ZPP_Compound):ZNPNode_ZPP_Compound{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Compound,o:ZPP_Compound):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Compound.zpp_pool==null){\n ret=new ZNPNode_ZPP_Compound();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_TOT++;\n ZNPNode_ZPP_Compound.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT--;\n ZNPNode_ZPP_Compound.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Compound\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT++;\n ZNPNode_ZPP_Compound.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Compound{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Compound):ZNPNode_ZPP_Compound{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Compound):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Compound;\n var ret:ZNPNode_ZPP_Compound;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Compound\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT++;\n ZNPNode_ZPP_Compound.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Compound,n:Int):ZNPNode_ZPP_Compound{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Compound):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Compound{\n return begin().elem();\n }\n public function back():ZPP_Compound{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_InteractionListener{\n public var head:ZNPNode_ZPP_InteractionListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_InteractionListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_InteractionListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_InteractionListener):ZPP_InteractionListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_InteractionListener):ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_TOT++;\n ZNPNode_ZPP_InteractionListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT--;\n ZNPNode_ZPP_InteractionListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_InteractionListener,o:ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_InteractionListener,o:ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_TOT++;\n ZNPNode_ZPP_InteractionListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT--;\n ZNPNode_ZPP_InteractionListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT++;\n ZNPNode_ZPP_InteractionListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_InteractionListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_InteractionListener;\n var ret:ZNPNode_ZPP_InteractionListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT++;\n ZNPNode_ZPP_InteractionListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_InteractionListener,n:Int):ZNPNode_ZPP_InteractionListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_InteractionListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_InteractionListener{\n return begin().elem();\n }\n public function back():ZPP_InteractionListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbSet{\n public var head:ZNPNode_ZPP_CbSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbSet{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbSet):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbSet):ZPP_CbSet{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbSet):ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_TOT++;\n ZNPNode_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT--;\n ZNPNode_ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbSet,o:ZPP_CbSet):ZNPNode_ZPP_CbSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbSet,o:ZPP_CbSet):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_TOT++;\n ZNPNode_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT--;\n ZNPNode_ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSet\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT++;\n ZNPNode_ZPP_CbSet.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbSet):ZNPNode_ZPP_CbSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbSet):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbSet;\n var ret:ZNPNode_ZPP_CbSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSet\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT++;\n ZNPNode_ZPP_CbSet.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbSet,n:Int):ZNPNode_ZPP_CbSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbSet{\n return begin().elem();\n }\n public function back():ZPP_CbSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Interactor{\n public var head:ZNPNode_ZPP_Interactor=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Interactor{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Interactor):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Interactor):ZPP_Interactor{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Interactor):ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Interactor.zpp_pool==null){\n ret=new ZNPNode_ZPP_Interactor();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_TOT++;\n ZNPNode_ZPP_Interactor.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT--;\n ZNPNode_ZPP_Interactor.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Interactor,o:ZPP_Interactor):ZNPNode_ZPP_Interactor{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Interactor,o:ZPP_Interactor):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Interactor.zpp_pool==null){\n ret=new ZNPNode_ZPP_Interactor();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_TOT++;\n ZNPNode_ZPP_Interactor.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT--;\n ZNPNode_ZPP_Interactor.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Interactor\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT++;\n ZNPNode_ZPP_Interactor.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Interactor{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Interactor):ZNPNode_ZPP_Interactor{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Interactor):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Interactor;\n var ret:ZNPNode_ZPP_Interactor;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Interactor\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT++;\n ZNPNode_ZPP_Interactor.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Interactor,n:Int):ZNPNode_ZPP_Interactor{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Interactor):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Interactor{\n return begin().elem();\n }\n public function back():ZPP_Interactor{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_BodyListener{\n public var head:ZNPNode_ZPP_BodyListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_BodyListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_BodyListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_BodyListener):ZPP_BodyListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_BodyListener):ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_BodyListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_BodyListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_TOT++;\n ZNPNode_ZPP_BodyListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT--;\n ZNPNode_ZPP_BodyListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_BodyListener,o:ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_BodyListener,o:ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_BodyListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_BodyListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_TOT++;\n ZNPNode_ZPP_BodyListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT--;\n ZNPNode_ZPP_BodyListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_BodyListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT++;\n ZNPNode_ZPP_BodyListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_BodyListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_BodyListener;\n var ret:ZNPNode_ZPP_BodyListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_BodyListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT++;\n ZNPNode_ZPP_BodyListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_BodyListener,n:Int):ZNPNode_ZPP_BodyListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_BodyListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_BodyListener{\n return begin().elem();\n }\n public function back():ZPP_BodyListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Arbiter{\n public var head:ZNPNode_ZPP_Arbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Arbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Arbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Arbiter):ZPP_Arbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Arbiter):ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Arbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_Arbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_TOT++;\n ZNPNode_ZPP_Arbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT--;\n ZNPNode_ZPP_Arbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Arbiter,o:ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Arbiter,o:ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Arbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_Arbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_TOT++;\n ZNPNode_ZPP_Arbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT--;\n ZNPNode_ZPP_Arbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Arbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT++;\n ZNPNode_ZPP_Arbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Arbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Arbiter;\n var ret:ZNPNode_ZPP_Arbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Arbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT++;\n ZNPNode_ZPP_Arbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Arbiter,n:Int):ZNPNode_ZPP_Arbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Arbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Arbiter{\n return begin().elem();\n }\n public function back():ZPP_Arbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ConstraintListener{\n public var head:ZNPNode_ZPP_ConstraintListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ConstraintListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ConstraintListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ConstraintListener):ZPP_ConstraintListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ConstraintListener):ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ConstraintListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_ConstraintListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_TOT++;\n ZNPNode_ZPP_ConstraintListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT--;\n ZNPNode_ZPP_ConstraintListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ConstraintListener,o:ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ConstraintListener,o:ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ConstraintListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_ConstraintListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_TOT++;\n ZNPNode_ZPP_ConstraintListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT--;\n ZNPNode_ZPP_ConstraintListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ConstraintListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT++;\n ZNPNode_ZPP_ConstraintListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ConstraintListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ConstraintListener;\n var ret:ZNPNode_ZPP_ConstraintListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ConstraintListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT++;\n ZNPNode_ZPP_ConstraintListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ConstraintListener,n:Int):ZNPNode_ZPP_ConstraintListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ConstraintListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ConstraintListener{\n return begin().elem();\n }\n public function back():ZPP_ConstraintListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbSetPair{\n public var head:ZNPNode_ZPP_CbSetPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbSetPair{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbSetPair):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbSetPair):ZPP_CbSetPair{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbSetPair):ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSetPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_TOT++;\n ZNPNode_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT--;\n ZNPNode_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbSetPair,o:ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbSetPair,o:ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSetPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_TOT++;\n ZNPNode_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT--;\n ZNPNode_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSetPair\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT++;\n ZNPNode_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbSetPair{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbSetPair;\n var ret:ZNPNode_ZPP_CbSetPair;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSetPair\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT++;\n ZNPNode_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbSetPair,n:Int):ZNPNode_ZPP_CbSetPair{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbSetPair):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbSetPair{\n return begin().elem();\n }\n public function back():ZPP_CbSetPair{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CutInt{\n public var head:ZNPNode_ZPP_CutInt=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CutInt{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CutInt):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CutInt):ZPP_CutInt{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CutInt):ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutInt.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutInt();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_TOT++;\n ZNPNode_ZPP_CutInt.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT--;\n ZNPNode_ZPP_CutInt.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CutInt,o:ZPP_CutInt):ZNPNode_ZPP_CutInt{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CutInt,o:ZPP_CutInt):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutInt.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutInt();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_TOT++;\n ZNPNode_ZPP_CutInt.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT--;\n ZNPNode_ZPP_CutInt.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutInt\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT++;\n ZNPNode_ZPP_CutInt.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CutInt{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CutInt):ZNPNode_ZPP_CutInt{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CutInt):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CutInt;\n var ret:ZNPNode_ZPP_CutInt;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutInt\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT++;\n ZNPNode_ZPP_CutInt.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CutInt,n:Int):ZNPNode_ZPP_CutInt{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CutInt):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CutInt{\n return begin().elem();\n }\n public function back():ZPP_CutInt{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CutVert{\n public var head:ZNPNode_ZPP_CutVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CutVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CutVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CutVert):ZPP_CutVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CutVert):ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_TOT++;\n ZNPNode_ZPP_CutVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT--;\n ZNPNode_ZPP_CutVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CutVert,o:ZPP_CutVert):ZNPNode_ZPP_CutVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CutVert,o:ZPP_CutVert):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_TOT++;\n ZNPNode_ZPP_CutVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT--;\n ZNPNode_ZPP_CutVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT++;\n ZNPNode_ZPP_CutVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CutVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CutVert):ZNPNode_ZPP_CutVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CutVert):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CutVert;\n var ret:ZNPNode_ZPP_CutVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT++;\n ZNPNode_ZPP_CutVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CutVert,n:Int):ZNPNode_ZPP_CutVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CutVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CutVert{\n return begin().elem();\n }\n public function back():ZPP_CutVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_PartitionVertex{\n public var head:ZNPNode_ZPP_PartitionVertex=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_PartitionVertex{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_PartitionVertex):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_PartitionVertex):ZPP_PartitionVertex{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_PartitionVertex):ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionVertex.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_TOT++;\n ZNPNode_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT--;\n ZNPNode_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_PartitionVertex,o:ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_PartitionVertex,o:ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionVertex.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_TOT++;\n ZNPNode_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT--;\n ZNPNode_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionVertex\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT++;\n ZNPNode_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_PartitionVertex{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_PartitionVertex;\n var ret:ZNPNode_ZPP_PartitionVertex;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionVertex\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT++;\n ZNPNode_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_PartitionVertex,n:Int):ZNPNode_ZPP_PartitionVertex{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_PartitionVertex):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_PartitionVertex{\n return begin().elem();\n }\n public function back():ZPP_PartitionVertex{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_PartitionedPoly{\n public var head:ZNPNode_ZPP_PartitionedPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_PartitionedPoly{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_PartitionedPoly):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_PartitionedPoly):ZPP_PartitionedPoly{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_PartitionedPoly):ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionedPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionedPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_TOT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT--;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_PartitionedPoly,o:ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_PartitionedPoly,o:ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionedPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionedPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_TOT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT--;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionedPoly\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_PartitionedPoly{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_PartitionedPoly;\n var ret:ZNPNode_ZPP_PartitionedPoly;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionedPoly\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_PartitionedPoly,n:Int):ZNPNode_ZPP_PartitionedPoly{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_PartitionedPoly):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_PartitionedPoly{\n return begin().elem();\n }\n public function back():ZPP_PartitionedPoly{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_GeomVert{\n public var head:ZNPNode_ZPP_GeomVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_GeomVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_GeomVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_GeomVert):ZPP_GeomVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_GeomVert):ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_TOT++;\n ZNPNode_ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT--;\n ZNPNode_ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_GeomVert,o:ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_GeomVert,o:ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_TOT++;\n ZNPNode_ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT--;\n ZNPNode_ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT++;\n ZNPNode_ZPP_GeomVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_GeomVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_GeomVert;\n var ret:ZNPNode_ZPP_GeomVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT++;\n ZNPNode_ZPP_GeomVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_GeomVert,n:Int):ZNPNode_ZPP_GeomVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_GeomVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_GeomVert{\n return begin().elem();\n }\n public function back():ZPP_GeomVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimplifyP{\n public var head:ZNPNode_ZPP_SimplifyP=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimplifyP{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimplifyP):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimplifyP):ZPP_SimplifyP{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimplifyP):ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimplifyP.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimplifyP();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_TOT++;\n ZNPNode_ZPP_SimplifyP.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT--;\n ZNPNode_ZPP_SimplifyP.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimplifyP,o:ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimplifyP,o:ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimplifyP.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimplifyP();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_TOT++;\n ZNPNode_ZPP_SimplifyP.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT--;\n ZNPNode_ZPP_SimplifyP.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimplifyP\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT++;\n ZNPNode_ZPP_SimplifyP.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimplifyP{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimplifyP;\n var ret:ZNPNode_ZPP_SimplifyP;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimplifyP\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT++;\n ZNPNode_ZPP_SimplifyP.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimplifyP,n:Int):ZNPNode_ZPP_SimplifyP{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimplifyP):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimplifyP{\n return begin().elem();\n }\n public function back():ZPP_SimplifyP{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimpleVert{\n public var head:ZNPNode_ZPP_SimpleVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimpleVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimpleVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimpleVert):ZPP_SimpleVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimpleVert):ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_TOT++;\n ZNPNode_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT--;\n ZNPNode_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimpleVert,o:ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimpleVert,o:ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_TOT++;\n ZNPNode_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT--;\n ZNPNode_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT++;\n ZNPNode_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimpleVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimpleVert;\n var ret:ZNPNode_ZPP_SimpleVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT++;\n ZNPNode_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimpleVert,n:Int):ZNPNode_ZPP_SimpleVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimpleVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimpleVert{\n return begin().elem();\n }\n public function back():ZPP_SimpleVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimpleEvent{\n public var head:ZNPNode_ZPP_SimpleEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimpleEvent{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimpleEvent):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimpleEvent):ZPP_SimpleEvent{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimpleEvent):ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_TOT++;\n ZNPNode_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT--;\n ZNPNode_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimpleEvent,o:ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimpleEvent,o:ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_TOT++;\n ZNPNode_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT--;\n ZNPNode_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleEvent\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT++;\n ZNPNode_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimpleEvent{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimpleEvent;\n var ret:ZNPNode_ZPP_SimpleEvent;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleEvent\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT++;\n ZNPNode_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimpleEvent,n:Int):ZNPNode_ZPP_SimpleEvent{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimpleEvent):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimpleEvent{\n return begin().elem();\n }\n public function back():ZPP_SimpleEvent{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_AABBPair{\n public var head:ZNPNode_ZPP_AABBPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_AABBPair{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_AABBPair):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_AABBPair):ZPP_AABBPair{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_AABBPair):ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_TOT++;\n ZNPNode_ZPP_AABBPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT--;\n ZNPNode_ZPP_AABBPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_AABBPair,o:ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_AABBPair,o:ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_TOT++;\n ZNPNode_ZPP_AABBPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT--;\n ZNPNode_ZPP_AABBPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBPair\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT++;\n ZNPNode_ZPP_AABBPair.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_AABBPair{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_AABBPair;\n var ret:ZNPNode_ZPP_AABBPair;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBPair\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT++;\n ZNPNode_ZPP_AABBPair.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_AABBPair,n:Int):ZNPNode_ZPP_AABBPair{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_AABBPair):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_AABBPair{\n return begin().elem();\n }\n public function back():ZPP_AABBPair{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Edge{\n public var head:ZNPNode_ZPP_Edge=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Edge{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Edge):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Edge):ZPP_Edge{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Edge):ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Edge.zpp_pool==null){\n ret=new ZNPNode_ZPP_Edge();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_TOT++;\n ZNPNode_ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT--;\n ZNPNode_ZPP_Edge.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Edge,o:ZPP_Edge):ZNPNode_ZPP_Edge{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Edge,o:ZPP_Edge):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Edge.zpp_pool==null){\n ret=new ZNPNode_ZPP_Edge();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_TOT++;\n ZNPNode_ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT--;\n ZNPNode_ZPP_Edge.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Edge\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT++;\n ZNPNode_ZPP_Edge.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Edge{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Edge):ZNPNode_ZPP_Edge{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Edge):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Edge;\n var ret:ZNPNode_ZPP_Edge;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Edge\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT++;\n ZNPNode_ZPP_Edge.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Edge,n:Int):ZNPNode_ZPP_Edge{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Edge):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Edge{\n return begin().elem();\n }\n public function back():ZPP_Edge{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Vec2{\n public var head:ZNPNode_ZPP_Vec2=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Vec2{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Vec2):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Vec2):ZPP_Vec2{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Vec2.zpp_pool==null){\n ret=new ZNPNode_ZPP_Vec2();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_TOT++;\n ZNPNode_ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT--;\n ZNPNode_ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Vec2,o:ZPP_Vec2):ZNPNode_ZPP_Vec2{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Vec2,o:ZPP_Vec2):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Vec2.zpp_pool==null){\n ret=new ZNPNode_ZPP_Vec2();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_TOT++;\n ZNPNode_ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT--;\n ZNPNode_ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Vec2\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT++;\n ZNPNode_ZPP_Vec2.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Vec2{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Vec2):ZNPNode_ZPP_Vec2{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Vec2):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Vec2;\n var ret:ZNPNode_ZPP_Vec2;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Vec2\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT++;\n ZNPNode_ZPP_Vec2.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Vec2,n:Int):ZNPNode_ZPP_Vec2{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Vec2):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Vec2{\n return begin().elem();\n }\n public function back():ZPP_Vec2{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Component{\n public var head:ZNPNode_ZPP_Component=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Component{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Component):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Component):ZPP_Component{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Component):ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Component.zpp_pool==null){\n ret=new ZNPNode_ZPP_Component();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_TOT++;\n ZNPNode_ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT--;\n ZNPNode_ZPP_Component.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Component,o:ZPP_Component):ZNPNode_ZPP_Component{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Component,o:ZPP_Component):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Component.zpp_pool==null){\n ret=new ZNPNode_ZPP_Component();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_TOT++;\n ZNPNode_ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT--;\n ZNPNode_ZPP_Component.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Component\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT++;\n ZNPNode_ZPP_Component.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Component{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Component):ZNPNode_ZPP_Component{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Component):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Component;\n var ret:ZNPNode_ZPP_Component;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Component\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT++;\n ZNPNode_ZPP_Component.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Component,n:Int):ZNPNode_ZPP_Component{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Component):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Component{\n return begin().elem();\n }\n public function back():ZPP_Component{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_AABBNode{\n public var head:ZNPNode_ZPP_AABBNode=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_AABBNode{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_AABBNode):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_AABBNode):ZPP_AABBNode{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_AABBNode):ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBNode.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBNode();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_TOT++;\n ZNPNode_ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT--;\n ZNPNode_ZPP_AABBNode.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_AABBNode,o:ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_AABBNode,o:ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBNode.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBNode();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_TOT++;\n ZNPNode_ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT--;\n ZNPNode_ZPP_AABBNode.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBNode\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT++;\n ZNPNode_ZPP_AABBNode.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_AABBNode{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_AABBNode;\n var ret:ZNPNode_ZPP_AABBNode;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBNode\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT++;\n ZNPNode_ZPP_AABBNode.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_AABBNode,n:Int):ZNPNode_ZPP_AABBNode{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_AABBNode):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_AABBNode{\n return begin().elem();\n }\n public function back():ZPP_AABBNode{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_InteractionGroup{\n public var head:ZNPNode_ZPP_InteractionGroup=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_InteractionGroup{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_InteractionGroup):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_InteractionGroup):ZPP_InteractionGroup{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_InteractionGroup):ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionGroup.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionGroup();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_TOT++;\n ZNPNode_ZPP_InteractionGroup.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT--;\n ZNPNode_ZPP_InteractionGroup.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_InteractionGroup,o:ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_InteractionGroup,o:ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionGroup.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionGroup();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_TOT++;\n ZNPNode_ZPP_InteractionGroup.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT--;\n ZNPNode_ZPP_InteractionGroup.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionGroup\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT++;\n ZNPNode_ZPP_InteractionGroup.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_InteractionGroup{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_InteractionGroup;\n var ret:ZNPNode_ZPP_InteractionGroup;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionGroup\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT++;\n ZNPNode_ZPP_InteractionGroup.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_InteractionGroup,n:Int):ZNPNode_ZPP_InteractionGroup{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_InteractionGroup):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_InteractionGroup{\n return begin().elem();\n }\n public function back():ZPP_InteractionGroup{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_FluidArbiter{\n public var head:ZNPNode_ZPP_FluidArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_FluidArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_FluidArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_FluidArbiter):ZPP_FluidArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_FluidArbiter):ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_TOT++;\n ZNPNode_ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT--;\n ZNPNode_ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_FluidArbiter,o:ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_FluidArbiter,o:ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_TOT++;\n ZNPNode_ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT--;\n ZNPNode_ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_FluidArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT++;\n ZNPNode_ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_FluidArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_FluidArbiter;\n var ret:ZNPNode_ZPP_FluidArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_FluidArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT++;\n ZNPNode_ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_FluidArbiter,n:Int):ZNPNode_ZPP_FluidArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_FluidArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_FluidArbiter{\n return begin().elem();\n }\n public function back():ZPP_FluidArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SensorArbiter{\n public var head:ZNPNode_ZPP_SensorArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SensorArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SensorArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SensorArbiter):ZPP_SensorArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SensorArbiter):ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_TOT++;\n ZNPNode_ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT--;\n ZNPNode_ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SensorArbiter,o:ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SensorArbiter,o:ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_TOT++;\n ZNPNode_ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT--;\n ZNPNode_ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SensorArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT++;\n ZNPNode_ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SensorArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SensorArbiter;\n var ret:ZNPNode_ZPP_SensorArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SensorArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT++;\n ZNPNode_ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SensorArbiter,n:Int):ZNPNode_ZPP_SensorArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SensorArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SensorArbiter{\n return begin().elem();\n }\n public function back():ZPP_SensorArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ColArbiter{\n public var head:ZNPNode_ZPP_ColArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ColArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ColArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ColArbiter):ZPP_ColArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ColArbiter):ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ColArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_TOT++;\n ZNPNode_ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT--;\n ZNPNode_ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ColArbiter,o:ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ColArbiter,o:ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ColArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_TOT++;\n ZNPNode_ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT--;\n ZNPNode_ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ColArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT++;\n ZNPNode_ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ColArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ColArbiter;\n var ret:ZNPNode_ZPP_ColArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ColArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT++;\n ZNPNode_ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ColArbiter,n:Int):ZNPNode_ZPP_ColArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ColArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ColArbiter{\n return begin().elem();\n }\n public function back():ZPP_ColArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Listener{\n public var head:ZNPNode_ZPP_Listener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Listener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Listener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Listener):ZPP_Listener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Listener):ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Listener.zpp_pool==null){\n ret=new ZNPNode_ZPP_Listener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_TOT++;\n ZNPNode_ZPP_Listener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT--;\n ZNPNode_ZPP_Listener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Listener,o:ZPP_Listener):ZNPNode_ZPP_Listener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Listener,o:ZPP_Listener):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Listener.zpp_pool==null){\n ret=new ZNPNode_ZPP_Listener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_TOT++;\n ZNPNode_ZPP_Listener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT--;\n ZNPNode_ZPP_Listener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Listener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT++;\n ZNPNode_ZPP_Listener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Listener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Listener):ZNPNode_ZPP_Listener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Listener):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Listener;\n var ret:ZNPNode_ZPP_Listener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Listener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT++;\n ZNPNode_ZPP_Listener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Listener,n:Int):ZNPNode_ZPP_Listener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Listener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Listener{\n return begin().elem();\n }\n public function back():ZPP_Listener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ToiEvent{\n public var head:ZNPNode_ZPP_ToiEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ToiEvent{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ToiEvent):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ToiEvent):ZPP_ToiEvent{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ToiEvent):ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ToiEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_TOT++;\n ZNPNode_ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT--;\n ZNPNode_ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ToiEvent,o:ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ToiEvent,o:ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ToiEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_TOT++;\n ZNPNode_ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT--;\n ZNPNode_ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ToiEvent\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT++;\n ZNPNode_ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ToiEvent{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ToiEvent;\n var ret:ZNPNode_ZPP_ToiEvent;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ToiEvent\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT++;\n ZNPNode_ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ToiEvent,n:Int):ZNPNode_ZPP_ToiEvent{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ToiEvent):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ToiEvent{\n return begin().elem();\n }\n public function back():ZPP_ToiEvent{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ConvexResult{\n public var head:ZNPNode_ConvexResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ConvexResult{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ConvexResult):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ConvexResult):ConvexResult{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ConvexResult):ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ConvexResult.zpp_pool==null){\n ret=new ZNPNode_ConvexResult();\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_TOT++;\n ZNPNode_ConvexResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT--;\n ZNPNode_ConvexResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ConvexResult,o:ConvexResult):ZNPNode_ConvexResult{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ConvexResult,o:ConvexResult):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ConvexResult.zpp_pool==null){\n ret=new ZNPNode_ConvexResult();\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_TOT++;\n ZNPNode_ConvexResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT--;\n ZNPNode_ConvexResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ConvexResult\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT++;\n ZNPNode_ConvexResult.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ConvexResult{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ConvexResult):ZNPNode_ConvexResult{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ConvexResult):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ConvexResult;\n var ret:ZNPNode_ConvexResult;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ConvexResult\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT++;\n ZNPNode_ConvexResult.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ConvexResult,n:Int):ZNPNode_ConvexResult{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ConvexResult):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ConvexResult{\n return begin().elem();\n }\n public function back():ConvexResult{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_GeomPoly{\n public var head:ZNPNode_ZPP_GeomPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_GeomPoly{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_GeomPoly):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_GeomPoly):ZPP_GeomPoly{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_GeomPoly):ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_TOT++;\n ZNPNode_ZPP_GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT--;\n ZNPNode_ZPP_GeomPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_GeomPoly,o:ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_GeomPoly,o:ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_TOT++;\n ZNPNode_ZPP_GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT--;\n ZNPNode_ZPP_GeomPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomPoly\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT++;\n ZNPNode_ZPP_GeomPoly.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_GeomPoly{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_GeomPoly;\n var ret:ZNPNode_ZPP_GeomPoly;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomPoly\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT++;\n ZNPNode_ZPP_GeomPoly.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_GeomPoly,n:Int):ZNPNode_ZPP_GeomPoly{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_GeomPoly):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_GeomPoly{\n return begin().elem();\n }\n public function back():ZPP_GeomPoly{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_RayResult{\n public var head:ZNPNode_RayResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_RayResult{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_RayResult):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:RayResult):RayResult{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:RayResult):RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_RayResult.zpp_pool==null){\n ret=new ZNPNode_RayResult();\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_TOT++;\n ZNPNode_RayResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT--;\n ZNPNode_RayResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_RayResult,o:RayResult):ZNPNode_RayResult{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_RayResult,o:RayResult):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_RayResult.zpp_pool==null){\n ret=new ZNPNode_RayResult();\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_TOT++;\n ZNPNode_RayResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT--;\n ZNPNode_RayResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_RayResult\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT++;\n ZNPNode_RayResult.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():RayResult{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_RayResult):ZNPNode_RayResult{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_RayResult):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_RayResult;\n var ret:ZNPNode_RayResult;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_RayResult\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT++;\n ZNPNode_RayResult.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_RayResult,n:Int):ZNPNode_RayResult{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:RayResult):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():RayResult{\n return begin().elem();\n }\n public function back():RayResult{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbType{\n static public var zpp_pool:ZNPNode_ZPP_CbType=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbType=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbType=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbType{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CallbackSet{\n static public var zpp_pool:ZNPNode_ZPP_CallbackSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CallbackSet=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CallbackSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CallbackSet{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Shape{\n static public var zpp_pool:ZNPNode_ZPP_Shape=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Shape=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Shape=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Shape{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Body{\n static public var zpp_pool:ZNPNode_ZPP_Body=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Body=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Body=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Body{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Constraint{\n static public var zpp_pool:ZNPNode_ZPP_Constraint=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Constraint=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Constraint=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Constraint{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Compound{\n static public var zpp_pool:ZNPNode_ZPP_Compound=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Compound=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Compound=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Compound{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_InteractionListener{\n static public var zpp_pool:ZNPNode_ZPP_InteractionListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_InteractionListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_InteractionListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_InteractionListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbSet{\n static public var zpp_pool:ZNPNode_ZPP_CbSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbSet=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbSet{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Interactor{\n static public var zpp_pool:ZNPNode_ZPP_Interactor=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Interactor=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Interactor=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Interactor{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_BodyListener{\n static public var zpp_pool:ZNPNode_ZPP_BodyListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_BodyListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_BodyListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_BodyListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Arbiter{\n static public var zpp_pool:ZNPNode_ZPP_Arbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Arbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Arbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Arbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ConstraintListener{\n static public var zpp_pool:ZNPNode_ZPP_ConstraintListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ConstraintListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ConstraintListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ConstraintListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbSetPair{\n static public var zpp_pool:ZNPNode_ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbSetPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbSetPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbSetPair{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CutInt{\n static public var zpp_pool:ZNPNode_ZPP_CutInt=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CutInt=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CutInt=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CutInt{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CutVert{\n static public var zpp_pool:ZNPNode_ZPP_CutVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CutVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CutVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CutVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_PartitionVertex{\n static public var zpp_pool:ZNPNode_ZPP_PartitionVertex=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_PartitionVertex=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_PartitionVertex=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_PartitionVertex{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_PartitionedPoly{\n static public var zpp_pool:ZNPNode_ZPP_PartitionedPoly=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_PartitionedPoly=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_PartitionedPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_PartitionedPoly{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_GeomVert{\n static public var zpp_pool:ZNPNode_ZPP_GeomVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_GeomVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_GeomVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_GeomVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimplifyP{\n static public var zpp_pool:ZNPNode_ZPP_SimplifyP=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimplifyP=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimplifyP=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimplifyP{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimpleVert{\n static public var zpp_pool:ZNPNode_ZPP_SimpleVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimpleVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimpleVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimpleVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimpleEvent{\n static public var zpp_pool:ZNPNode_ZPP_SimpleEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimpleEvent=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimpleEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimpleEvent{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_AABBPair{\n static public var zpp_pool:ZNPNode_ZPP_AABBPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_AABBPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_AABBPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_AABBPair{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Edge{\n static public var zpp_pool:ZNPNode_ZPP_Edge=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Edge=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Edge=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Edge{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Vec2{\n static public var zpp_pool:ZNPNode_ZPP_Vec2=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Vec2=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Vec2{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Component{\n static public var zpp_pool:ZNPNode_ZPP_Component=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Component=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Component=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Component{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_AABBNode{\n static public var zpp_pool:ZNPNode_ZPP_AABBNode=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_AABBNode=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_AABBNode=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_AABBNode{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_InteractionGroup{\n static public var zpp_pool:ZNPNode_ZPP_InteractionGroup=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_InteractionGroup=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_InteractionGroup=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_InteractionGroup{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_FluidArbiter{\n static public var zpp_pool:ZNPNode_ZPP_FluidArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_FluidArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_FluidArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_FluidArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SensorArbiter{\n static public var zpp_pool:ZNPNode_ZPP_SensorArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SensorArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SensorArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SensorArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ColArbiter{\n static public var zpp_pool:ZNPNode_ZPP_ColArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ColArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ColArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ColArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Listener{\n static public var zpp_pool:ZNPNode_ZPP_Listener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Listener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Listener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Listener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ToiEvent{\n static public var zpp_pool:ZNPNode_ZPP_ToiEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ToiEvent=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ToiEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ToiEvent{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ConvexResult{\n static public var zpp_pool:ZNPNode_ConvexResult=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ConvexResult=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ConvexResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ConvexResult{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_GeomPoly{\n static public var zpp_pool:ZNPNode_ZPP_GeomPoly=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_GeomPoly=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_GeomPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_GeomPoly{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_RayResult{\n static public var zpp_pool:ZNPNode_RayResult=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_RayResult=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:RayResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():RayResult{\n return elt;\n }\n}\n\n#if nape_swc@:keep #end\nclass ZPP_MixVec2List extends Vec2List{\n public var inner:ZPP_Vec2=null;\n public var _length:Int=0;\n public var zip_length:Bool=false;\n public var at_ite:ZPP_Vec2=null;\n public var at_index:Int=0;\n public static function get(list:ZPP_Vec2,immutable=false):ZPP_MixVec2List{\n var ret=new ZPP_MixVec2List();\n ret.inner=list;\n ret.zpp_inner.immutable=immutable;\n return ret;\n }\n public function new(){\n super();\n at_ite=null;\n at_index=0;\n zip_length=true;\n _length=0;\n }\n public override function zpp_gl():Int{\n zpp_vm();\n if(zip_length){\n _length=0;\n {\n var cx_ite=inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)_length++;\n cx_ite=cx_ite.next;\n }\n };\n zip_length=false;\n }\n return _length;\n }\n public override function zpp_vm():Void{\n zpp_inner.validate();\n if(inner.modified){\n zip_length=true;\n _length=0;\n at_ite=null;\n }\n }\n #if nape_swc@:keep #end\n public override function at(index:Int):Vec2{\n zpp_vm();\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=length-1-index;\n if(indexVoid=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Constraint->Bool=null;\n public var post_adder:Constraint->Void=null;\n public var subber:Constraint->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Constraint,imm:Bool=false):ConstraintList{\n var ret=new ConstraintList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Constraint=null;\n public var push_ite:ZNPNode_ZPP_Constraint=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Constraint();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_BodyList{\n public var outer:BodyList=null;\n public var inner:ZNPList_ZPP_Body=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_BodyList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Body->Bool=null;\n public var post_adder:Body->Void=null;\n public var subber:Body->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Body,imm:Bool=false):BodyList{\n var ret=new BodyList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Body=null;\n public var push_ite:ZNPNode_ZPP_Body=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Body();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractorList{\n public var outer:InteractorList=null;\n public var inner:ZNPList_ZPP_Interactor=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_InteractorList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Interactor->Bool=null;\n public var post_adder:Interactor->Void=null;\n public var subber:Interactor->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Interactor,imm:Bool=false):InteractorList{\n var ret=new InteractorList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Interactor=null;\n public var push_ite:ZNPNode_ZPP_Interactor=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Interactor();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CompoundList{\n public var outer:CompoundList=null;\n public var inner:ZNPList_ZPP_Compound=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_CompoundList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Compound->Bool=null;\n public var post_adder:Compound->Void=null;\n public var subber:Compound->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Compound,imm:Bool=false):CompoundList{\n var ret=new CompoundList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Compound=null;\n public var push_ite:ZNPNode_ZPP_Compound=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Compound();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ListenerList{\n public var outer:ListenerList=null;\n public var inner:ZNPList_ZPP_Listener=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ListenerList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Listener->Bool=null;\n public var post_adder:Listener->Void=null;\n public var subber:Listener->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Listener,imm:Bool=false):ListenerList{\n var ret=new ListenerList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Listener=null;\n public var push_ite:ZNPNode_ZPP_Listener=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Listener();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CbTypeList{\n public var outer:CbTypeList=null;\n public var inner:ZNPList_ZPP_CbType=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_CbTypeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:CbType->Bool=null;\n public var post_adder:CbType->Void=null;\n public var subber:CbType->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_CbType,imm:Bool=false):CbTypeList{\n var ret=new CbTypeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_CbType=null;\n public var push_ite:ZNPNode_ZPP_CbType=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_CbType();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Vec2List{\n public var outer:Vec2List=null;\n public var inner:ZNPList_ZPP_Vec2=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_Vec2List->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Vec2->Bool=null;\n public var post_adder:Vec2->Void=null;\n public var subber:Vec2->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Vec2,imm:Bool=false):Vec2List{\n var ret=new Vec2List();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Vec2=null;\n public var push_ite:ZNPNode_ZPP_Vec2=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Vec2();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomPolyList{\n public var outer:GeomPolyList=null;\n public var inner:ZNPList_ZPP_GeomPoly=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_GeomPolyList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:GeomPoly->Bool=null;\n public var post_adder:GeomPoly->Void=null;\n public var subber:GeomPoly->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_GeomPoly,imm:Bool=false):GeomPolyList{\n var ret=new GeomPolyList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_GeomPoly=null;\n public var push_ite:ZNPNode_ZPP_GeomPoly=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_GeomPoly();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_RayResultList{\n public var outer:RayResultList=null;\n public var inner:ZNPList_RayResult=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_RayResultList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:RayResult->Bool=null;\n public var post_adder:RayResult->Void=null;\n public var subber:RayResult->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_RayResult,imm:Bool=false):RayResultList{\n var ret=new RayResultList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_RayResult=null;\n public var push_ite:ZNPNode_RayResult=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_RayResult();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ConvexResultList{\n public var outer:ConvexResultList=null;\n public var inner:ZNPList_ConvexResult=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ConvexResultList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:ConvexResult->Bool=null;\n public var post_adder:ConvexResult->Void=null;\n public var subber:ConvexResult->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ConvexResult,imm:Bool=false):ConvexResultList{\n var ret=new ConvexResultList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ConvexResult=null;\n public var push_ite:ZNPNode_ConvexResult=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ConvexResult();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_EdgeList{\n public var outer:EdgeList=null;\n public var inner:ZNPList_ZPP_Edge=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_EdgeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Edge->Bool=null;\n public var post_adder:Edge->Void=null;\n public var subber:Edge->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Edge,imm:Bool=false):EdgeList{\n var ret=new EdgeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Edge=null;\n public var push_ite:ZNPNode_ZPP_Edge=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Edge();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ShapeList{\n public var outer:ShapeList=null;\n public var inner:ZNPList_ZPP_Shape=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ShapeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Shape->Bool=null;\n public var post_adder:Shape->Void=null;\n public var subber:Shape->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Shape,imm:Bool=false):ShapeList{\n var ret=new ShapeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Shape=null;\n public var push_ite:ZNPNode_ZPP_Shape=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Shape();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractionGroupList{\n public var outer:InteractionGroupList=null;\n public var inner:ZNPList_ZPP_InteractionGroup=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_InteractionGroupList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:InteractionGroup->Bool=null;\n public var post_adder:InteractionGroup->Void=null;\n public var subber:InteractionGroup->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_InteractionGroup,imm:Bool=false):InteractionGroupList{\n var ret=new InteractionGroupList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_InteractionGroup=null;\n public var push_ite:ZNPNode_ZPP_InteractionGroup=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_InteractionGroup();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ArbiterList{\n public var outer:ArbiterList=null;\n public var inner:ZNPList_ZPP_Arbiter=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ArbiterList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Arbiter->Bool=null;\n public var post_adder:Arbiter->Void=null;\n public var subber:Arbiter->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Arbiter,imm:Bool=false):ArbiterList{\n var ret=new ArbiterList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Arbiter=null;\n public var push_ite:ZNPNode_ZPP_Arbiter=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Arbiter();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ContactList{\n public var outer:ContactList=null;\n public var inner:ZPP_Contact=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ContactList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Contact->Bool=null;\n public var post_adder:Contact->Void=null;\n public var subber:Contact->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZPP_Contact,imm:Bool=false):ContactList{\n var ret=new ContactList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZPP_Contact=null;\n public var push_ite:ZPP_Contact=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZPP_Contact();\n _invalidated=true;\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_CbType{\n public var outer:CbType=null;\n public var userData:Dynamic=null;\n public var id:Int=0;\n public var cbsets:ZNPList_ZPP_CbSet=null;\n public#if NAPE_NO_INLINE#else inline #end\n static function setlt(a:ZPP_CbType,b:ZPP_CbType):Bool{\n return a.id=[ListenerType.BODY,ListenerType.CONSTRAINT,ListenerType.INTERACTION,ListenerType.PRE];\n public static var events:Array=[CbEvent.BEGIN,CbEvent.END,CbEvent.WAKE,CbEvent.SLEEP,CbEvent.BREAK,CbEvent.PRE,CbEvent.ONGOING];\n public var precedence:Int=0;\n public var body:Null=null;\n public var constraint:Null=null;\n public var interaction:Null=null;\n public var space:Null=null;\n function new(){\n id=ZPP_ID.Listener();\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function setlt(a:ZPP_Listener,b:ZPP_Listener):Bool{\n return(a.precedence>b.precedence)||(a.precedence==b.precedence&&a.id>b.id);\n }\n public function swapEvent(event:Int):Void{}\n public function invalidate_precedence():Void{}\n public function addedToSpace():Void{}\n public function removedFromSpace():Void{}\n}\n#if nape_swc@:keep #end\nclass ZPP_BodyListener extends ZPP_Listener{\n public var outer_zn:BodyListener=null;\n public var options:ZPP_OptionType=null;\n public var handler:BodyCallback->Void=null;\n #if(!NAPE_RELEASE_BUILD)\n function immutable_options(){\n if(space!=null&&space.midstep){\n throw \"Error: Cannot change listener type options during space.step()\";\n }\n }\n #end\n public function new(options:OptionType,event:Int,handler:BodyCallback->Void){\n super();\n this.event=event;\n this.handler=handler;\n body=this;\n type=ZPP_Flags.id_ListenerType_BODY;\n this.options=options.zpp_inner;\n }\n public override function addedToSpace():Void{\n options.handler=cbtype_change;\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.addbody(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public override function removedFromSpace():Void{\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.removebody(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n options.handler=null;\n }\n function cbtype_change(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n }\n public override function invalidate_precedence():Void{\n if(space!=null){\n removedFromSpace();\n addedToSpace();\n }\n }\n public override function swapEvent(newev:Int):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(newev!=ZPP_Flags.id_CbEvent_WAKE&&newev!=ZPP_Flags.id_CbEvent_SLEEP){\n throw \"Error: BodyListener event must be either WAKE or SLEEP only\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ConstraintListener extends ZPP_Listener{\n public var outer_zn:ConstraintListener=null;\n public var options:ZPP_OptionType=null;\n public var handler:ConstraintCallback->Void=null;\n #if(!NAPE_RELEASE_BUILD)\n function immutable_options(){\n if(space!=null&&space.midstep){\n throw \"Error: Cannot change listener type options during space.step()\";\n }\n }\n #end\n public function new(options:OptionType,event:Int,handler:ConstraintCallback->Void){\n super();\n this.event=event;\n this.handler=handler;\n constraint=this;\n type=ZPP_Flags.id_ListenerType_CONSTRAINT;\n this.options=options.zpp_inner;\n }\n public override function addedToSpace():Void{\n options.handler=cbtype_change;\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.addconstraint(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public override function removedFromSpace():Void{\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.removeconstraint(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n options.handler=null;\n }\n function cbtype_change(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n }\n public override function invalidate_precedence():Void{\n if(space!=null){\n removedFromSpace();\n addedToSpace();\n }\n }\n public override function swapEvent(newev:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(newev!=ZPP_Flags.id_CbEvent_WAKE&&newev!=ZPP_Flags.id_CbEvent_SLEEP&&newev!=ZPP_Flags.id_CbEvent_BREAK){\n throw \"Error: ConstraintListener event must be either WAKE or SLEEP only\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractionListener extends ZPP_Listener{\n public var outer_zni:Null=null;\n public var outer_znp:Null=null;\n public var itype:Int=0;\n public var options1:ZPP_OptionType=null;\n public var options2:ZPP_OptionType=null;\n public var handleri:NullVoid>=null;\n public var allowSleepingCallbacks:Bool=false;\n public var pure:Bool=false;\n public var handlerp:NullNull>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setInteractionType(itype:Int){\n this.itype=itype;\n }\n public function new(options1:OptionType,options2:OptionType,event:Int,type:Int){\n super();\n this.type=type;\n interaction=this;\n this.event=event;\n this.options1=options1.zpp_inner;\n this.options2=options2.zpp_inner;\n allowSleepingCallbacks=false;\n }\n public function wake(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n type==ZPP_Flags.id_ListenerType_PRE;\n };\n if(!res)throw \"assert(\"+\"type==ZPP_Flags.id_ListenerType_PRE\"+\") :: \"+(\"waking non-pre?\");\n #end\n };\n with_union(function(cb:ZPP_CbType):Void{\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n i.wake();\n };\n cx_ite=cx_ite.next;\n }\n };\n });\n }\n \n static var UCbSet=new ZNPList_ZPP_CbSet();\n static var VCbSet=new ZNPList_ZPP_CbSet();\n static var WCbSet=new ZNPList_ZPP_CbSet();\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function CbSetset(A:ZNPList_ZPP_CbSet,B:ZNPList_ZPP_CbSet,lambda:ZPP_CbSet->ZPP_CbSet->Void):Void{\n var U=UCbSet;\n var V=VCbSet;\n var W=WCbSet;\n var aite=A.begin();\n var bite=B.begin();\n while(aite!=null&&bite!=null){\n var a=aite.elem();\n var b=bite.elem();\n if(a==b){\n W.inlined_add(a);\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_CbSet.setlt(a,b)){\n U.inlined_add(a);\n aite=aite.next;\n }\n else{\n V.inlined_add(b);\n bite=bite.next;\n }\n }\n while(aite!=null){\n U.inlined_add(aite.elem());\n aite=aite.next;\n }\n while(bite!=null){\n V.inlined_add(bite.elem());\n bite=bite.next;\n }\n {\n while(!U.empty()){\n var x=U.pop_unsafe();\n {\n var cx_ite=B.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!V.empty()){\n var x=V.pop_unsafe();\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!W.empty()){\n var x=W.pop_unsafe();\n {\n lambda(x,x);\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n };\n }\n static var UCbType=new ZNPList_ZPP_CbType();\n static var VCbType=new ZNPList_ZPP_CbType();\n static var WCbType=new ZNPList_ZPP_CbType();\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function CbTypeset(A:ZNPList_ZPP_CbType,B:ZNPList_ZPP_CbType,lambda:ZPP_CbType->ZPP_CbType->Void):Void{\n var U=UCbType;\n var V=VCbType;\n var W=WCbType;\n var aite=A.begin();\n var bite=B.begin();\n while(aite!=null&&bite!=null){\n var a=aite.elem();\n var b=bite.elem();\n if(a==b){\n W.inlined_add(a);\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_CbType.setlt(a,b)){\n U.inlined_add(a);\n aite=aite.next;\n }\n else{\n V.inlined_add(b);\n bite=bite.next;\n }\n }\n while(aite!=null){\n U.inlined_add(aite.elem());\n aite=aite.next;\n }\n while(bite!=null){\n V.inlined_add(bite.elem());\n bite=bite.next;\n }\n {\n while(!U.empty()){\n var x=U.pop_unsafe();\n {\n var cx_ite=B.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!V.empty()){\n var x=V.pop_unsafe();\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!W.empty()){\n var x=W.pop_unsafe();\n {\n lambda(x,x);\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n };\n }\n function with_uniquesets(fresh:Bool){\n var set;\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n set=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n set=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=set.next;\n set.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n set.alloc();\n };\n set.lt=ZPP_CbSetPair.setlt;\n CbTypeset(options1.includes,options2.includes,function(a:ZPP_CbType,b:ZPP_CbType):Void{\n CbSetset(a.cbsets,b.cbsets,function(a:ZPP_CbSet,b:ZPP_CbSet):Void{\n a.validate();\n b.validate();\n if(ZPP_CbSet.single_intersection(a,b,this)){\n set.try_insert(ZPP_CbSetPair.get(a,b));\n }\n });\n });\n set.clear_with(function(pair:ZPP_CbSetPair):Void{\n if(fresh)space.freshListenerType(pair.a,pair.b);\n else space.nullListenerType(pair.a,pair.b);\n {\n var o=pair;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSetPair\"+\", in obj: \"+\"pair\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT++;\n ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n });\n {\n var o=set;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"set\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function with_union(lambda:ZPP_CbType->Void):Void{\n var ite1=options1.includes.begin();\n var ite2=options2.includes.begin();\n while(ite1!=null&&ite2!=null){\n var cb1=ite1.elem();\n var cb2=ite2.elem();\n if(cb1==cb2){\n lambda(cb1);\n ite1=ite1.next;\n ite2=ite2.next;\n }\n else if(ZPP_CbType.setlt(cb1,cb2)){\n lambda(cb1);\n ite1=ite1.next;\n }\n else{\n lambda(cb2);\n ite2=ite2.next;\n }\n }\n while(ite1!=null){\n lambda(ite1.elem());\n ite1=ite1.next;\n }\n while(ite2!=null){\n lambda(ite2.elem());\n ite2=ite2.next;\n }\n }\n public override function addedToSpace():Void{\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.addint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n options1.handler=cbtype_change1;\n options2.handler=cbtype_change2;\n with_uniquesets(true);\n }\n public override function removedFromSpace():Void{\n with_uniquesets(false);\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.removeint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n options1.handler=null;\n options2.handler=null;\n }\n public override function invalidate_precedence(){\n if(space!=null){\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.removeint(this);\n cb.addint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n }\n }\n function cbtype_change1(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n cbtype_change(options1,cb,included,added);\n }\n function cbtype_change2(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n cbtype_change(options2,cb,included,added);\n }\n function cbtype_change(options:ZPP_OptionType,cb:ZPP_CbType,included:Bool,added:Bool):Void{\n space.revoke_listener(this);\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n space.unrevoke_listener(this);\n }\n public override function swapEvent(newev:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(type==ZPP_Flags.id_ListenerType_PRE){\n throw \"Error: PreListener event can only be PRE\";\n }\n else if(newev!=ZPP_Flags.id_CbEvent_BEGIN&&newev!=ZPP_Flags.id_CbEvent_END&&newev!=ZPP_Flags.id_CbEvent_ONGOING){\n throw \"Error: InteractionListener event must be either BEGIN, END, ONGOING\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_OptionType{\n public var outer:OptionType=null;\n public var handler:NullBool->Bool->Void>=null;\n public var includes:ZNPList_ZPP_CbType=null;\n public var excludes:ZNPList_ZPP_CbType=null;\n public function new(){\n includes=new ZNPList_ZPP_CbType();\n excludes=new ZNPList_ZPP_CbType();\n }\n public var wrap_includes:CbTypeList=null;\n public var wrap_excludes:CbTypeList=null;\n public function setup_includes():Void{\n wrap_includes=ZPP_CbTypeList.get(includes,true);\n }\n public function setup_excludes():Void{\n wrap_excludes=ZPP_CbTypeList.get(excludes,true);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function excluded(xs:ZNPList_ZPP_CbType):Bool{\n return nonemptyintersection(xs,excludes);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function included(xs:ZNPList_ZPP_CbType):Bool{\n return nonemptyintersection(xs,includes);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function compatible(xs:ZNPList_ZPP_CbType):Bool{\n return included(xs)&&!excluded(xs);\n }\n public function nonemptyintersection(xs:ZNPList_ZPP_CbType,ys:ZNPList_ZPP_CbType):Bool{\n var ret=false;\n var xite=xs.begin();\n var eite=ys.begin();\n while(eite!=null&&xite!=null){\n var ex=eite.elem();\n var xi=xite.elem();\n if(ex==xi){\n ret=true;\n break;\n }\n else if(ZPP_CbType.setlt(ex,xi)){\n eite=eite.next;\n }\n else{\n xite=xite.next;\n }\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function effect_change(val:ZPP_CbType,included:Bool,added:Bool):Void{\n if(included){\n if(added){\n var pre=null;\n {\n var cx_ite=includes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(val,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n includes.inlined_insert(pre,val);\n };\n else includes.remove(val);\n }\n else{\n if(added){\n var pre=null;\n {\n var cx_ite=excludes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(val,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n excludes.inlined_insert(pre,val);\n };\n else excludes.remove(val);\n }\n }\n function append_type(list:ZNPList_ZPP_CbType,val:ZPP_CbType){\n if(list==includes){\n if(!includes.has(val)){\n if(!excludes.has(val)){\n if(handler!=null)handler(val,true,true);\n else effect_change(val,true,true);\n }\n else{\n if(handler!=null)handler(val,false,false);\n else effect_change(val,false,false);\n }\n }\n }\n else{\n if(!excludes.has(val)){\n if(!includes.has(val)){\n if(handler!=null)handler(val,false,true);\n else effect_change(val,false,true);\n }\n else{\n if(handler!=null)handler(val,true,false);\n else effect_change(val,true,false);\n }\n }\n }\n }\n public function set(options:ZPP_OptionType){\n if(options!=this){\n while(!includes.empty())append_type(excludes,includes.front());\n while(!excludes.empty())append_type(includes,excludes.front());\n {\n var cx_ite=options.excludes.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n append_type(excludes,i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n append_type(includes,i);\n cx_ite=cx_ite.next;\n }\n };\n }\n return this;\n }\n public function append(list:ZNPList_ZPP_CbType,val:Dynamic){\n #if(!NAPE_RELEASE_BUILD)\n if(val==null){\n throw \"Error: Cannot append null, only CbType and CbType list values\";\n }\n #end\n if(#if flash untyped __is__(val,CbType)#else Std.is(val,CbType)#end){\n var cb:CbType=val;\n append_type(list,cb.zpp_inner);\n }\n else if(#if flash untyped __is__(val,CbTypeList)#else Std.is(val,CbTypeList)#end){\n var cbs:CbTypeList=val;\n for(cb in cbs)append_type(list,cb.zpp_inner);\n }\n else if(#if flash10#if flash untyped __is__(val,ZPP_Const.cbtypevector)#else Std.is(val,ZPP_Const.cbtypevector)#end\n #else false #end){\n #if flash10 var cbs:flash.Vector=val;\n for(cb in cbs)append_type(list,cb.zpp_inner);\n #end\n }\n else if(#if flash untyped __is__(val,Array)#else Std.is(val,Array)#end){\n var cbs:Array=val;\n for(cb in cbs){\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(cb,CbType)#else Std.is(cb,CbType)#end){\n throw \"Error: Cannot append non-CbType or CbType list value\";\n }\n #end\n var cbx:CbType=cb;\n append_type(list,cbx.zpp_inner);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot append non-CbType or CbType list value\";\n #end\n }\n }\n public static function argument(val:Dynamic):OptionType{\n return if(val==null)new OptionType();\n else if(#if flash untyped __is__(val,OptionType)#else Std.is(val,OptionType)#end)val;\n else new OptionType().including(val);\n }\n}\n","package zpp_nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Constraint{\n public var outer:Constraint=null;\n public function clear(){}\n public var id:Int=0;\n public var userData:Dynamic=null;\n public var compound:ZPP_Compound=null;\n public var space:ZPP_Space=null;\n public var active:Bool=false;\n public var stiff:Bool=false;\n public var frequency:Float=0.0;\n public var damping:Float=0.0;\n public var maxForce:Float=0.0;\n public var maxError:Float=0.0;\n public var breakUnderForce:Bool=false;\n public var breakUnderError:Bool=false;\n public var removeOnBreak:Bool=false;\n public var component:ZPP_Component=null;\n public var ignore:Bool=false;\n public var __velocity:Bool=false;\n public function new(){\n __velocity=false;\n id=ZPP_ID.Constraint();\n stiff=true;\n active=true;\n ignore=false;\n frequency=10;\n damping=1;\n maxForce=ZPP_Const.POSINF();\n maxError=ZPP_Const.POSINF();\n breakUnderForce=false;\n removeOnBreak=true;\n pre_dt=-1.0;\n cbTypes=new ZNPList_ZPP_CbType();\n }\n public function immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: Constraint::\"+name+\" cannot be set during space step()\";\n #end\n }\n public var cbTypes:ZNPList_ZPP_CbType=null;\n public var cbSet:ZPP_CbSet=null;\n public var wrap_cbTypes:CbTypeList=null;\n public function setupcbTypes(){\n wrap_cbTypes=ZPP_CbTypeList.get(cbTypes);\n wrap_cbTypes.zpp_inner.adder=wrap_cbTypes_adder;\n wrap_cbTypes.zpp_inner.subber=wrap_cbTypes_subber;\n wrap_cbTypes.zpp_inner.dontremove=true;\n #if(!NAPE_RELEASE_BUILD)\n wrap_cbTypes.zpp_inner._modifiable=immutable_cbTypes;\n #end\n }\n #if(!NAPE_RELEASE_BUILD)\n function immutable_cbTypes(){\n immutable_midstep(\"Constraint::cbTypes\");\n }\n #end\n function wrap_cbTypes_subber(pcb:CbType):Void{\n var cb=pcb.zpp_inner;\n if(cbTypes.has(cb)){\n if(space!=null){\n dealloc_cbSet();\n cb.remConstraint(this);\n }\n cbTypes.remove(cb);\n if(space!=null){\n alloc_cbSet();\n wake();\n }\n }\n }\n function wrap_cbTypes_adder(cb:CbType):Bool{\n insert_cbtype(cb.zpp_inner);\n return false;\n }\n public function insert_cbtype(cb:ZPP_CbType){\n if(!cbTypes.has(cb)){\n if(space!=null){\n dealloc_cbSet();\n cb.addConstraint(this);\n }\n {\n var pre=null;\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(cb,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n cbTypes.inlined_insert(pre,cb);\n };\n if(space!=null){\n alloc_cbSet();\n wake();\n }\n }\n }\n public function alloc_cbSet(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n space!=null;\n };\n if(!res)throw \"assert(\"+\"space!=null\"+\") :: \"+(\"space null in alloc_cbSet\");\n #end\n };\n if((cbSet=space.cbsets.get(cbTypes))!=null){\n cbSet.increment();\n cbSet.addConstraint(this);\n }\n }\n public function dealloc_cbSet(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n space!=null;\n };\n if(!res)throw \"assert(\"+\"space!=null\"+\") :: \"+(\"space null in dealloc_cbSet\");\n #end\n };\n if(cbSet!=null){\n cbSet.remConstraint(this);\n if(cbSet.decrement()){\n space.cbsets.remove(cbSet);\n {\n var o=cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSet\"+\", in obj: \"+\"cbSet\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT++;\n ZPP_CbSet.POOL_SUB++;\n #end\n };\n }\n cbSet=null;\n }\n }\n public function activate(){\n if(space!=null)activeInSpace();\n }\n public function deactivate(){\n if(space!=null)inactiveOrOutSpace();\n }\n public function addedToSpace(){\n if(active)activeInSpace();\n activeBodies();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.addConstraint(this);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function removedFromSpace(){\n if(active)inactiveOrOutSpace();\n inactiveBodies();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.remConstraint(this);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function activeInSpace(){\n alloc_cbSet();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n component==null;\n };\n if(!res)throw \"assert(\"+\"component==null\"+\") :: \"+(\"already has a component?\");\n #end\n };\n {\n if(ZPP_Component.zpp_pool==null){\n component=new ZPP_Component();\n #if NAPE_POOL_STATS ZPP_Component.POOL_TOT++;\n ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n component=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=component.next;\n component.next=null;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT--;\n ZPP_Component.POOL_ADD++;\n #end\n }\n component.alloc();\n };\n component.isBody=false;\n component.constraint=this;\n }\n public function inactiveOrOutSpace(){\n dealloc_cbSet();\n {\n var o=component;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Component\"+\", in obj: \"+\"component\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT++;\n ZPP_Component.POOL_SUB++;\n #end\n };\n component=null;\n }\n #if nape_swc@:keep #end\n public function activeBodies(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"activeBodies not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function inactiveBodies(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"inactiveBodies not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function clearcache(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"clearcache not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function validate(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"validate not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function wake_connected(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"wake_connected not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function forest(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"forest not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function pair_exists(id:Int,di:Int){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"pair_exists not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function broken(){}\n #if nape_swc@:keep #end\n public function warmStart(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"warmStart not overriden\");\n #end\n };\n }\n public var pre_dt:Float=0.0;\n #if nape_swc@:keep #end\n public function preStep(dt:Float):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"preStep not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function applyImpulseVel(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"applyImpulseVel not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function applyImpulsePos(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"applyImpulsePos not overriden\");\n #end\n };\n return false;\n }\n public function wake(){\n if(space!=null)space.wake_constraint(this);\n }\n public function draw(g:Debug){}\n public function copy(dict:Array=null,todo:Array=null):Constraint{\n return null;\n }\n public function copyto(ret:Constraint){\n var me=outer;\n for(cb in me.cbTypes)ret.cbTypes.add(cb);\n ret.removeOnBreak=me.removeOnBreak;\n ret.breakUnderError=me.breakUnderError;\n ret.breakUnderForce=me.breakUnderForce;\n ret.maxError=me.maxError;\n ret.maxForce=me.maxForce;\n ret.damping=me.damping;\n ret.frequency=me.frequency;\n ret.stiff=me.stiff;\n ret.ignore=me.ignore;\n ret.active=me.active;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CopyHelper{\n public var id:Int=0;\n public var bc:Body=null;\n public var cb:Body->Void=null;\n function new(){}\n public static function dict(id:Int,bc:Body){\n var ret=new ZPP_CopyHelper();\n ret.id=id;\n ret.bc=bc;\n return ret;\n }\n public static function todo(id:Int,cb:Body->Void){\n var ret=new ZPP_CopyHelper();\n ret.id=id;\n ret.cb=cb;\n return ret;\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Arbiter{\n public var outer:Arbiter=null;\n #if NAPE_POOL_STATS public var arbid:Int=0;\n static var nextarbid:Int=0;\n #end\n public static var internal=false;\n public function wrapper(){\n if(outer==null){\n internal=true;\n if(type==COL){\n colarb.outer_zn=new CollisionArbiter();\n outer=colarb.outer_zn;\n }\n else if(type==FLUID){\n fluidarb.outer_zn=new FluidArbiter();\n outer=fluidarb.outer_zn;\n }\n else outer=new Arbiter();\n outer.zpp_inner=this;\n internal=false;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inactiveme(){\n return!active;\n }\n public var hnext:ZPP_Arbiter=null;\n public function new(){\n #if NAPE_POOL_STATS arbid=nextarbid++;\n #end\n }\n public var id:Int=0;\n public var di:Int=0;\n public var stamp:Int=0;\n public var up_stamp:Int=0;\n public var sleep_stamp:Int=0;\n public var endGenerated:Int=0;\n public var active:Bool=false;\n public var cleared:Bool=false;\n public var sleeping:Bool=false;\n public var present:Int=0;\n public var intchange:Bool=false;\n public var presentable:Bool=false;\n public var continuous:Bool=false;\n public var fresh:Bool=false;\n public var immState:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function acting(){\n return active&&((immState&ZPP_Flags.id_ImmState_ACCEPT)!=0);\n }\n public var invalidated:Bool=false;\n public var b1:ZPP_Body=null;\n public var b2:ZPP_Body=null;\n public var ws1:ZPP_Shape=null;\n public var ws2:ZPP_Shape=null;\n public var pair:ZPP_AABBPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function swap_features(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n type==COL;\n };\n if(!res)throw \"assert(\"+\"type==COL\"+\") :: \"+(\"Arbiter::swap_features\");\n #end\n };\n {\n var t=b1;\n b1=b2;\n b2=t;\n };\n {\n var t=ws1;\n ws1=ws2;\n ws2=t;\n };\n {\n var t=colarb.s1;\n colarb.s1=colarb.s2;\n colarb.s2=t;\n };\n }\n public var type:Int=0;\n public static var COL=1;\n public static var FLUID=4;\n public static var SENSOR=2;\n static public var types:Array=[null,ArbiterType.COLLISION,ArbiterType.SENSOR,null,ArbiterType.FLUID];\n public var colarb:ZPP_ColArbiter=null;\n public var fluidarb:ZPP_FluidArbiter=null;\n public var sensorarb:ZPP_SensorArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function lazyRetire(s:ZPP_Space,b:ZPP_Body=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cleared;\n };\n if(!res)throw \"assert(\"+\"!cleared\"+\") :: \"+(\"Arbiter::lazyRetire\");\n #end\n };\n cleared=true;\n if(b==null||(b2==b))b1.arbiters.inlined_remove(this);\n if(b==null||(b1==b))b2.arbiters.inlined_remove(this);\n if(pair!=null){\n pair.arb=null;\n pair=null;\n }\n active=false;\n s.f_arbiters.modified=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sup_assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n b1=s1.body;\n ws1=s1;\n b2=s2.body;\n ws2=s2;\n this.id=id;\n this.di=di;\n b1.arbiters.inlined_add(this);\n b2.arbiters.inlined_add(this);\n active=true;\n present=0;\n cleared=false;\n sleeping=false;\n fresh=false;\n presentable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sup_retire(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b1!=null;\n };\n if(!res)throw \"assert(\"+\"b1!=null\"+\") :: \"+(\"Arbiter::sup_retire\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b2!=null;\n };\n if(!res)throw \"assert(\"+\"b2!=null\"+\") :: \"+(\"Arbiter::sup_retire\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n present==0;\n };\n if(!res)throw \"assert(\"+\"present==0\"+\") :: \"+(\"Arbiter::sup_retire cbsets present\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !intchange;\n };\n if(!res)throw \"assert(\"+\"!intchange\"+\") :: \"+(\"Arbiter::sup_retire intchange\");\n #end\n };\n if(!cleared){\n b1.arbiters.inlined_remove(this);\n b2.arbiters.inlined_remove(this);\n if(pair!=null){\n pair.arb=null;\n pair=null;\n }\n }\n b1=b2=null;\n active=false;\n intchange=false;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SensorArbiter extends ZPP_Arbiter{\n public var next:ZPP_SensorArbiter=null;\n static public var zpp_pool:ZPP_SensorArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going out of pool? (sensor)\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going into pool? (sensor)\");\n #end\n };\n }\n public function new(){\n super();\n type=ZPP_Arbiter.SENSOR;\n sensorarb=this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SensorArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT++;\n ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){}\n}\n#if nape_swc@:keep #end\nclass ZPP_FluidArbiter extends ZPP_Arbiter{\n public var outer_zn:FluidArbiter=null;\n public var next:ZPP_FluidArbiter=null;\n static public var zpp_pool:ZPP_FluidArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going out of pool? (fluid)\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going into pool? (fluid)\");\n #end\n };\n }\n public var centroidx:Float=0.0;\n public var centroidy:Float=0.0;\n public var overlap:Float=0.0;\n public var r1x:Float=0.0;\n public var r1y:Float=0.0;\n public var r2x:Float=0.0;\n public var r2y:Float=0.0;\n public var nodrag:Bool=false;\n public var wMass:Float=0.0;\n public var adamp:Float=0.0;\n public var agamma:Float=0.0;\n public var vMassa:Float=0.0;\n public var vMassb:Float=0.0;\n public var vMassc:Float=0.0;\n public var dampx:Float=0.0;\n public var dampy:Float=0.0;\n public var lgamma:Float=0.0;\n public var nx:Float=0.0;\n public var ny:Float=0.0;\n public var buoyx:Float=0.0;\n public var buoyy:Float=0.0;\n private function position_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n {\n wrap_position.zpp_inner.x=centroidx;\n wrap_position.zpp_inner.y=centroidy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.x!=wrap_position.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"centroidx\"+\",in y: \"+\"centroidy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.y!=wrap_position.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"centroidx\"+\",in y: \"+\"centroidy\"+\")\");\n #end\n };\n };\n }\n private function position_invalidate(x:ZPP_Vec2){\n {\n centroidx=x.x;\n centroidy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidx!=centroidx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidx)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidy!=centroidy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidy)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n }\n public var wrap_position:Vec2=null;\n public function getposition(){\n wrap_position=Vec2.get();\n wrap_position.zpp_inner._inuse=true;\n wrap_position.zpp_inner._immutable=!mutable;\n wrap_position.zpp_inner._validate=position_validate;\n wrap_position.zpp_inner._invalidate=position_invalidate;\n }\n public function new(){\n super();\n type=ZPP_Arbiter.FLUID;\n fluidarb=this;\n {\n buoyx=0;\n buoyy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyx!=buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyx)\"+\") :: \"+(\"vec_set(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyy!=buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyy)\"+\") :: \"+(\"vec_set(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n pre_dt=-1.0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n {\n nx=0;\n ny=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n {\n dampx=0;\n dampy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampx!=dampx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampx)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampy!=dampy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampy)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n adamp=0.0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT++;\n ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n pre_dt=-1.0;\n }\n public var mutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){\n mutable=true;\n if(wrap_position!=null)wrap_position.zpp_inner._immutable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){\n mutable=false;\n if(wrap_position!=null)wrap_position.zpp_inner._immutable=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inject(area:Float,cx:Float,cy:Float){\n overlap=area;\n {\n centroidx=cx;\n centroidy=cy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidx!=centroidx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidx)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"cx\"+\",in y: \"+\"cy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidy!=centroidy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidy)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"cx\"+\",in y: \"+\"cy\"+\")\");\n #end\n };\n };\n }\n public var pre_dt:Float=0.0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function preStep(s:ZPP_Space,dt:Float){\n if(pre_dt==-1.0)pre_dt=dt;\n var dtratio=dt/pre_dt;\n pre_dt=dt;\n {\n r1x=centroidx-b1.posx;\n r1y=centroidy-b1.posy;\n };\n {\n r2x=centroidx-b2.posx;\n r2y=centroidy-b2.posy;\n };\n var g1x:Float=0.0;\n var g1y:Float=0.0;\n if(ws1.fluidEnabled&&ws1.fluidProperties.wrap_gravity!=null){\n g1x=ws1.fluidProperties.gravityx;\n g1y=ws1.fluidProperties.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1x!=g1x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1x)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"ws1.fluidProperties.gravityx\"+\",in y: \"+\"ws1.fluidProperties.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1y!=g1y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1y)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"ws1.fluidProperties.gravityx\"+\",in y: \"+\"ws1.fluidProperties.gravityy\"+\")\");\n #end\n };\n }\n else{\n g1x=s.gravityx;\n g1y=s.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1x!=g1x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1x)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1y!=g1y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1y)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n };\n var g2x:Float=0.0;\n var g2y:Float=0.0;\n if(ws2.fluidEnabled&&ws2.fluidProperties.wrap_gravity!=null){\n g2x=ws2.fluidProperties.gravityx;\n g2y=ws2.fluidProperties.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2x!=g2x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2x)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"ws2.fluidProperties.gravityx\"+\",in y: \"+\"ws2.fluidProperties.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2y!=g2y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2y)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"ws2.fluidProperties.gravityx\"+\",in y: \"+\"ws2.fluidProperties.gravityy\"+\")\");\n #end\n };\n }\n else{\n g2x=s.gravityx;\n g2y=s.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2x!=g2x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2x)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2y!=g2y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2y)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n };\n var buoyx:Float=0;\n var buoyy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyx!=buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyx)\"+\") :: \"+(\"vec_new(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyy!=buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyy)\"+\") :: \"+(\"vec_new(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n if(ws1.fluidEnabled&&ws2.fluidEnabled){\n var mass1=overlap*ws1.fluidProperties.density;\n var mass2=overlap*ws2.fluidProperties.density;\n if(mass1>mass2){\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g1\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx-=g1x*t;\n buoyy-=g1y*t;\n };\n else if(mass1(ws2.worldCOMx*gx+ws2.worldCOMy*gy)){\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx-=gx*t;\n buoyy-=gy*t;\n };\n else{\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"buoy\"+\",in b: \"+\"g\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx+=gx*t;\n buoyy+=gy*t;\n };\n }\n }\n else if(ws1.fluidEnabled){\n var mass=overlap*ws1.fluidProperties.density;\n {\n var t=(mass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g1\"+\",in s: \"+\"mass\"+\")\");\n #end\n };\n buoyx-=g1x*t;\n buoyy-=g1y*t;\n };\n }\n else if(ws2.fluidEnabled){\n var mass=overlap*ws2.fluidProperties.density;\n {\n var t=(mass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"buoy\"+\",in b: \"+\"g2\"+\",in s: \"+\"mass\"+\")\");\n #end\n };\n buoyx+=g2x*t;\n buoyy+=g2y*t;\n };\n }\n {\n var t=(dt);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"buoy\"+\",in s: \"+\"dt\"+\")\");\n #end\n };\n buoyx*=t;\n buoyy*=t;\n };\n {\n this.buoyx=buoyx;\n this.buoyy=buoyy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.buoyx!=this.buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.buoyx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.buoy\"+\",in x: \"+\"buoyx\"+\",in y: \"+\"buoyy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.buoyy!=this.buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.buoyy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.buoy\"+\",in x: \"+\"buoyx\"+\",in y: \"+\"buoyy\"+\")\");\n #end\n };\n };\n if(b1.isDynamic()){\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"buoy\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=buoyx*t;\n b1.vely-=buoyy*t;\n };\n b1.angvel-=(buoyy*r1x-buoyx*r1y)*b1.iinertia;\n }\n if(b2.isDynamic()){\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"buoy\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=buoyx*t;\n b2.vely+=buoyy*t;\n };\n b2.angvel+=(buoyy*r2x-buoyx*r2y)*b2.iinertia;\n }\n if((!ws1.fluidEnabled||ws1.fluidProperties.viscosity==0)&&(!ws2.fluidEnabled||ws2.fluidProperties.viscosity==0)){\n nodrag=true;\n {\n dampx=0;\n dampy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampx!=dampx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampx)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampy!=dampy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampy)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n adamp=0;\n }\n else{\n nodrag=false;\n var tViscosity=0.0;\n if(ws1.fluidEnabled){\n ws2.validate_angDrag();\n tViscosity+=ws1.fluidProperties.viscosity*ws2.angDrag*overlap/ws2.area;\n }\n if(ws2.fluidEnabled){\n ws1.validate_angDrag();\n tViscosity+=ws2.fluidProperties.viscosity*ws1.angDrag*overlap/ws1.area;\n }\n if(tViscosity!=0){\n var iSum=b1.sinertia+b2.sinertia;\n if(iSum!=0)wMass=1/iSum;\n else wMass=0.0;\n var biasCoef;\n tViscosity*=0.0004;\n wMass*={\n var omega=2*Math.PI*tViscosity;\n agamma=1/(dt*omega*(2*1+omega*dt));\n var ig=1/(1+agamma);\n biasCoef=dt*omega*omega*agamma;\n agamma*=ig;\n ig;\n };\n }\n else{\n wMass=0.0;\n agamma=0.0;\n }\n var vrnx:Float=(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel));\n var vrny:Float=(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vrnx!=vrnx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vrnx)\"+\") :: \"+(\"vec_new(in n: \"+\"vrn\"+\",in x: \"+\"(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel))\"+\",in y: \"+\"(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel))\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vrny!=vrny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vrny)\"+\") :: \"+(\"vec_new(in n: \"+\"vrn\"+\",in x: \"+\"(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel))\"+\",in y: \"+\"(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel))\"+\")\");\n #end\n };\n if((vrnx*vrnx+vrny*vrny)<(Config.epsilon*Config.epsilon)){}\n else{\n {\n var d=(vrnx*vrnx+vrny*vrny);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"vrn\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"vrn\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n vrnx*=t;\n vrny*=t;\n };\n };\n {\n nx=vrnx;\n ny=vrny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"vrnx\"+\",in y: \"+\"vrny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"vrnx\"+\",in y: \"+\"vrny\"+\")\");\n #end\n };\n };\n }\n var tViscosity=0.0;\n if(ws1.fluidEnabled){\n var f=-ws1.fluidProperties.viscosity*overlap/ws2.area;\n if(ws2.type==ZPP_Flags.id_ShapeType_CIRCLE)tViscosity-=f*ws2.circle.radius*Config.fluidLinearDrag/(2*ws2.circle.radius*Math.PI);\n else{\n var poly=ws2.polygon;\n var bord=0.0;\n var acc=0.0;\n {\n var cx_ite=poly.edges.begin();\n while(cx_ite!=null){\n var ex=cx_ite.elem();\n {\n bord+=ex.length;\n var fact=f*ex.length*(ex.gnormx*nx+ex.gnormy*ny);\n if(fact>0)fact=fact*=-Config.fluidVacuumDrag;\n acc-=fact*0.5*Config.fluidLinearDrag;\n };\n cx_ite=cx_ite.next;\n }\n };\n tViscosity+=acc/bord;\n }\n }\n if(ws2.fluidEnabled){\n var f=-ws2.fluidProperties.viscosity*overlap/ws1.area;\n if(ws1.type==ZPP_Flags.id_ShapeType_CIRCLE)tViscosity-=f*ws1.circle.radius*Config.fluidLinearDrag/(2*ws1.circle.radius*Math.PI);\n else{\n var poly=ws1.polygon;\n var bord=0.0;\n var acc=0.0;\n {\n var cx_ite=poly.edges.begin();\n while(cx_ite!=null){\n var ex=cx_ite.elem();\n {\n bord+=ex.length;\n var fact=f*ex.length*(ex.gnormx*nx+ex.gnormy*ny);\n if(fact>0)fact=fact*=-Config.fluidVacuumDrag;\n acc-=fact*0.5*Config.fluidLinearDrag;\n };\n cx_ite=cx_ite.next;\n }\n };\n tViscosity+=acc/bord;\n }\n }\n if(tViscosity!=0){\n var m=b1.smass+b2.smass;\n var Ka:Float=0.0;\n var Kb:Float=0.0;\n var Kc:Float=0.0;\n {\n Ka=m;\n Kb=0;\n Kc=m;\n };\n if(b1.sinertia!=0){\n var X=r1x*b1.sinertia;\n var Y=r1y*b1.sinertia;\n {\n Ka+=Y*r1y;\n Kb+=-Y*r1x;\n Kc+=X*r1x;\n };\n };\n if(b2.sinertia!=0){\n var X=r2x*b2.sinertia;\n var Y=r2y*b2.sinertia;\n {\n Ka+=Y*r2y;\n Kb+=-Y*r2x;\n Kc+=X*r2x;\n };\n };\n {\n var det=(Ka*Kc-Kb*Kb);\n if((det!=det)){\n Ka=Kb=Kc=0;\n 3;\n }\n else if(det==0){\n var flag=0;\n if(Ka!=0)Ka=1/Ka;\n else{\n Ka=0;\n flag|=1;\n }\n if(Kc!=0)Kc=1/Kc;\n else{\n Kc=0;\n flag|=2;\n }\n Kb=0;\n flag;\n }\n else{\n det=1/det;\n var t=Kc*det;\n Kc=Ka*det;\n Ka=t;\n Kb*=-det;\n 0;\n }\n };\n {\n vMassa=Ka;\n vMassb=Kb;\n vMassc=Kc;\n };\n var biasCoef;\n {\n var X=({\n var omega=2*Math.PI*tViscosity;\n lgamma=1/(dt*omega*(2*1+omega*dt));\n var ig=1/(1+lgamma);\n biasCoef=dt*omega*omega*lgamma;\n lgamma*=ig;\n ig;\n });\n vMassa*=X;\n vMassb*=X;\n vMassc*=X;\n };\n }\n else{\n {\n vMassa=0;\n vMassb=0;\n vMassc=0;\n };\n lgamma=0.0;\n }\n }\n {\n var t=(dtratio);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"damp\"+\",in s: \"+\"dtratio\"+\")\");\n #end\n };\n dampx*=t;\n dampy*=t;\n };\n adamp*=dtratio;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function warmStart(){\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"damp\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=dampx*t;\n b1.vely-=dampy*t;\n };\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"damp\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=dampx*t;\n b2.vely+=dampy*t;\n };\n b1.angvel-=b1.iinertia*(dampy*r1x-dampx*r1y);\n b2.angvel+=b2.iinertia*(dampy*r2x-dampx*r2y);\n b1.angvel-=adamp*b1.iinertia;\n b2.angvel+=adamp*b2.iinertia;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function applyImpulseVel(){\n if(!nodrag){\n var w1=b1.angvel+b1.kinangvel;\n var w2=b2.angvel+b2.kinangvel;\n var jx:Float=(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2);\n var jy:Float=(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jx!=jx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jx)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2)\"+\",in y: \"+\"(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2)\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jy!=jy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jy)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2)\"+\",in y: \"+\"(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2)\"+\")\");\n #end\n };\n {\n var t=vMassa*jx+vMassb*jy;\n jy=vMassb*jx+vMassc*jy;\n jx=t;\n };\n {\n var t=(lgamma);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"j\"+\",in b: \"+\"damp\"+\",in s: \"+\"lgamma\"+\")\");\n #end\n };\n jx-=dampx*t;\n jy-=dampy*t;\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"damp\"+\",in b: \"+\"j\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n dampx+=jx*t;\n dampy+=jy*t;\n };\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"j\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=jx*t;\n b1.vely-=jy*t;\n };\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"j\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=jx*t;\n b2.vely+=jy*t;\n };\n b1.angvel-=b1.iinertia*(jy*r1x-jx*r1y);\n b2.angvel+=b2.iinertia*(jy*r2x-jx*r2y);\n var j_damp=(w1-w2)*wMass-adamp*agamma;\n adamp+=j_damp;\n b1.angvel-=j_damp*b1.iinertia;\n b2.angvel+=j_damp*b2.iinertia;\n }\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ColArbiter extends ZPP_Arbiter{\n public var outer_zn:CollisionArbiter=null;\n public var dyn_fric:Float=0.0;\n public var stat_fric:Float=0.0;\n public var restitution:Float=0.0;\n public var rfric:Float=0.0;\n public var userdef_dyn_fric:Bool=false;\n public var userdef_stat_fric:Bool=false;\n public var userdef_restitution:Bool=false;\n public var userdef_rfric:Bool=false;\n public var s1:ZPP_Shape=null;\n public var s2:ZPP_Shape=null;\n public var contacts:ZPP_Contact=null;\n public var wrap_contacts:ContactList=null;\n public var innards:ZPP_IContact=null;\n public var nx:Float=0.0;\n public var ny:Float=0.0;\n private function normal_validate(){\n if(cleared)throw \"Error: Arbiter not currently in use\";\n {\n wrap_normal.zpp_inner.x=nx;\n wrap_normal.zpp_inner.y=ny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_normal.zpp_inner.x!=wrap_normal.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_normal.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_normal.zpp_inner.\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_normal.zpp_inner.y!=wrap_normal.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_normal.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_normal.zpp_inner.\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n };\n if(ws1.id>ws2.id){\n {\n wrap_normal.zpp_inner.x=-wrap_normal.zpp_inner.x;\n wrap_normal.zpp_inner.y=-wrap_normal.zpp_inner.y;\n };\n }\n }\n public var wrap_normal:Vec2=null;\n public function getnormal(){\n wrap_normal=Vec2.get(0,0);\n wrap_normal.zpp_inner._immutable=true;\n wrap_normal.zpp_inner._inuse=true;\n wrap_normal.zpp_inner._validate=normal_validate;\n }\n var kMassa:Float=0.0;\n var kMassb:Float=0.0;\n var kMassc:Float=0.0;\n var Ka:Float=0.0;\n var Kb:Float=0.0;\n var Kc:Float=0.0;\n public var rMass:Float=0.0;\n public var jrAcc:Float=0.0;\n var rn1a:Float=0.0;\n var rt1a:Float=0.0;\n var rn1b:Float=0.0;\n var rt1b:Float=0.0;\n var rn2a:Float=0.0;\n var rt2a:Float=0.0;\n var rn2b:Float=0.0;\n var rt2b:Float=0.0;\n var k1x:Float=0.0;\n var k1y:Float=0.0;\n var k2x:Float=0.0;\n var k2y:Float=0.0;\n public var surfacex:Float=0.0;\n public var surfacey:Float=0.0;\n public static inline var FACE1=0;\n public static inline var FACE2=1;\n public static inline var CIRCLE=2;\n public var ptype:Int;\n public var lnormx:Float=0.0;\n public var lnormy:Float=0.0;\n public var lproj:Float=0.0;\n public var radius:Float=0.0;\n public var rev:Bool=false;\n var biasCoef:Float=0.0;\n public var __ref_edge1:ZPP_Edge=null;\n public var __ref_edge2:ZPP_Edge=null;\n public var __ref_vertex:Int=0;\n public var c1:ZPP_IContact=null;\n public var oc1:ZPP_Contact=null;\n public var c2:ZPP_IContact=null;\n public var oc2:ZPP_Contact=null;\n public var hc2:Bool=false;\n public var hpc2:Bool=false;\n public var next:ZPP_ColArbiter=null;\n static public var zpp_pool:ZPP_ColArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public function new(){\n super();\n pre_dt=-1.0;\n contacts=new ZPP_Contact();\n innards=new ZPP_IContact();\n type=ZPP_Arbiter.COL;\n colarb=this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode exists on col arbiter going out of pool?\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n contacts.empty();\n };\n if(!res)throw \"assert(\"+\"contacts.empty()\"+\") :: \"+(\"still has contacts on free?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode exists on col arbiter going into pool?\");\n #end\n };\n userdef_dyn_fric=false;\n userdef_stat_fric=false;\n userdef_restitution=false;\n userdef_rfric=false;\n __ref_edge1=__ref_edge2=null;\n }\n public var stat:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function injectContact(px:Float,py:Float,nx:Float,ny:Float,dist:Float,hash:Int,posOnly=false){\n var c:ZPP_Contact=null;\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n if(hash==cur.hash){\n c=cur;\n break;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(c==null){\n {\n if(ZPP_Contact.zpp_pool==null){\n c=new ZPP_Contact();\n #if NAPE_POOL_STATS ZPP_Contact.POOL_TOT++;\n ZPP_Contact.POOL_ADDNEW++;\n #end\n }\n else{\n c=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=c.next;\n c.next=null;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT--;\n ZPP_Contact.POOL_ADD++;\n #end\n }\n c.alloc();\n };\n var ci=c.inner;\n ci.jnAcc=ci.jtAcc=0;\n c.hash=hash;\n c.fresh=true;\n c.arbiter=this;\n jrAcc=0;\n contacts.inlined_add(c);\n innards.add(ci);\n }\n else c.fresh=false;\n {\n c.px=px;\n c.py=py;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((c.px!=c.px));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(c.px)\"+\") :: \"+(\"vec_set(in n: \"+\"c.p\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((c.py!=c.py));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(c.py)\"+\") :: \"+(\"vec_set(in n: \"+\"c.p\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n };\n {\n this.nx=nx;\n this.ny=ny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.nx!=this.nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.nx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.n\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.ny!=this.ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.ny)\"+\") :: \"+(\"vec_set(in n: \"+\"this.n\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n };\n c.dist=dist;\n c.stamp=stamp;\n c.posOnly=posOnly;\n return c;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n this.s1=s1;\n this.s2=s2;\n calcProperties();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function calcProperties(){\n if(!userdef_restitution){\n if(s1.material.elasticity<=ZPP_Const.NEGINF()||s2.material.elasticity<=ZPP_Const.NEGINF())restitution=0;\n else if(s1.material.elasticity>=ZPP_Const.POSINF()||s2.material.elasticity>=ZPP_Const.POSINF())restitution=1;\n else restitution=(s1.material.elasticity+s2.material.elasticity)/2;\n if(restitution<0)restitution=0;\n if(restitution>1)restitution=1;\n }\n if(!userdef_dyn_fric){\n dyn_fric=ZPP_Math.sqrt(s1.material.dynamicFriction*s2.material.dynamicFriction);\n }\n if(!userdef_stat_fric){\n stat_fric=ZPP_Math.sqrt(s1.material.staticFriction*s2.material.staticFriction);\n }\n if(!userdef_rfric){\n rfric=ZPP_Math.sqrt(s1.material.rollingFriction*s2.material.rollingFriction);\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_props(){\n if(invalidated){\n invalidated=false;\n calcProperties();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n while(!contacts.empty()){\n {\n var o=contacts.inlined_pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Contact\"+\", in obj: \"+\"contacts.inlined_pop_unsafe()\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT++;\n ZPP_Contact.POOL_SUB++;\n #end\n };\n innards.inlined_pop();\n }\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ColArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT++;\n ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n pre_dt=-1.0;\n }\n public var mutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){\n mutable=true;\n if(wrap_normal!=null)wrap_normal.zpp_inner._immutable=false;\n if(wrap_contacts!=null)wrap_contacts.zpp_inner.immutable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){\n mutable=false;\n if(wrap_normal!=null)wrap_normal.zpp_inner._immutable=true;\n if(wrap_contacts!=null)wrap_contacts.zpp_inner.immutable=true;\n }\n private function contacts_adder(x:Contact){\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot add new contacts, information required is far too specific and detailed :)\";\n #end\n return false;\n }\n private function contacts_subber(x:Contact){\n var pre=null;\n var prei=null;\n var cx_itei=innards.begin();\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c==x.zpp_inner){\n contacts.erase(pre);\n innards.erase(prei);\n {\n var o=c;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Contact\"+\", in obj: \"+\"c\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT++;\n ZPP_Contact.POOL_SUB++;\n #end\n };\n break;\n }\n pre=cx_ite;\n prei=cx_itei;\n cx_itei=cx_itei.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function setupcontacts(){\n wrap_contacts=ZPP_ContactList.get(contacts,true);\n wrap_contacts.zpp_inner.immutable=!mutable;\n wrap_contacts.zpp_inner.adder=contacts_adder;\n wrap_contacts.zpp_inner.dontremove=true;\n wrap_contacts.zpp_inner.subber=contacts_subber;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function cleanupContacts(){\n var fst=true;\n var pre=null;\n var prei=null;\n var cx_itei=innards.begin();\n hc2=false;\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c.stamp+Config.arbiterExpirationDelay-Config.elasticThreshold){\n ci.bounce=0;\n }\n vdot=(vry*nx-vrx*ny);\n var thr=Config.staticFrictionThreshold;\n if(vdot*vdot>thr*thr){\n ci.friction=dyn_fric;\n }\n else{\n ci.friction=stat_fric;\n }\n ci.jnAcc*=dtratio;\n ci.jtAcc*=dtratio;\n }\n if(pact!=c.active)contacts.modified=true;\n pre=cx_ite;\n prei=cx_itei;\n cx_itei=cx_itei.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(hc2){\n hpc2=true;\n if(oc1.posOnly){\n var tmp=c1;\n c1=c2;\n c2=tmp;\n var tmp2=oc1;\n oc1=oc2;\n oc2=tmp2;\n hc2=false;\n }\n else if(oc2.posOnly){\n hc2=false;\n }\n if(oc1.posOnly){\n fst=true;\n }\n }\n else{\n hpc2=false;\n }\n jrAcc*=dtratio;\n if(!fst){\n rn1a=(ny*c1.r1x-nx*c1.r1y);\n rt1a=(c1.r1x*nx+c1.r1y*ny);\n rn1b=(ny*c1.r2x-nx*c1.r2y);\n rt1b=(c1.r2x*nx+c1.r2y*ny);\n k1x=b2.kinvelx-c1.r2y*b2.kinangvel-(b1.kinvelx-c1.r1y*b1.kinangvel);\n k1y=b2.kinvely+c1.r2x*b2.kinangvel-(b1.kinvely+c1.r1x*b1.kinangvel);\n }\n if(hc2){\n rn2a=(ny*c2.r1x-nx*c2.r1y);\n rt2a=(c2.r1x*nx+c2.r1y*ny);\n rn2b=(ny*c2.r2x-nx*c2.r2y);\n rt2b=(c2.r2x*nx+c2.r2y*ny);\n k2x=b2.kinvelx-c2.r2y*b2.kinangvel-(b1.kinvelx-c2.r1y*b1.kinangvel);\n k2y=b2.kinvely+c2.r2x*b2.kinangvel-(b1.kinvely+c2.r1x*b1.kinangvel);\n {\n kMassa=mass_sum+b1.sinertia*rn1a*rn1a+b2.sinertia*rn1b*rn1b;\n kMassb=mass_sum+b1.sinertia*rn1a*rn2a+b2.sinertia*rn1b*rn2b;\n kMassc=mass_sum+b1.sinertia*rn2a*rn2a+b2.sinertia*rn2b*rn2b;\n };\n var norm=(kMassa*kMassa+2*kMassb*kMassb+kMassc*kMassc);\n if(normjMax)cjAcc=jMax else if(cjAcc<-jMax)cjAcc=-jMax;\n j=cjAcc-jOld;\n c1.jtAcc=cjAcc;\n jx=-ny*j;\n jy=nx*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rt1b*j*b2.iinertia;\n b1.angvel-=rt1a*j*b1.iinertia;\n if(hc2){\n var v2x=k2x+b2.velx-c2.r2y*b2.angvel-(b1.velx-c2.r1y*b1.angvel);\n var v2y=k2y+b2.vely+c2.r2x*b2.angvel-(b1.vely+c2.r1x*b1.angvel);\n j=((v2y*nx-v2x*ny)+surfacex)*c2.tMass;\n jMax=c2.friction*c2.jnAcc;\n jOld=c2.jtAcc;\n cjAcc=jOld-j;\n if(cjAcc>jMax)cjAcc=jMax else if(cjAcc<-jMax)cjAcc=-jMax;\n j=cjAcc-jOld;\n c2.jtAcc=cjAcc;\n jx=-ny*j;\n jy=nx*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rt2b*j*b2.iinertia;\n b1.angvel-=rt2a*j*b1.iinertia;\n v1x=k1x+b2.velx-c1.r2y*b2.angvel-(b1.velx-c1.r1y*b1.angvel);\n v1y=k1y+b2.vely+c1.r2x*b2.angvel-(b1.vely+c1.r1x*b1.angvel);\n v2x=k2x+b2.velx-c2.r2y*b2.angvel-(b1.velx-c2.r1y*b1.angvel);\n v2y=k2y+b2.vely+c2.r2x*b2.angvel-(b1.vely+c2.r1x*b1.angvel);\n var ax:Float=c1.jnAcc;\n var ay:Float=c2.jnAcc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ax!=ax));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ax)\"+\") :: \"+(\"vec_new(in n: \"+\"a\"+\",in x: \"+\"c1.jnAcc\"+\",in y: \"+\"c2.jnAcc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ay!=ay));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ay)\"+\") :: \"+(\"vec_new(in n: \"+\"a\"+\",in x: \"+\"c1.jnAcc\"+\",in y: \"+\"c2.jnAcc\"+\")\");\n #end\n };\n var jnx=(v1x*nx+v1y*ny)+surfacey+(c1.bounce)-(Ka*ax+Kb*ay);\n var jny=(v2x*nx+v2y*ny)+surfacey+(c2.bounce)-(Kb*ax+Kc*ay);\n var xx=-(kMassa*jnx+kMassb*jny);\n var xy=-(kMassb*jnx+kMassc*jny);\n if(xx>=0&&xy>=0){\n {\n jnx=xx-ax;\n jny=xy-ay;\n };\n c1.jnAcc=xx;\n c2.jnAcc=xy;\n }\n else{\n xx=-c1.nMass*jnx;\n if(xx>=0&&(Kb*xx+jny)>=0){\n jnx=xx-ax;\n jny=-ay;\n c1.jnAcc=xx;\n c2.jnAcc=0;\n }\n else{\n xy=-c2.nMass*jny;\n if(xy>=0&&(Kb*xy+jnx)>=0){\n jnx=-ax;\n jny=xy-ay;\n c1.jnAcc=0;\n c2.jnAcc=xy;\n }\n else if(jnx>=0&&jny>=0){\n jnx=-ax;\n jny=-ay;\n c1.jnAcc=c2.jnAcc=0;\n }\n else{\n jnx=0;\n jny=0;\n }\n }\n }\n j=jnx+jny;\n jx=nx*j;\n jy=ny*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=(rn1b*jnx+rn2b*jny)*b2.iinertia;\n b1.angvel-=(rn1a*jnx+rn2a*jny)*b1.iinertia;\n }\n else{\n if(radius!=0.0){\n var dw=b2.angvel-b1.angvel;\n j=dw*rMass;\n jMax=rfric*c1.jnAcc;\n jOld=jrAcc;\n jrAcc-=j;\n if(jrAcc>jMax)jrAcc=jMax else if(jrAcc<-jMax)jrAcc=-jMax;\n j=jrAcc-jOld;\n b2.angvel+=j*b2.iinertia;\n b1.angvel-=j*b1.iinertia;\n }\n v1x=k1x+b2.velx-c1.r2y*b2.angvel-(b1.velx-c1.r1y*b1.angvel);\n v1y=k1y+b2.vely+c1.r2x*b2.angvel-(b1.vely+c1.r1x*b1.angvel);\n j=(c1.bounce+(nx*v1x+ny*v1y)+surfacey)*c1.nMass;\n jOld=c1.jnAcc;\n cjAcc=jOld-j;\n if(cjAcc<0.0)cjAcc=0.0;\n j=cjAcc-jOld;\n c1.jnAcc=cjAcc;\n jx=nx*j;\n jy=ny*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rn1b*j*b2.iinertia;\n b1.angvel-=rn1a*j*b1.iinertia;\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function applyImpulsePos(){\n if(ptype==ZPP_ColArbiter.CIRCLE){\n var c=c1;\n var dx:Float=0.0;\n var dy:Float=0.0;\n var r2x:Float=0.0;\n var r2y:Float=0.0;\n {\n r2x=(b2.axisy*c.lr2x-b2.axisx*c.lr2y);\n r2y=(c.lr2x*b2.axisx+c.lr2y*b2.axisy);\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"r2\"+\",in b: \"+\"b2.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n r2x+=b2.posx*t;\n r2y+=b2.posy*t;\n };\n var r1x:Float=0.0;\n var r1y:Float=0.0;\n {\n r1x=(b1.axisy*c.lr1x-b1.axisx*c.lr1y);\n r1y=(c.lr1x*b1.axisx+c.lr1y*b1.axisy);\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"r1\"+\",in b: \"+\"b1.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n r1x+=b1.posx*t;\n r1y+=b1.posy*t;\n };\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=r2x-r1x;\n dy=r2y-r1y;\n };\n var dl=ZPP_Math.sqrt((dx*dx+dy*dy));\n var r=radius-Config.collisionSlop;\n var err=(dl-r);\n if((dx*nx+dy*ny)<0){\n {\n dx=-dx;\n dy=-dy;\n };\n err-=radius;\n }\n if(err<0){\n if(dl=0&&xy>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n {\n xx=-bx/Ka;\n xy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xx!=xx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xx)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"-bx/Ka\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xy!=xy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xy)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"-bx/Ka\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var vn2=Kb*xx+by;\n if(xx>=0&&vn2>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n {\n xx=0;\n xy=-by/Kc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xx!=xx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xx)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"0\"+\",in y: \"+\"-by/Kc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xy!=xy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xy)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"0\"+\",in y: \"+\"-by/Kc\"+\")\");\n #end\n };\n };\n var vn1=Kb*xy+bx;\n if(xy>=0&&vn1>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n }\n while(false);\n }\n else{\n var rn1=(gnormy*c1r1x-gnormx*c1r1y);\n var rn2=(gnormy*c1r2x-gnormx*c1r2y);\n var K=b2.smass+rn2*rn2*b2.sinertia+b1.smass+rn1*rn1*b1.sinertia;\n if(K!=0){\n var jn=-biasCoef*err1/K;\n var Jx:Float=0.0;\n var Jy:Float=0.0;\n {\n var t=(jn);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"gnorm\"+\",in s: \"+\"jn\"+\",out r: \"+\"J\"+\")\");\n #end\n };\n Jx=gnormx*t;\n Jy=gnormy*t;\n };\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"J\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.posx-=Jx*t;\n b1.posy-=Jy*t;\n };\n b1.delta_rot(-rn1*b1.iinertia*jn);\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"J\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.posx+=Jx*t;\n b2.posy+=Jy*t;\n };\n b2.delta_rot(rn2*b2.iinertia*jn);\n }\n }\n }\n }\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Contact{\n public var outer:Contact=null;\n public static var internal:Bool=false;\n public function wrapper(){\n if(outer==null){\n internal=true;\n outer=new Contact();\n internal=false;\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var px:Float=0.0;\n public var py:Float=0.0;\n private function position_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(inactiveme())throw \"Error: Contact not currently in use\";\n #end\n {\n wrap_position.zpp_inner.x=px;\n wrap_position.zpp_inner.y=py;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.x!=wrap_position.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.y!=wrap_position.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n };\n }\n public var wrap_position:Vec2=null;\n public function getposition(){\n var me=this;\n wrap_position=Vec2.get();\n wrap_position.zpp_inner._inuse=true;\n wrap_position.zpp_inner._immutable=true;\n wrap_position.zpp_inner._validate=position_validate;\n }\n public function inactiveme(){\n return!(active&&arbiter!=null&&!arbiter.inactiveme());\n }\n public var arbiter:ZPP_Arbiter=null;\n public var inner:ZPP_IContact=null;\n public var active:Bool=false;\n public var posOnly:Bool=false;\n public var stamp:Int=0;\n public var hash:Int=0;\n public var fresh:Bool=false;\n public var dist:Float=0.0;\n public var elasticity:Float=0.0;\n public function new(){\n inner=new ZPP_IContact();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n arbiter=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n static public var zpp_pool:ZPP_Contact=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZPP_Contact=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Contact{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_Contact{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_Contact):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Contact):ZPP_Contact{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Contact,o:ZPP_Contact):ZPP_Contact{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Contact,o:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Contact{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Contact):ZPP_Contact{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Contact;\n var ret:ZPP_Contact;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Contact,n:Int):ZPP_Contact{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Contact):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Contact{\n return begin().elem();\n }\n public function back():ZPP_Contact{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_IContact{\n public var r1x:Float=0.0;\n public var r1y:Float=0.0;\n public var r2x:Float=0.0;\n public var r2y:Float=0.0;\n public var nMass:Float=0.0;\n public var tMass:Float=0.0;\n public var bounce:Float=0.0;\n public var friction:Float=0.0;\n public var jnAcc:Float=0.0;\n public var jtAcc:Float=0.0;\n public var lr1x:Float=0.0;\n public var lr1y:Float=0.0;\n public var lr2x:Float=0.0;\n public var lr2y:Float=0.0;\n public function new(){}\n public var next:ZPP_IContact=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_IContact{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_IContact{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_IContact):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_IContact):ZPP_IContact{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_IContact,o:ZPP_IContact):ZPP_IContact{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_IContact,o:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_IContact{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_IContact):ZPP_IContact{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_IContact;\n var ret:ZPP_IContact;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_IContact,n:Int):ZPP_IContact{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_IContact):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_IContact{\n return begin().elem();\n }\n public function back():ZPP_IContact{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_InteractionFilter{\n public var next:ZPP_InteractionFilter=null;\n static public var zpp_pool:ZPP_InteractionFilter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:InteractionFilter=null;\n public function wrapper(){\n if(outer==null){\n outer=new InteractionFilter();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_InteractionFilter\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT++;\n ZPP_InteractionFilter.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public function new(){\n feature_cons();\n collisionGroup=sensorGroup=fluidGroup=1;\n collisionMask=sensorMask=fluidMask=-1;\n }\n public function copy(){\n var ret;\n {\n if(ZPP_InteractionFilter.zpp_pool==null){\n ret=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.collisionGroup=collisionGroup;\n ret.collisionMask=collisionMask;\n ret.sensorGroup=sensorGroup;\n ret.sensorMask=sensorMask;\n ret.fluidGroup=fluidGroup;\n ret.fluidMask=fluidMask;\n return ret;\n }\n public var collisionGroup:Int=0;\n public var collisionMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldCollide(x:ZPP_InteractionFilter){\n return(collisionMask&x.collisionGroup)!=0&&(x.collisionMask&collisionGroup)!=0;\n }\n public var sensorGroup:Int=0;\n public var sensorMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldSense(x:ZPP_InteractionFilter){\n return(sensorMask&x.sensorGroup)!=0&&(x.sensorMask&sensorGroup)!=0;\n }\n public var fluidGroup:Int=0;\n public var fluidMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldFlow(x:ZPP_InteractionFilter){\n return(fluidMask&x.fluidGroup)!=0&&(x.fluidMask&fluidGroup)!=0;\n }\n public function invalidate(){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.invalidate_filter();\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_InteractionGroup{\n public var outer:InteractionGroup=null;\n public var ignore:Bool=false;\n public var group:ZPP_InteractionGroup=null;\n public function setGroup(group:ZPP_InteractionGroup){\n if(this.group!=group){\n if(this.group!=null){\n this.group.remGroup(this);\n this.group.invalidate(true);\n }\n this.group=group;\n if(group!=null){\n group.addGroup(this);\n group.invalidate(true);\n }\n else this.invalidate(true);\n }\n }\n public var groups:ZNPList_ZPP_InteractionGroup=null;\n public var wrap_groups:InteractionGroupList=null;\n public var interactors:ZNPList_ZPP_Interactor=null;\n public var wrap_interactors:InteractorList=null;\n public var depth:Int=0;\n public function invalidate(force=false){\n if(!(force||ignore))return;\n {\n var cx_ite=interactors.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(b.isBody())b.ibody.wake();\n else if(b.isShape())b.ishape.body.wake();\n else b.icompound.wake();\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=groups.begin();\n while(cx_ite!=null){\n var g=cx_ite.elem();\n g.invalidate(force);\n cx_ite=cx_ite.next;\n }\n };\n }\n public static var SHAPE=1;\n public static var BODY=2;\n public function new(){\n depth=0;\n groups=new ZNPList_ZPP_InteractionGroup();\n interactors=new ZNPList_ZPP_Interactor();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addGroup(group:ZPP_InteractionGroup){\n groups.add(group);\n group.depth=depth+1;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remGroup(group:ZPP_InteractionGroup){\n groups.remove(group);\n group.depth=0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addInteractor(intx:ZPP_Interactor){\n interactors.add(intx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remInteractor(intx:ZPP_Interactor,flag:Int=-1){\n interactors.remove(intx);\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_AABB{\n public var _invalidate:NullVoid>=null;\n public var _validate:NullVoid>=null;\n public var _immutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n if(_invalidate!=null){\n _invalidate(this);\n }\n }\n public var outer:Null=null;\n public function wrapper():AABB{\n if(outer==null){\n outer=new AABB();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var next:ZPP_AABB=null;\n static public var zpp_pool:ZPP_AABB=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(outer!=null){\n outer.zpp_inner=null;\n outer=null;\n }\n wrap_min=wrap_max=null;\n _invalidate=null;\n _validate=null;\n }\n public function new(){}\n public static#if NAPE_NO_INLINE#else inline #end\n function get(minx:Float,miny:Float,maxx:Float,maxy:Float):ZPP_AABB{\n var ret;\n {\n if(ZPP_AABB.zpp_pool==null){\n ret=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n ret.minx=minx;\n ret.miny=miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.minx!=ret.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.min\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.miny!=ret.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.min\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n };\n {\n ret.maxx=maxx;\n ret.maxy=maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.maxx!=ret.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.max\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.maxy!=ret.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.max\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function copy():ZPP_AABB{\n return ZPP_AABB.get(minx,miny,maxx,maxy);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function width():Float{\n return maxx-minx;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function height():Float{\n return maxy-miny;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function perimeter():Float{\n return(width()+height())*2;\n }\n public var minx:Float=0.0;\n public var miny:Float=0.0;\n public var wrap_min:Null=null;\n public function getmin():Vec2{\n if(wrap_min==null){\n wrap_min=Vec2.get(minx,miny);\n wrap_min.zpp_inner._inuse=true;\n if(_immutable){\n wrap_min.zpp_inner._immutable=true;\n }\n else{\n wrap_min.zpp_inner._invalidate=mod_min;\n }\n wrap_min.zpp_inner._validate=dom_min;\n }\n return wrap_min;\n }\n public function dom_min():Void{\n validate();\n {\n wrap_min.zpp_inner.x=minx;\n wrap_min.zpp_inner.y=miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_min.zpp_inner.x!=wrap_min.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_min.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_min.zpp_inner.\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_min.zpp_inner.y!=wrap_min.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_min.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_min.zpp_inner.\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n };\n }\n public function mod_min(min:ZPP_Vec2):Void{\n if(min.x!=minx||min.y!=miny){\n {\n minx=min.x;\n miny=min.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minx!=minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minx)\"+\") :: \"+(\"vec_set(in n: \"+\"min\"+\",in x: \"+\"min.x\"+\",in y: \"+\"min.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((miny!=miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(miny)\"+\") :: \"+(\"vec_set(in n: \"+\"min\"+\",in x: \"+\"min.x\"+\",in y: \"+\"min.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n }\n public var maxx:Float=0.0;\n public var maxy:Float=0.0;\n public var wrap_max:Null=null;\n public function getmax():Vec2{\n if(wrap_max==null){\n wrap_max=Vec2.get(maxx,maxy);\n wrap_max.zpp_inner._inuse=true;\n if(_immutable){\n wrap_max.zpp_inner._immutable=true;\n }\n else{\n wrap_max.zpp_inner._invalidate=mod_max;\n }\n wrap_max.zpp_inner._validate=dom_max;\n }\n return wrap_max;\n }\n public function dom_max():Void{\n validate();\n {\n wrap_max.zpp_inner.x=maxx;\n wrap_max.zpp_inner.y=maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_max.zpp_inner.x!=wrap_max.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_max.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_max.zpp_inner.\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_max.zpp_inner.y!=wrap_max.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_max.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_max.zpp_inner.\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n };\n }\n public function mod_max(max:ZPP_Vec2):Void{\n if(max.x!=maxx||max.y!=maxy){\n {\n maxx=max.x;\n maxy=max.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxx!=maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"max\"+\",in x: \"+\"max.x\"+\",in y: \"+\"max.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxy!=maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"max\"+\",in x: \"+\"max.x\"+\",in y: \"+\"max.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersectX(x:ZPP_AABB):Bool{\n return!(x.minx>maxx||minx>x.maxx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersectY(x:ZPP_AABB):Bool{\n return!(x.miny>maxy||miny>x.maxy);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersect(x:ZPP_AABB):Bool{\n return x.miny<=maxy&&miny<=x.maxy&&x.minx<=maxx&&minx<=x.maxx;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function combine(x:ZPP_AABB):Void{\n if(x.minxmaxx)maxx=x.maxx;\n if(x.minymaxy)maxy=x.maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function contains(x:ZPP_AABB):Bool{\n return x.minx>=minx&&x.miny>=miny&&x.maxx<=maxx&&x.maxy<=maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function containsPoint(v:ZPP_Vec2):Bool{\n return v.x>=minx&&v.x<=maxx&&v.y>=miny&&v.y<=maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setCombine(a:ZPP_AABB,b:ZPP_AABB):Void{\n minx=if(a.minxb.maxx)a.maxx else b.maxx;\n maxy=if(a.maxy>b.maxy)a.maxy else b.maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setExpand(a:ZPP_AABB,fatten:Float):Void{\n minx=a.minx-fatten;\n miny=a.miny-fatten;\n maxx=a.maxx+fatten;\n maxy=a.maxy+fatten;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setExpandPoint(x:Float,y:Float):Void{\n if(xmaxx)maxx=x;\n if(ymaxy)maxy=y;\n }\n public function toString(){\n return \"{ x: \"+minx+\" y: \"+miny+\" w: \"+width()+\" h: \"+height()+\" }\";\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Collide{\n public static function circleContains(c:ZPP_Circle,p:ZPP_Vec2){\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=p.x-c.worldCOMx;\n dy=p.y-c.worldCOMy;\n };\n return(dx*dx+dy*dy)max)max=k;\n };\n cx_ite=cx_ite.next;\n }\n };\n max<=a.gprojection;\n }){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n retvar=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n retvar;\n });\n };\n }\n else return false;\n }\n public static function contactCollide(s1:ZPP_Shape,s2:ZPP_Shape,arb:ZPP_ColArbiter,rev:Bool){\n if(s2.isPolygon()){\n if(s1.isPolygon()){\n var cont=true;\n var max=-ZPP_Const.FMAX;\n var maxmin=-ZPP_Const.FMAX;\n var maxi=-1;\n var axis1:ZPP_Edge=null;\n var axis2:ZPP_Edge=null;\n {\n var cx_ite=s1.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=0){\n cont=false;\n break;\n }\n if(min>max){\n max=min;\n axis1=ax;\n maxi=1;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=0){\n cont=false;\n break;\n }\n if(min>max){\n max=min;\n axis2=ax;\n maxi=2;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(!cont)return false;\n else{\n var q1,q2,ax,scale;\n if(maxi==1){\n q1=s1.polygon;\n q2=s2.polygon;\n ax=axis1;\n scale=1.0;\n }\n else{\n q1=s2.polygon;\n q2=s1.polygon;\n ax=axis2;\n scale=-1.0;\n }\n var ay:ZPP_Edge=null;\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=q2.edges.begin();\n while(cx_ite!=null){\n var axis=cx_ite.elem();\n {\n var k=(ax.gnormx*axis.gnormx+ax.gnormy*axis.gnormy);\n if(kConfig.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c0\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c0x+=dvx*t;\n c0y+=dvy*t;\n };\n var t=(-ax.tp0-d1)*den;\n if(t<-Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c1\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c1x+=dvx*t;\n c1y+=dvy*t;\n };\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n var t=(scale);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"ax.gnorm\"+\",in s: \"+\"scale\"+\",out r: \"+\"n\"+\")\");\n #end\n };\n nx=ax.gnormx*t;\n ny=ax.gnormy*t;\n };\n {\n arb.lnormx=ax.lnormx;\n arb.lnormy=ax.lnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((arb.lnormx!=arb.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(arb.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"arb.lnorm\"+\",in x: \"+\"ax.lnormx\"+\",in y: \"+\"ax.lnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((arb.lnormy!=arb.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(arb.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"arb.lnorm\"+\",in x: \"+\"ax.lnormx\"+\",in y: \"+\"ax.lnormy\"+\")\");\n #end\n };\n };\n arb.lproj=ax.lprojection;\n arb.radius=0;\n arb.rev=rev!=(scale==-1);\n arb.ptype=arb.rev?ZPP_ColArbiter.FACE2:ZPP_ColArbiter.FACE1;\n var c0d=(c0x*ax.gnormx+c0y*ax.gnormy)-ax.gprojection;\n var c1d=(c1x*ax.gnormx+c1y*ax.gnormy)-ax.gprojection;\n if(c0d>0&&c1d>0){\n return false;\n }\n else{\n if(rev){\n nx=-nx;\n ny=-ny;\n }\n var con=arb.injectContact(c0x-(ax.gnormx*c0d*0.5),c0y-(ax.gnormy*c0d*0.5),nx,ny,c0d,arb.rev?1:0,c0d>0);\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c0\"+\",in b: \"+\"q2.body.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n c0x-=q2.body.posx*t;\n c0y-=q2.body.posy*t;\n };\n {\n con.inner.lr1x=c0x*q2.body.axisy+c0y*q2.body.axisx;\n con.inner.lr1y=c0y*q2.body.axisy-c0x*q2.body.axisx;\n };\n con=arb.injectContact(c1x-(ax.gnormx*c1d*0.5),c1y-(ax.gnormy*c1d*0.5),nx,ny,c1d,arb.rev?0:1,c1d>0);\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c1\"+\",in b: \"+\"q2.body.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n c1x-=q2.body.posx*t;\n c1y-=q2.body.posy*t;\n };\n {\n con.inner.lr1x=c1x*q2.body.axisy+c1y*q2.body.axisx;\n con.inner.lr1y=c1y*q2.body.axisy-c1x*q2.body.axisx;\n };\n if(maxi==1){\n arb.__ref_edge1=ax;\n arb.__ref_edge2=ay;\n }\n else{\n arb.__ref_edge2=ax;\n arb.__ref_edge1=ay;\n }\n return true;\n }\n }\n }\n else return false;\n };\n else{\n var max=-ZPP_Const.FMAX;\n var minmax=-ZPP_Const.FMAX;\n var cont=true;\n var a0=null,vi=null;\n var vite=s2.polygon.gverts.begin();\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy)-a.gprojection-s1.circle.radius;\n if(dist>0){\n cont=false;\n break;\n }\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var co={\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n if(distSqr>minDist*minDist)null;\n else if(distSqr=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var co={\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n if(distSqr>minDist*minDist)null;\n else if(distSqrminDist*minDist)null;\n else if(distSqr0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n cont;\n }\n else false;\n };\n else{\n var a0=null,vi=null;\n var cont=true;\n var max=-ZPP_Const.FMAX;\n var vite=s2.polygon.gverts.begin();\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy)-a.gprojection-s1.circle.radius;\n if(dist>0){\n cont=false;\n break;\n }\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n else if(dt>=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n else true;\n }\n else false;\n };\n }\n else return{\n var minDist=s1.circle.radius+s2.circle.radius;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=s2.circle.worldCOMx-s1.circle.worldCOMx;\n py=s2.circle.worldCOMy-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n }\n public static function flowCollide(s1:ZPP_Shape,s2:ZPP_Shape,arb:ZPP_FluidArbiter){\n if(s2.isPolygon()){\n return if(s1.isPolygon()){\n var out1=new Array();\n var out2=new Array();\n var cont=true;\n var total=true;\n {\n var cx_ite=s1.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n var ind=0;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=ax.gprojection+Config.epsilon){\n out2[ind]=true;\n total=false;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n min-=ax.gprojection;\n if(min>0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s2.polygon.validate_worldCOM();\n arb.inject(s2.polygon.area,s2.polygon.worldCOMx,s2.polygon.worldCOMy);\n true;\n }\n else if(cont){\n total=true;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n var ind=0;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=ax.gprojection+Config.epsilon){\n out1[ind]=true;\n total=false;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n min-=ax.gprojection;\n if(min>0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s1.polygon.validate_worldCOM();\n arb.inject(s1.polygon.area,s1.polygon.worldCOMx,s1.polygon.worldCOMy);\n true;\n }\n else if(cont){\n while(!flowpoly.empty()){\n var p=flowpoly.pop_unsafe();\n if(!p._inuse){\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"p\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n var fst_vert=null;\n var poly1=false;\n var ite1=s1.polygon.gverts.begin();\n var ind1=0;\n var ite2=s2.polygon.gverts.begin();\n var ind2=0;\n for(i in 0...s2.polygon.edgeCnt)if(!out2[i]){\n ind2=i;\n break;\n }\n else ite2=ite2.next;\n if(ite2==null){\n ite2=s2.polygon.gverts.begin();\n poly1=true;\n for(i in 0...s1.polygon.edgeCnt)if(!out1[i]){\n ind1=i;\n break;\n }\n else ite1=ite1.next;\n if(ite1==null)ite1=s1.polygon.gverts.begin();\n else{\n flowpoly.add(ite1.elem());\n fst_vert=flowpoly.front();\n }\n }\n else{\n flowpoly.add(ite2.elem());\n fst_vert=flowpoly.front();\n }\n var cnt=1;\n if(flowpoly.empty()){\n {\n var cx_cont=true;\n var cx_itei=s1.polygon.gverts.begin();\n var u=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var v=cx_itej.elem();\n {\n var min=2.0;\n {\n var cx_cont=true;\n var cx_itei=s2.polygon.gverts.begin();\n var a=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var b=cx_itej.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(tConfig.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"min\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n fst_vert=ZPP_Vec2.get(cx,cy);\n flowpoly.add(fst_vert);\n poly1=true;\n ite1=cx_itei;\n {\n cx_cont=false;\n break;\n };\n }\n };\n {\n cx_itei=cx_itej;\n u=v;\n cx_itej=cx_itej.next;\n };\n }\n if(cx_cont){\n do{\n cx_itej=s1.polygon.gverts.begin();\n var v=cx_itej.elem();\n {\n var min=2.0;\n {\n var cx_cont=true;\n var cx_itei=s2.polygon.gverts.begin();\n var a=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var b=cx_itej.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(tConfig.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"min\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n fst_vert=ZPP_Vec2.get(cx,cy);\n flowpoly.add(fst_vert);\n poly1=true;\n ite1=cx_itei;\n break;\n }\n };\n }\n while(false);\n }\n };\n cnt=2;\n }\n while(true){\n if(poly1){\n ite1=ite1.next;\n ind1++;\n if(ite1==null){\n ite1=s1.polygon.gverts.begin();\n ind1=0;\n }\n if(!out1[ind1]){\n var ex=ite1.elem();\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(ex.x,ex.y,fst_vert.x,fst_vert.y)Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite2;\n indo=ind2;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite2=cx_ite;\n ind2++;\n if(ind2>=s2.polygon.edgeCnt)ind2=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite2;\n indo=ind2;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite2=cx_ite;\n ind2++;\n if(ind2>=s2.polygon.edgeCnt)ind2=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n };\n if(itmo==null)break;\n var u=itmo.elem();\n var itm2=itmo.next;\n if(itm2==null)itm2=s2.polygon.gverts.begin();\n var v=itm2.elem();\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(max);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"max\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(cx,cy,fst_vert.x,fst_vert.y)Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite1;\n indo=ind1;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite1=cx_ite;\n ind1++;\n if(ind1>=s1.polygon.edgeCnt)ind1=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s1.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite1;\n indo=ind1;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite1=cx_ite;\n ind1++;\n if(ind1>=s1.polygon.edgeCnt)ind1=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s1.polygon.gverts.begin();\n }\n };\n if(itmo==null)break;\n var u=itmo.elem();\n var itm2=itmo.next;\n if(itm2==null)itm2=s1.polygon.gverts.begin();\n var v=itm2.elem();\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(max);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"max\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(cx,cy,fst_vert.x,fst_vert.y)();\n var total=true;\n var a0=null,vi=null;\n var max=-ZPP_Const.FMAX;\n var cont=true;\n var vite=s2.polygon.gverts.begin();\n var ind=0;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy);\n if(dist>a.gprojection+s1.circle.radius){\n cont=false;\n break;\n }\n else if(dist+s1.circle.radius>a.gprojection+Config.epsilon){\n total=false;\n inte[ind]=true;\n }\n dist-=a.gprojection+s1.circle.radius;\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n if(total){\n arb.inject(s1.circle.area,s1.circle.worldCOMx,s1.circle.worldCOMy);\n true;\n }\n else{\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n }\n else if(dt>=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n }\n else true){\n var ins=new Array();\n var ind=0;\n var total=true;\n var vi=null;\n var vind=0;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var dist=ZPP_VecMath.vec_dsq(v.x,v.y,s1.circle.worldCOMx,s1.circle.worldCOMy);\n if(!(ins[ind]=(dist<=s1.circle.radius*s1.circle.radius)))total=false;\n else{\n vind=ind;\n vi=cx_ite;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s2.polygon.validate_worldCOM();\n arb.inject(s2.polygon.area,s2.polygon.worldCOMx,s2.polygon.worldCOMy);\n true;\n }\n else{\n while(!flowpoly.empty()){\n var p=flowpoly.pop_unsafe();\n if(!p._inuse){\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"p\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n flowsegs.clear();\n var fst_vert=null;\n var state=1;\n if(vi==null){\n vi=s2.polygon.gverts.begin();\n state=2;\n }\n else flowpoly.add(fst_vert=vi.elem());\n while(state!=0){\n if(state==1){\n vi=vi.next;\n if(vi==null)vi=s2.polygon.gverts.begin();\n vind++;\n if(vind>=s2.polygon.edgeCnt)vind=0;\n if(ins[vind]){\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,vi.elem().x,vi.elem().y)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)Config.epsilon){\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(t0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t0\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t1\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n flowpoly.add(ZPP_Vec2.get(cx,cy));\n }\n }\n }\n }\n u=v;\n vi=cx_ite;\n vind=vind2;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var vind2=vind+1;\n if(vind2==s2.polygon.edgeCnt)vind2=0;\n if(inte[vind]){\n if(ins[vind2]){\n var tval={\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=u.x-s1.circle.worldCOMx;\n qy=u.y-s1.circle.worldCOMy;\n };\n var A=(vx*vx+vy*vy);\n var B=2*(qx*vx+qy*vy);\n var C=(qx*qx+qy*qy)-s1.circle.radius*s1.circle.radius;\n var D=Math.sqrt(B*B-4*A*C);\n A=1/(2*A);\n var t=(-B-D)*A;\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)Config.epsilon){\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(t0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t0\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t1\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n flowpoly.add(ZPP_Vec2.get(cx,cy));\n }\n }\n }\n }\n u=v;\n vi=cx_ite;\n vind=vind2;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n };\n }\n }\n if(flowpoly.begin()==null){\n false;\n }\n else if(flowpoly.begin().next==null){\n var all=true;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var e=cx_ite.elem();\n {\n var dist=(e.gnormx*s1.circle.worldCOMx+e.gnormy*s1.circle.worldCOMy);\n if(dist>e.gprojection){\n all=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(all){\n arb.inject(s1.circle.area,s1.circle.worldCOMx,s1.circle.worldCOMy);\n true;\n }\n else false;\n }\n else{\n var COMx:Float=0;\n var COMy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((COMx!=COMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(COMx)\"+\") :: \"+(\"vec_new(in n: \"+\"COM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((COMy!=COMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(COMy)\"+\") :: \"+(\"vec_new(in n: \"+\"COM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var area=0.0;\n if(flowpoly.begin().next.next!=null){\n var parea=0.0;\n var pCOMx:Float=0.0;\n var pCOMy:Float=0.0;\n {\n {\n pCOMx=0;\n pCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pCOMx!=pCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"pCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pCOMy!=pCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"pCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n parea=0.0;\n {\n var cx_ite=flowpoly.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n var v=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n }\n cx_ite=flowpoly.begin();\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n };\n parea*=0.5;\n var ia=1/(6*parea);\n {\n var t=(ia);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"pCOM\"+\",in s: \"+\"ia\"+\")\");\n #end\n };\n pCOMx*=t;\n pCOMy*=t;\n };\n };\n {\n var t=(-parea);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"COM\"+\",in b: \"+\"pCOM\"+\",in s: \"+\"-parea\"+\")\");\n #end\n };\n COMx+=pCOMx*t;\n COMy+=pCOMy*t;\n };\n area-=parea;\n }\n else{\n flowsegs.add(flowpoly.front());\n flowsegs.add(flowpoly.begin().next.elem());\n }\n while(!flowsegs.empty()){\n var u=flowsegs.pop_unsafe();\n var v=flowsegs.pop_unsafe();\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=v.x-u.x;\n dy=v.y-u.y;\n };\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n nx=dx;\n ny=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n {\n {\n var d=(nx*nx+ny*ny);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"n\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"n\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n nx*=t;\n ny*=t;\n };\n };\n {\n var t=nx;\n nx=-ny;\n ny=t;\n };\n };\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x+v.x;\n cy=u.y+v.y;\n };\n {\n var t=(1.0/(2));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"c\"+\",in s: \"+\"1.0/(2)\"+\")\");\n #end\n };\n cx*=t;\n cy*=t;\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c\"+\",in b: \"+\"s1.circle.worldCOM\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n cx-=s1.circle.worldCOMx*t;\n cy-=s1.circle.worldCOMy*t;\n };\n var xd=(nx*cx+ny*cy);\n var carea=0.0;\n var ccom=0.0;\n {\n var X=xd;\n var cos=X/s1.circle.radius;\n var sin=Math.sqrt(1-cos*cos);\n var theta=Math.acos(cos);\n carea=s1.circle.radius*(s1.circle.radius*theta-X*sin);\n ccom=(2/3)*s1.circle.radius*sin*sin*sin/(theta-cos*sin);\n };\n {\n cx=s1.circle.worldCOMx;\n cy=s1.circle.worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"s1.circle.worldCOMx\"+\",in y: \"+\"s1.circle.worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"s1.circle.worldCOMx\"+\",in y: \"+\"s1.circle.worldCOMy\"+\")\");\n #end\n };\n };\n {\n var t=(ccom);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"n\"+\",in s: \"+\"ccom\"+\")\");\n #end\n };\n cx+=nx*t;\n cy+=ny*t;\n };\n {\n var t=(carea);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"COM\"+\",in b: \"+\"c\"+\",in s: \"+\"carea\"+\")\");\n #end\n };\n COMx+=cx*t;\n COMy+=cy*t;\n };\n area+=carea;\n }\n {\n var t=(1.0/(area));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"COM\"+\",in s: \"+\"1.0/(area)\"+\")\");\n #end\n };\n COMx*=t;\n COMy*=t;\n };\n arb.inject(area,COMx,COMy);\n true;\n }\n }\n }\n else false;\n }\n }\n else false;\n };\n }\n else return{\n var c1=s1.circle;\n var c2=s2.circle;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=c2.worldCOMx-c1.worldCOMx;\n deltay=c2.worldCOMy-c1.worldCOMy;\n };\n var cr=c1.radius+c2.radius;\n var ds=(deltax*deltax+deltay*deltay);\n if(ds>cr*cr)false;\n else if(ds=null;\n public var forced:Bool=false;\n static public var zpp_pool:ZPP_GeomVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(wrap!=null){\n wrap.zpp_inner._inuse=false;\n wrap.dispose();\n wrap=null;\n }\n prev=next=null;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n forced=false;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function wrapper():Vec2{\n if(wrap==null){\n wrap=Vec2.get(x,y);\n wrap.zpp_inner._inuse=true;\n wrap.zpp_inner._invalidate=modwrap;\n wrap.zpp_inner._validate=getwrap;\n }\n return wrap;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function modwrap(n:ZPP_Vec2):Void{\n {\n this.x=n.x;\n this.y=n.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"n.x\"+\",in y: \"+\"n.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"n.x\"+\",in y: \"+\"n.y\"+\")\");\n #end\n };\n };\n }\n public#if NAPE_NO_INLINE#else inline #end\n function getwrap():Void{\n {\n wrap.zpp_inner.x=this.x;\n wrap.zpp_inner.y=this.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap.zpp_inner.x!=wrap.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap.zpp_inner.\"+\",in x: \"+\"this.x\"+\",in y: \"+\"this.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap.zpp_inner.y!=wrap.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap.zpp_inner.\"+\",in x: \"+\"this.x\"+\",in y: \"+\"this.y\"+\")\");\n #end\n };\n };\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float,y:Float):ZPP_GeomVert{\n var ret;\n {\n if(ZPP_GeomVert.zpp_pool==null){\n ret=new ZPP_GeomVert();\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_TOT++;\n ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT--;\n ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n ret.x=x;\n ret.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.x!=ret.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.x)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.y!=ret.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.y)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n return ret;\n }\n public function new(){}\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomPoly{\n public var outer:GeomPoly=null;\n public var vertices:Null=null;\n public function new(outer:GeomPoly){\n this.outer=outer;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomVertexIterator{\n public var ptr:ZPP_GeomVert=null;\n public var start:ZPP_GeomVert=null;\n public var first:Bool=false;\n public var forward:Bool=false;\n public var outer:GeomVertexIterator=null;\n public var next:ZPP_GeomVertexIterator=null;\n static public var zpp_pool:ZPP_GeomVertexIterator=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n outer.zpp_inner=null;\n ptr=start=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n #if(!NAPE_RELEASE_BUILD)\n public static var internal=false;\n #end\n function new(){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer=new GeomVertexIterator();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n }\n public static function get(poly:ZPP_GeomVert,forward:Bool){\n var ret;\n {\n if(ZPP_GeomVertexIterator.zpp_pool==null){\n ret=new ZPP_GeomVertexIterator();\n #if NAPE_POOL_STATS ZPP_GeomVertexIterator.POOL_TOT++;\n ZPP_GeomVertexIterator.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_GeomVertexIterator.zpp_pool;\n ZPP_GeomVertexIterator.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_GeomVertexIterator.POOL_CNT--;\n ZPP_GeomVertexIterator.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.outer.zpp_inner=ret;\n ret.ptr=poly;\n ret.forward=forward;\n ret.start=poly;\n ret.first=poly!=null;\n return ret.outer;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Mat23{\n public var outer:Null=null;\n public function wrapper():Mat23{\n if(outer==null){\n outer=new Mat23();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Mat23\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Mat23.zpp_pool;\n ZPP_Mat23.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_CNT++;\n ZPP_Mat23.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var a:Float=0.0;\n public var b:Float=0.0;\n public var c:Float=0.0;\n public var d:Float=0.0;\n public var tx:Float=0.0;\n public var ty:Float=0.0;\n public var _invalidate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate(){\n if(_invalidate!=null){\n _invalidate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function set(m:ZPP_Mat23):Void{\n setas(m.a,m.b,m.c,m.d,m.tx,m.ty);\n }\n public function setas(a:Float,b:Float,c:Float,d:Float,tx:Float,ty:Float):Void{\n {\n this.tx=tx;\n this.ty=ty;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.tx!=this.tx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.tx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.t\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.ty!=this.ty));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.ty)\"+\") :: \"+(\"vec_set(in n: \"+\"this.t\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n };\n {\n this.a=a;\n this.b=b;\n this.c=c;\n this.d=d;\n };\n }\n public var next:ZPP_Mat23=null;\n static public var zpp_pool:ZPP_Mat23=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n public function new(){}\n public static function get():ZPP_Mat23{\n var ret;\n {\n if(ZPP_Mat23.zpp_pool==null){\n ret=new ZPP_Mat23();\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_TOT++;\n ZPP_Mat23.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_Mat23.zpp_pool;\n ZPP_Mat23.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_CNT--;\n ZPP_Mat23.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n return ret;\n }\n public static function identity():ZPP_Mat23{\n var ret=ZPP_Mat23.get();\n ret.setas(1,0,0,1,0,0);\n return ret;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_MatMN{\n public var outer:MatMN=null;\n public var m:Int=0;\n public var n:Int=0;\n public var x:TArray=null;\n public function new(m:Int,n:Int){\n this.m=m;\n this.n=n;\n #if flash10 x=new flash.Vector(m*n,true);\n #else x=new Array();\n for(i in 0...(m*n)){\n x.push(0.0);\n }\n #end\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_ToiEvent{\n public var next:ZPP_ToiEvent=null;\n static public var zpp_pool:ZPP_ToiEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n failed=false;\n s1=s2=null;\n arbiter=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){}\n public var toi:Float=0.0;\n public var s1:ZPP_Shape=null;\n public var s2:ZPP_Shape=null;\n public var arbiter:ZPP_ColArbiter=null;\n public var frozen1:Bool=false;\n public var frozen2:Bool=false;\n public var c1:ZPP_Vec2=null;\n public var c2:ZPP_Vec2=null;\n public var axis:ZPP_Vec2=null;\n public var slipped:Bool=false;\n public var failed:Bool=false;\n public var kinematic:Bool=false;\n public function new(){\n c1=new ZPP_Vec2();\n c2=new ZPP_Vec2();\n axis=new ZPP_Vec2();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SweepDistance{\n static public function dynamicSweep(toi:ZPP_ToiEvent,timeStep:Float,lowerBound:Float,negRadius:Float,userAPI:Bool=false){\n var s1:ZPP_Shape=toi.s1;\n var s2:ZPP_Shape=toi.s2;\n var b1:ZPP_Body=s1.body;\n var b2:ZPP_Body=s2.body;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=b2.velx-b1.velx;\n deltay=b2.vely-b1.vely;\n };\n var ang1=b1.angvel;\n if(ang1<0)ang1=-ang1;\n var ang2=b2.angvel;\n if(ang2<0)ang2=-ang2;\n var angBias=(s1.sweepCoef*ang1)+(s2.sweepCoef*ang2);\n if(!userAPI&&!toi.kinematic&&(deltax*deltax+deltay*deltay)<(Config.dynamicSweepLinearThreshold*Config.dynamicSweepLinearThreshold)&&angBias0){\n toi.slipped=true;\n }\n if(proj<=0||sep=1){\n curTOI=1;\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n b2.sweepIntegrate(curTOI*timeStep);\n b2.sweepValidate(s2);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=40){\n if(sep>negRadius){\n toi.failed=true;\n }\n break;\n }\n }\n toi.toi=curTOI;\n }\n static public function staticSweep(toi:ZPP_ToiEvent,timeStep:Float,lowerBound:Float,negRadius:Float){\n var s1:ZPP_Shape=toi.s1;\n var s2:ZPP_Shape=toi.s2;\n var b1:ZPP_Body=s1.body;\n var b2:ZPP_Body=s2.body;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=-b1.velx;\n deltay=-b1.vely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((deltax!=deltax));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(deltax)\"+\") :: \"+(\"vec_set(in n: \"+\"delta\"+\",in x: \"+\"-b1.velx\"+\",in y: \"+\"-b1.vely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((deltay!=deltay));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(deltay)\"+\") :: \"+(\"vec_set(in n: \"+\"delta\"+\",in x: \"+\"-b1.velx\"+\",in y: \"+\"-b1.vely\"+\")\");\n #end\n };\n };\n var ang1=b1.sweep_angvel;\n if(ang1<0)ang1=-ang1;\n var angBias=(s1.sweepCoef*ang1);\n var c1=toi.c1;\n var c2=toi.c2;\n var axis=toi.axis;\n var curTOI=lowerBound;\n var curIter=0;\n while(true){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(curTOI*timeStep!=curTOI*timeStep);\n };\n if(!res)throw \"assert(\"+\"!(curTOI*timeStep!=curTOI*timeStep)\"+\") :: \"+(curTOI+\" \"+timeStep);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(b1.sweepTime!=b1.sweepTime);\n };\n if(!res)throw \"assert(\"+\"!(b1.sweepTime!=b1.sweepTime)\"+\") :: \"+(\"sweeeeep\");\n #end\n };\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=1){\n curTOI=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(curTOI*timeStep!=curTOI*timeStep);\n };\n if(!res)throw \"assert(\"+\"!(curTOI*timeStep!=curTOI*timeStep)\"+\") :: \"+(curTOI+\" \"+timeStep);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(b1.sweepTime!=b1.sweepTime);\n };\n if(!res)throw \"assert(\"+\"!(b1.sweepTime!=b1.sweepTime)\"+\") :: \"+(\"sweeeeep\");\n #end\n };\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=40){\n if(sep>negRadius){\n toi.failed=true;\n }\n break;\n }\n }\n toi.toi=curTOI;\n }\n static public function distanceBody(b1:ZPP_Body,b2:ZPP_Body,w1:ZPP_Vec2,w2:ZPP_Vec2):Float{\n var t1;\n {\n if(ZPP_Vec2.zpp_pool==null){\n t1=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n t1=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=t1.next;\n t1.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n t1.alloc();\n };\n var t2;\n {\n if(ZPP_Vec2.zpp_pool==null){\n t2=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n t2=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=t2.next;\n t2.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n t2.alloc();\n };\n var ax;\n {\n if(ZPP_Vec2.zpp_pool==null){\n ax=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ax=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=ax.next;\n ax.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n ax.alloc();\n };\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=b1.shapes.begin();\n while(cx_ite!=null){\n var s1=cx_ite.elem();\n {\n {\n var cx_ite=b2.shapes.begin();\n while(cx_ite!=null){\n var s2=cx_ite.elem();\n {\n var dist=distance(s1,s2,t1,t2,ax,min);\n if(distupperBound){\n best=dist;\n break;\n }\n if(dist>0){\n if(dist>best){\n best=dist;\n a0=a;\n }\n }\n else if(best<0&&dist>best){\n best=dist;\n a0=a;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(best=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n {\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n nx=circle.worldCOMx-v1.x;\n ny=circle.worldCOMy-v1.y;\n };\n var len=ZPP_Math.sqrt((nx*nx+ny*ny));\n best=len-(0+circle.radius);\n if(bestupperBound){\n best=min;\n break;\n }\n if(min>0){\n if(min>best){\n best=min;\n a1=a;\n besti=1;\n }\n }\n else if(best<0&&min>best){\n best=min;\n a1=a;\n besti=1;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(bestupperBound){\n best=min;\n break;\n }\n if(min>0){\n if(min>best){\n best=min;\n a2=a;\n besti=2;\n }\n }\n else if(best<0&&min>best){\n best=min;\n a2=a;\n besti=2;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(best=0){\n var v0=ax.gp0;\n var v1=ax.gp1;\n var q0=ay.gp0;\n var q1=ay.gp1;\n var vx:Float=0.0;\n var vy:Float=0.0;\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n vx=v1.x-v0.x;\n vy=v1.y-v0.y;\n };\n {\n qx=q1.x-q0.x;\n qy=q1.y-q0.y;\n };\n var vdot=1/(vx*vx+vy*vy);\n var qdot=1/(qx*qx+qy*qy);\n var t1=-(vx*(v0.x-q0.x)+vy*(v0.y-q0.y))*vdot;\n var t2=-(vx*(v0.x-q1.x)+vy*(v0.y-q1.y))*vdot;\n var s1=-(qx*(q0.x-v0.x)+qy*(q0.y-v0.y))*qdot;\n var s2=-(qx*(q0.x-v1.x)+qy*(q0.y-v1.y))*qdot;\n if(t1<0)t1=0;\n else if(t1>1)t1=1;\n if(t2<0)t2=0;\n else if(t2>1)t2=1;\n if(s1<0)s1=0;\n else if(s1>1)s1=1;\n if(s2<0)s2=0;\n else if(s2>1)s2=1;\n var f1x:Float=0.0;\n var f1y:Float=0.0;\n {\n var t=(t1);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n f1x=v0.x+(vx*t);\n f1y=v0.y+(vy*t);\n };\n var f2x:Float=0.0;\n var f2y:Float=0.0;\n {\n var t=(t2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n f2x=v0.x+(vx*t);\n f2y=v0.y+(vy*t);\n };\n var g1x:Float=0.0;\n var g1y:Float=0.0;\n {\n var t=(s1);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n g1x=q0.x+(qx*t);\n g1y=q0.y+(qy*t);\n };\n var g2x:Float=0.0;\n var g2y:Float=0.0;\n {\n var t=(s2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n g2x=q0.x+(qx*t);\n g2y=q0.y+(qy*t);\n };\n var d1=ZPP_VecMath.vec_dsq(f1x,f1y,q0.x,q0.y);\n var d2=ZPP_VecMath.vec_dsq(f2x,f2y,q1.x,q1.y);\n var e1=ZPP_VecMath.vec_dsq(g1x,g1y,v0.x,v0.y);\n var e2=ZPP_VecMath.vec_dsq(g2x,g2y,v1.x,v1.y);\n var minfx:Float=0.0;\n var minfy:Float=0.0;\n var minq=null;\n if(d1Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c0\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c0x+=dvx*t;\n c0y+=dvy*t;\n };\n var t=(-ax.tp0-d1)*den;\n if(t<-Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c1\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c1x+=dvx*t;\n c1y+=dvy*t;\n };\n var c0d=(c0x*ax.gnormx+c0y*ax.gnormy)-ax.gprojection;\n var c1d=(c1x*ax.gnormx+c1y*ax.gnormy)-ax.gprojection;\n if(c0dVoid>=null;\n public var _validate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n if(_invalidate!=null){\n _invalidate(this);\n }\n }\n public var _immutable:Bool=false;\n public var _isimmutable:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function immutable():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_immutable){\n throw \"Error: Vec2 is immutable\";\n }\n if(_isimmutable!=null){\n _isimmutable();\n }\n #end\n }\n public var outer:Null=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function wrapper():Vec2{\n if(outer==null){\n outer=new Vec2();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var weak:Bool=false;\n static public var zpp_pool:ZPP_Vec2=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(outer!=null){\n outer.zpp_inner=null;\n outer=null;\n }\n _isimmutable=null;\n _validate=null;\n _invalidate=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n weak=false;\n }\n public var next:ZPP_Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Vec2{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_Vec2{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_Vec2):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Vec2):ZPP_Vec2{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Vec2,o:ZPP_Vec2):ZPP_Vec2{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Vec2,o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Vec2{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Vec2):ZPP_Vec2{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Vec2;\n var ret:ZPP_Vec2;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Vec2,n:Int):ZPP_Vec2{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Vec2):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Vec2{\n return begin().elem();\n }\n public function back():ZPP_Vec2{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n public var x:Float=0.0;\n public var y:Float=0.0;\n public function new(){}\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float,y:Float,immutable:Bool=false):ZPP_Vec2{\n var ret;\n {\n if(ZPP_Vec2.zpp_pool==null){\n ret=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret._immutable=immutable;\n {\n ret.x=x;\n ret.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.x!=ret.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.x)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.y!=ret.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.y)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function copy():ZPP_Vec2{\n return get(x,y);\n }\n public function toString():String{\n return \"{ x: \"+x+\" y: \"+y+\" }\";\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Vec3{\n public var outer:Vec3=null;\n public var x:Float=0.0;\n public var y:Float=0.0;\n public var z:Float=0.0;\n public var immutable:Bool=false;\n public var _validate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n public function new(){\n immutable=false;\n _validate=null;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_VecMath{\n public static#if NAPE_NO_INLINE#else inline #end\n function vec_dsq(ax:Float,ay:Float,bx:Float,by:Float):Float{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=ax-bx;\n dy=ay-by;\n };\n return(dx*dx+dy*dy);\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function vec_distance(ax:Float,ay:Float,bx:Float,by:Float):Float{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=ax-bx;\n dy=ay-by;\n };\n return ZPP_Math.sqrt((dx*dx+dy*dy));\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Interactor{\n public var outer_i:Interactor=null;\n public var id:Int=0;\n public var userData:Dynamic=null;\n public var ishape:ZPP_Shape=null;\n public var ibody:ZPP_Body=null;\n public var icompound:ZPP_Compound=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isShape(){\n return ishape!=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isBody(){\n return ibody!=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isCompound(){\n return icompound!=null;\n }\n public function __iaddedToSpace(){\n if(group!=null)group.addInteractor(this);\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.addInteractor(this);\n cx_ite=cx_ite.next;\n }\n };\n alloc_cbSet();\n }\n public function __iremovedFromSpace(){\n if(group!=null)group.remInteractor(this);\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.remInteractor(this);\n cx_ite=cx_ite.next;\n }\n };\n dealloc_cbSet();\n }\n public function wake(){\n if(isShape()){\n var body=ishape.body;\n if(body!=null&&body.space!=null)body.space.non_inlined_wake(body);\n true;\n }\n else if(isBody()){\n if(ibody.space!=null)ibody.space.non_inlined_wake(ibody)else false;\n }\n else{\n if(icompound.space!=null)icompound.space.wakeCompound(icompound);\n true;\n }\n }\n public var cbsets:ZNPList_ZPP_CallbackSet=null;\n public static function get(i1:ZPP_Interactor,i2:ZPP_Interactor){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i1!=i2;\n };\n if(!res)throw \"assert(\"+\"i1!=i2\"+\") :: \"+(\"trying to get cbset between interactor and itself?\");\n #end\n };\n var id=if(i1.id=[null,BodyType.STATIC,BodyType.DYNAMIC,BodyType.KINEMATIC];\n public function invalidate_type(){\n invalidate_mass();\n invalidate_inertia();\n }\n public var compound:ZPP_Compound=null;\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n public function invalidate_shapes(){\n invalidate_aabb();\n invalidate_localCOM();\n invalidate_mass();\n invalidate_inertia();\n }\n public var space:ZPP_Space=null;\n public var arbiters:ZNPList_ZPP_Arbiter=null;\n public var wrap_arbiters:ArbiterList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n public var component:ZPP_Component=null;\n static var bodystack:ZNPList_ZPP_Body=null;\n static var bodyset:ZPP_Set_ZPP_Body=null;\n static function bodysetlt(a:ZPP_Body,b:ZPP_Body){\n return a.idlinSq)false;\n else if(ZPP_VecMath.vec_dsq(posx,posy,pre_posx,pre_posy)>0.25*linSq*dt*dt)false else{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=aabb.maxx-aabb.minx;\n dy=aabb.maxy-aabb.miny;\n };\n var idl=(dx*dx+dy*dy);\n var angSq=Config.angularSleepThreshold;\n angSq*=angSq;\n if(4*angvel*angvel*idl>angSq)false else{\n var dr=rot-pre_rot;\n if(dr*dr*idl>angSq*dt*dt)false else true;\n }\n }\n if(!cansleep)component.waket=space.stamp;\n return component.waket+Config.sleepDelay0.0001)quick_validate_axis();\n else{\n var d2=dr*dr;\n var p=1-0.5*d2;\n var m=1-d2*d2/8;\n var nx=(p*axisx+dr*axisy)*m;\n axisy=(p*axisy-dr*axisx)*m;\n axisx=nx;\n }\n }\n public var kinematicDelaySleep:Bool;\n public var mass:Float=0.0;\n public var zip_mass:Bool=false;\n public var massMode:Int=0;\n public var imass:Float=0.0;\n public var smass:Float=0.0;\n public var cmass:Float=0.0;\n public var nomove:Bool=false;\n public function invalidate_mass(){\n zip_mass=true;\n invalidate_gravMass();\n }\n public function validate_mass(){\n var exist=false;\n if(zip_mass||(massMode==ZPP_Flags.id_MassMode_DEFAULT&&exist)){\n zip_mass=false;\n if(massMode==ZPP_Flags.id_MassMode_DEFAULT){\n cmass=0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.refmaterial.density=s.material.density;\n s.validate_area_inertia();\n cmass+=s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n if(isDynamic()&&!nomove){\n mass=cmass;\n imass=smass=1.0/mass;\n }\n else{\n mass=ZPP_Const.POSINF();\n imass=smass=0.0;\n }\n if(exist)invalidate_inertia();\n }\n }\n public var gravMass:Float=0.0;\n public var zip_gravMass:Bool=false;\n public var gravMassMode:Int=0;\n public var gravMassScale:Float=0.0;\n public var zip_gravMassScale:Bool=false;\n public function invalidate_gravMass(){\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_FIXED)zip_gravMass=true;\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)zip_gravMassScale=true;\n wake();\n }\n public function validate_gravMass(){\n if(zip_gravMass){\n zip_gravMass=false;\n validate_mass();\n if(gravMassMode==ZPP_Flags.id_GravMassMode_DEFAULT){\n validate_mass();\n gravMass=cmass;\n }\n else if(gravMassMode==ZPP_Flags.id_GravMassMode_SCALED){\n validate_mass();\n gravMass=cmass*gravMassScale;\n }\n }\n }\n public function invalidate_gravMassScale(){\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)zip_gravMassScale=true;\n else invalidate_gravMass();\n }\n public function validate_gravMassScale(){\n if(zip_gravMassScale){\n zip_gravMassScale=false;\n if(gravMassMode==ZPP_Flags.id_GravMassMode_DEFAULT)gravMassScale=1.0;\n else if(gravMassMode==ZPP_Flags.id_GravMassMode_FIXED){\n validate_mass();\n gravMassScale=gravMass/cmass;\n }\n }\n }\n public var inertiaMode:Int=0;\n public var inertia:Float=0.0;\n public var zip_inertia:Bool=false;\n public var cinertia:Float=0.0;\n public var iinertia:Float=0.0;\n public var sinertia:Float=0.0;\n public var norotate:Bool=false;\n public function invalidate_inertia(){\n zip_inertia=true;\n wake();\n }\n public function validate_inertia(){\n var exist=false;\n if(zip_inertia||(inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT&&exist)){\n zip_inertia=false;\n if(inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT){\n cinertia=0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.refmaterial.density=s.material.density;\n s.validate_area_inertia();\n cinertia+=s.inertia*s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n if(isDynamic()&&!norotate){\n inertia=cinertia;\n sinertia=iinertia=1.0/inertia;\n }\n else{\n inertia=ZPP_Const.POSINF();\n sinertia=iinertia=0;\n }\n if(exist)invalidate_inertia();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_wake(){\n wake();\n }\n public var aabb:ZPP_AABB=null;\n public var zip_aabb:Bool=false;\n public#if NAPE_NO_INLINE#else inline #end\n function validate_aabb(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: Body bounds only makes sense if it contains shapes\";\n #end\n if(zip_aabb){\n zip_aabb=false;\n {\n aabb.minx=ZPP_Const.POSINF();\n aabb.miny=ZPP_Const.POSINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=ZPP_Const.NEGINF();\n aabb.maxy=ZPP_Const.NEGINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"ZPP_Const.NEGINF()\"+\",in y: \"+\"ZPP_Const.NEGINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"ZPP_Const.NEGINF()\"+\",in y: \"+\"ZPP_Const.NEGINF()\"+\")\");\n #end\n };\n };\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.validate_aabb();\n aabb.combine(s.aabb);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_aabb(){\n zip_aabb=true;\n }\n public var localCOMx:Float=0.0;\n public var localCOMy:Float=0.0;\n public var zip_localCOM:Bool=false;\n public var worldCOMx:Float=0.0;\n public var worldCOMy:Float=0.0;\n public var zip_worldCOM:Bool=false;\n public var wrap_localCOM:Vec2=null;\n public var wrap_worldCOM:Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_localCOM(){\n zip_localCOM=true;\n invalidate_worldCOM();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_worldCOM(){\n zip_worldCOM=true;\n }\n public function validate_localCOM(){\n if(zip_localCOM){\n zip_localCOM=false;\n var tempx:Float=0;\n var tempy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((tempx!=tempx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(tempx)\"+\") :: \"+(\"vec_new(in n: \"+\"temp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((tempy!=tempy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(tempy)\"+\") :: \"+(\"vec_new(in n: \"+\"temp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var msum=0.0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.validate_localCOM();\n s.validate_area_inertia();\n {\n var t=(s.area*s.material.density);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"temp\"+\",in b: \"+\"s.localCOM\"+\",in s: \"+\"s.area*s.material.density\"+\")\");\n #end\n };\n tempx+=s.localCOMx*t;\n tempy+=s.localCOMy*t;\n };\n msum+=s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(msum!=0){\n {\n var t=(1.0/(msum));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"temp\"+\",in s: \"+\"1.0/(msum)\"+\",out r: \"+\"localCOM\"+\")\");\n #end\n };\n localCOMx=tempx*t;\n localCOMy=tempy*t;\n };\n }\n if(wrap_localCOM!=null){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n if(zip_mass&&massMode==ZPP_Flags.id_MassMode_DEFAULT){\n zip_mass=false;\n cmass=msum;\n if(isDynamic()){\n mass=cmass;\n imass=smass=1.0/mass;\n }\n else{\n mass=ZPP_Const.POSINF();\n imass=smass=0.0;\n }\n }\n }\n }\n public function validate_worldCOM(){\n if(zip_worldCOM){\n zip_worldCOM=false;\n validate_localCOM();\n validate_axis();\n {\n worldCOMx=posx+(axisy*localCOMx-axisx*localCOMy);\n worldCOMy=posy+(localCOMx*axisx+localCOMy*axisy);\n };\n if(wrap_worldCOM!=null){\n wrap_worldCOM.zpp_inner.x=worldCOMx;\n wrap_worldCOM.zpp_inner.y=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.x!=wrap_worldCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.y!=wrap_worldCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n }\n }\n public function getlocalCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: localCOM only makes sense when Body has Shapes\";\n #end\n validate_localCOM();\n }\n public function getworldCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: worldCOM only makes sense when Body has Shapes\";\n #end\n validate_worldCOM();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: \"+name+\" cannot be set during a space step()\";\n #end\n }\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null)throw \"Error: Cannot clear a Body if it is currently being used by a Space!\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!constraints.empty())throw \"Error: Cannot clear a Body if it is currently being used by a constraint!\";\n #end\n {\n while(!shapes.empty()){\n var s=shapes.pop_unsafe();\n {\n s.removedFromBody();\n s.body=null;\n };\n }\n };\n invalidate_shapes();\n {\n pre_posx=0;\n pre_posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posx!=pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posy!=pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n posx=0;\n posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posx!=posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posy!=posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n velx=0;\n vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((velx!=velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(velx)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vely!=vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vely)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n forcex=0;\n forcey=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcex!=forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcey!=forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n kinvelx=0;\n kinvely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvelx!=kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvely!=kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n svelx=0;\n svely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svelx!=svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svely!=svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svely)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n angvel=torque=kinangvel=pre_rot=rot=0;\n invalidate_pos();\n invalidate_rot();\n {\n axisx=0;\n axisy=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisx!=axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisy!=axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n zip_axis=false;\n massMode=ZPP_Flags.id_MassMode_DEFAULT;\n gravMassMode=ZPP_Flags.id_GravMassMode_DEFAULT;\n gravMassScale=1.0;\n inertiaMode=ZPP_Flags.id_InertiaMode_DEFAULT;\n norotate=false;\n nomove=false;\n }\n public static function __static():Body{\n var ret=new Body(BodyType.STATIC);\n var si=ret.zpp_inner;\n si.world=true;\n si.wrap_shapes.zpp_inner.immutable=true;\n si.smass=si.imass=si.cmass=si.mass=si.gravMass=0.0;\n si.sinertia=si.iinertia=si.cinertia=si.inertia=0.0;\n si.cbTypes.clear();\n return ret;\n }\n private function aabb_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: bounds only makes sense when Body has shapes\";\n #end\n validate_aabb();\n }\n private function shapes_adder(s:Shape){\n if(s.zpp_inner.body!=this){\n if(s.zpp_inner.body!=null)s.zpp_inner.body.wrap_shapes.remove(s);\n s.zpp_inner.body=this;\n s.zpp_inner.addedToBody();\n if(space!=null)space.added_shape(s.zpp_inner);\n if(s.zpp_inner.isPolygon()){\n s.zpp_inner.polygon.invalidate_gaxi();\n s.zpp_inner.polygon.invalidate_gverts();\n }\n return true;\n }\n else return false;\n }\n private function shapes_subber(s:Shape){\n if(space!=null)space.removed_shape(s.zpp_inner);\n s.zpp_inner.body=null;\n s.zpp_inner.removedFromBody();\n }\n private function shapes_invalidate(_){\n invalidate_shapes();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function shapes_modifiable(){\n immutable_midstep(\"Body::shapes\");\n if(isStatic()&&space!=null)throw \"Error: Cannot modifiy shapes of static object once added to Space\";\n }\n #end\n public function new(){\n super();\n ibody=this;\n world=false;\n bulletEnabled=false;\n sweepTime=0;\n sweep_angvel=0;\n norotate=nomove=false;\n disableCCD=false;\n {\n posx=0;\n posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posx!=posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posy!=posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n rot=0;\n {\n axisx=0;\n axisy=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisx!=axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisy!=axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n {\n svelx=0;\n svely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svelx!=svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svely!=svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svely)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n velx=0;\n vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((velx!=velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(velx)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vely!=vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vely)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n kinvelx=0;\n kinvely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvelx!=kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvely!=kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n forcex=0;\n forcey=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcex!=forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcey!=forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n torque=angvel=kinangvel=0;\n {\n pre_posx=ZPP_Const.POSINF();\n pre_posy=ZPP_Const.POSINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posx!=pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posy!=pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n };\n pre_rot=ZPP_Const.POSINF();\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n worldCOMx=0;\n worldCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMx!=worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMy!=worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n zip_aabb=true;\n aabb=ZPP_AABB.get(0,0,0,0);\n aabb._immutable=true;\n var me=this;\n aabb._validate=aabb_validate;\n massMode=ZPP_Flags.id_MassMode_DEFAULT;\n gravMassMode=ZPP_Flags.id_GravMassMode_DEFAULT;\n gravMassScale=1.0;\n inertiaMode=ZPP_Flags.id_InertiaMode_DEFAULT;\n arbiters=new ZNPList_ZPP_Arbiter();\n constraints=new ZNPList_ZPP_Constraint();\n shapes=new ZNPList_ZPP_Shape();\n wrap_shapes=ZPP_ShapeList.get(shapes);\n wrap_shapes.zpp_inner.adder=shapes_adder;\n wrap_shapes.zpp_inner.subber=shapes_subber;\n wrap_shapes.zpp_inner._invalidate=shapes_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_shapes.zpp_inner._modifiable=shapes_modifiable;\n #end\n kinematicDelaySleep=false;\n }\n public function addedToSpace(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n component==null;\n };\n if(!res)throw \"assert(\"+\"component==null\"+\") :: \"+(\"already has a component?\");\n #end\n };\n {\n if(ZPP_Component.zpp_pool==null){\n component=new ZPP_Component();\n #if NAPE_POOL_STATS ZPP_Component.POOL_TOT++;\n ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n component=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=component.next;\n component.next=null;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT--;\n ZPP_Component.POOL_ADD++;\n #end\n }\n component.alloc();\n };\n component.isBody=true;\n component.body=this;\n __iaddedToSpace();\n }\n public function removedFromSpace(){\n while(!arbiters.empty()){\n var arb=arbiters.pop_unsafe();\n arb.lazyRetire(space,this);\n }\n {\n var o=component;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Component\"+\", in obj: \"+\"component\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT++;\n ZPP_Component.POOL_SUB++;\n #end\n };\n component=null;\n __iremovedFromSpace();\n }\n public function copy(){\n var ret=new Body().zpp_inner;\n ret.type=type;\n ret.bulletEnabled=bulletEnabled;\n ret.disableCCD=disableCCD;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n ret.outer.shapes.add(s.outer.copy());\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n ret.posx=posx;\n ret.posy=posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.posx!=ret.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.pos\"+\",in x: \"+\"posx\"+\",in y: \"+\"posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.posy!=ret.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.pos\"+\",in x: \"+\"posx\"+\",in y: \"+\"posy\"+\")\");\n #end\n };\n };\n {\n ret.velx=velx;\n ret.vely=vely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.velx!=ret.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.vel\"+\",in x: \"+\"velx\"+\",in y: \"+\"vely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.vely!=ret.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.vel\"+\",in x: \"+\"velx\"+\",in y: \"+\"vely\"+\")\");\n #end\n };\n };\n {\n ret.forcex=forcex;\n ret.forcey=forcey;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.forcex!=ret.forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.force\"+\",in x: \"+\"forcex\"+\",in y: \"+\"forcey\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.forcey!=ret.forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.force\"+\",in x: \"+\"forcex\"+\",in y: \"+\"forcey\"+\")\");\n #end\n };\n };\n ret.rot=rot;\n ret.angvel=angvel;\n ret.torque=torque;\n {\n ret.kinvelx=kinvelx;\n ret.kinvely=kinvely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.kinvelx!=ret.kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.kinvel\"+\",in x: \"+\"kinvelx\"+\",in y: \"+\"kinvely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.kinvely!=ret.kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.kinvel\"+\",in x: \"+\"kinvelx\"+\",in y: \"+\"kinvely\"+\")\");\n #end\n };\n };\n ret.kinangvel=kinangvel;\n {\n ret.svelx=svelx;\n ret.svely=svely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.svelx!=ret.svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.svel\"+\",in x: \"+\"svelx\"+\",in y: \"+\"svely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.svely!=ret.svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.svely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.svel\"+\",in x: \"+\"svelx\"+\",in y: \"+\"svely\"+\")\");\n #end\n };\n };\n if(!zip_axis){\n ret.axisx=axisx;\n ret.axisy=axisy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.axisx!=ret.axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.axis\"+\",in x: \"+\"axisx\"+\",in y: \"+\"axisy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.axisy!=ret.axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.axis\"+\",in x: \"+\"axisx\"+\",in y: \"+\"axisy\"+\")\");\n #end\n };\n };\n else ret.invalidate_rot();\n ret.rot=rot;\n ret.massMode=massMode;\n ret.gravMassMode=gravMassMode;\n ret.inertiaMode=inertiaMode;\n ret.norotate=norotate;\n ret.nomove=nomove;\n ret.cmass=cmass;\n ret.cinertia=cinertia;\n if(!zip_mass)ret.mass=mass;\n else ret.invalidate_mass();\n if(!zip_gravMass)ret.gravMass=gravMass;\n else ret.invalidate_gravMass();\n if(!zip_gravMassScale)ret.gravMassScale=gravMassScale;\n else ret.invalidate_gravMassScale();\n if(!zip_inertia)ret.inertia=inertia;\n else ret.invalidate_inertia();\n if(!zip_aabb){\n {\n ret.aabb.minx=aabb.minx;\n ret.aabb.miny=aabb.miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.minx!=ret.aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.miny!=ret.aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n };\n {\n ret.aabb.maxx=aabb.maxx;\n ret.aabb.maxy=aabb.maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxx!=ret.aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxy!=ret.aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n };\n }\n else ret.invalidate_aabb();\n if(!zip_localCOM){\n ret.localCOMx=localCOMx;\n ret.localCOMy=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMx!=ret.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMy!=ret.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n else ret.invalidate_localCOM();\n if(!zip_worldCOM){\n ret.worldCOMx=worldCOMx;\n ret.worldCOMy=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.worldCOMx!=ret.worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.worldCOM\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.worldCOMy!=ret.worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.worldCOM\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n else ret.invalidate_worldCOM();\n copyto(ret.outer);\n return ret.outer;\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Compound extends ZPP_Interactor{\n public var outer:Compound=null;\n public var bodies:ZNPList_ZPP_Body=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var compounds:ZNPList_ZPP_Compound=null;\n public var wrap_bodies:BodyList=null;\n public var wrap_constraints:ConstraintList=null;\n public var wrap_compounds:CompoundList=null;\n public var depth:Int=0;\n public var compound:ZPP_Compound=null;\n public var space:ZPP_Space=null;\n public function __imutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: \"+name+\" cannot be set during space step()\";\n #end\n }\n public function addedToSpace(){\n __iaddedToSpace();\n }\n public function removedFromSpace(){\n __iremovedFromSpace();\n }\n public function breakApart(){\n if(space!=null){\n __iremovedFromSpace();\n space.nullInteractorType(this);\n }\n if(compound!=null)compound.compounds.remove(this);\n else if(space!=null)space.compounds.remove(this);\n {\n while(!bodies.empty()){\n var b=bodies.pop_unsafe();\n {\n if((b.compound=compound)!=null)compound.bodies.add(b);\n else if(space!=null)space.bodies.add(b);\n if(space!=null)space.freshInteractorType(b);\n };\n }\n };\n {\n while(!constraints.empty()){\n var c=constraints.pop_unsafe();\n {\n if((c.compound=compound)!=null)compound.constraints.add(c);\n else if(space!=null)space.constraints.add(c);\n };\n }\n };\n {\n while(!compounds.empty()){\n var c=compounds.pop_unsafe();\n {\n if((c.compound=compound)!=null)compound.compounds.add(c);\n else if(space!=null)space.compounds.add(c);\n if(space!=null)space.freshInteractorType(c);\n };\n }\n };\n compound=null;\n space=null;\n }\n \n private function bodies_adder(x:Body){\n {}\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_bodies.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_bodies.remove(x);\n x.zpp_inner.compound=this;\n {};\n if(space!=null)space.addBody(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function bodies_subber(x:Body){\n x.zpp_inner.compound=null;\n {};\n if(space!=null)space.remBody(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function bodies_modifiable(){\n immutable_midstep(\"Compound::\"+\"bodies\");\n }\n #end\n private function constraints_adder(x:Constraint){\n {}\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_constraints.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_constraints.remove(x);\n x.zpp_inner.compound=this;\n {};\n if(space!=null)space.addConstraint(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function constraints_subber(x:Constraint){\n x.zpp_inner.compound=null;\n {};\n if(space!=null)space.remConstraint(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function constraints_modifiable(){\n immutable_midstep(\"Compound::\"+\"constraints\");\n }\n #end\n private function compounds_adder(x:Compound){\n #if(!NAPE_RELEASE_BUILD)\n var cur=this;\n while(cur!=null&&cur!=x.zpp_inner)cur=cur.compound;\n if(cur==x.zpp_inner){\n throw \"Error: Assignment would cause a cycle in the Compound tree: assigning \"+x.toString()+\".compound = \"+outer.toString();\n return false;\n }\n #end\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_compounds.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_compounds.remove(x);\n x.zpp_inner.compound=this;\n x.zpp_inner.depth=depth+1;\n if(space!=null)space.addCompound(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function compounds_subber(x:Compound){\n x.zpp_inner.compound=null;\n x.zpp_inner.depth=1;\n if(space!=null)space.remCompound(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function compounds_modifiable(){\n immutable_midstep(\"Compound::\"+\"compounds\");\n }\n #end\n public function new(){\n super();\n icompound=this;\n depth=1;\n var me=this;\n bodies=new ZNPList_ZPP_Body();\n wrap_bodies=ZPP_BodyList.get(bodies);\n wrap_bodies.zpp_inner.adder=bodies_adder;\n wrap_bodies.zpp_inner.subber=bodies_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_bodies.zpp_inner._modifiable=bodies_modifiable;\n #end\n constraints=new ZNPList_ZPP_Constraint();\n wrap_constraints=ZPP_ConstraintList.get(constraints);\n wrap_constraints.zpp_inner.adder=constraints_adder;\n wrap_constraints.zpp_inner.subber=constraints_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_constraints.zpp_inner._modifiable=constraints_modifiable;\n #end\n compounds=new ZNPList_ZPP_Compound();\n wrap_compounds=ZPP_CompoundList.get(compounds);\n wrap_compounds.zpp_inner.adder=compounds_adder;\n wrap_compounds.zpp_inner.subber=compounds_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_compounds.zpp_inner._modifiable=compounds_modifiable;\n #end\n }\n public function copy(dict:Array=null,todo:Array=null):Compound{\n var root=dict==null;\n if(dict==null)dict=new Array();\n if(todo==null)todo=new Array();\n var ret=new Compound();\n {\n var cx_ite=compounds.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n var cc=c.copy(dict,todo);\n cc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=bodies.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n var bc=b.outer.copy();\n dict.push(ZPP_CopyHelper.dict(b.id,bc));\n bc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=constraints.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n var cc=c.copy(dict,todo);\n cc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(root){\n while(todo.length>0){\n var xcb=todo.pop();\n for(idc in dict){\n if(idc.id==xcb.id){\n xcb.cb(idc.bc);\n break;\n }\n }\n }\n }\n copyto(ret);\n return ret;\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_FluidProperties{\n public var next:ZPP_FluidProperties=null;\n static public var zpp_pool:ZPP_FluidProperties=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:FluidProperties=null;\n public function wrapper(){\n if(outer==null){\n outer=new FluidProperties();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidProperties\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT++;\n ZPP_FluidProperties.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public function copy(){\n var ret;\n {\n if(ZPP_FluidProperties.zpp_pool==null){\n ret=new ZPP_FluidProperties();\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_TOT++;\n ZPP_FluidProperties.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT--;\n ZPP_FluidProperties.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.viscosity=viscosity;\n ret.density=density;\n return ret;\n }\n public function new(){\n feature_cons();\n density=viscosity=1;\n wrap_gravity=null;\n {\n gravityx=0;\n gravityy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n }\n public var viscosity:Float=0.0;\n public var density:Float=0.0;\n public var gravityx:Float=0.0;\n public var gravityy:Float=0.0;\n public var wrap_gravity:Vec2=null;\n private function gravity_invalidate(x:ZPP_Vec2){\n {\n gravityx=x.x;\n gravityy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n private function gravity_validate(){\n {\n wrap_gravity.zpp_inner.x=gravityx;\n wrap_gravity.zpp_inner.y=gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.x!=wrap_gravity.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.y!=wrap_gravity.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n };\n }\n public function getgravity(){\n wrap_gravity=Vec2.get(gravityx,gravityy);\n wrap_gravity.zpp_inner._inuse=true;\n wrap_gravity.zpp_inner._invalidate=gravity_invalidate;\n wrap_gravity.zpp_inner._validate=gravity_validate;\n }\n public function invalidate(){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n shape.invalidate_fluidprops();\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Material{\n public var next:ZPP_Material=null;\n static public var zpp_pool:ZPP_Material=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:Material=null;\n public function wrapper(){\n if(outer==null){\n outer=new Material();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Material\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT++;\n ZPP_Material.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public var dynamicFriction:Float=0.0;\n public var staticFriction:Float=0.0;\n public var density:Float=0.0;\n public var elasticity:Float=0.0;\n public var rollingFriction:Float=0.0;\n public function new(){\n feature_cons();\n elasticity=0;\n dynamicFriction=1;\n staticFriction=2;\n density=0.001;\n rollingFriction=0.01;\n }\n public function copy(){\n var ret=new ZPP_Material();\n ret.dynamicFriction=dynamicFriction;\n ret.staticFriction=staticFriction;\n ret.density=density;\n ret.elasticity=elasticity;\n ret.rollingFriction=rollingFriction;\n return ret;\n }\n public function set(x:ZPP_Material){\n dynamicFriction=x.dynamicFriction;\n staticFriction=x.staticFriction;\n density=x.density;\n elasticity=x.elasticity;\n rollingFriction=x.rollingFriction;\n }\n public static var WAKE=1;\n public static var PROPS=2;\n public static var ANGDRAG=4;\n public static var ARBITERS=8;\n public function invalidate(x:Int){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.invalidate_material(x);\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Shape extends ZPP_Interactor{\n public var outer:Shape=null;\n public var body:ZPP_Body=null;\n public var type:Int=0;\n public static var types:Array=[ShapeType.CIRCLE,ShapeType.POLYGON];\n public#if NAPE_NO_INLINE#else inline #end\n function isCircle(){\n return type==ZPP_Flags.id_ShapeType_CIRCLE;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function isPolygon(){\n return type==ZPP_Flags.id_ShapeType_POLYGON;\n }\n public var area:Float=0.0;\n public var zip_area_inertia:Bool=false;\n public var inertia:Float=0.0;\n public var angDrag:Float=0.0;\n public var zip_angDrag:Bool=false;\n public var localCOMx:Float=0.0;\n public var localCOMy:Float=0.0;\n public var zip_localCOM:Bool=false;\n public var worldCOMx:Float=0.0;\n public var worldCOMy:Float=0.0;\n public var zip_worldCOM:Bool=false;\n public var wrap_localCOM:Vec2=null;\n public var wrap_worldCOM:Vec2=null;\n public var sweepRadius:Float=0.0;\n public var zip_sweepRadius:Bool=false;\n public var sweepCoef:Float=0.0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_sweepRadius(){\n zip_sweepRadius=true;\n }\n public function validate_sweepRadius(){\n if(zip_sweepRadius){\n zip_sweepRadius=false;\n if(isCircle())circle.__validate_sweepRadius();\n else polygon.__validate_sweepRadius();\n }\n }\n public var circle:ZPP_Circle=null;\n public var polygon:ZPP_Polygon=null;\n public var refmaterial:ZPP_Material=null;\n public var material:ZPP_Material=null;\n public var filter:ZPP_InteractionFilter=null;\n public var fluidProperties:ZPP_FluidProperties=null;\n public var fluidEnabled:Bool=false;\n public var sensorEnabled:Bool=false;\n public var sweep:ZPP_SweepData=null;\n public var node:ZPP_AABBNode=null;\n public var pairs:ZNPList_ZPP_AABBPair=null;\n public function clear(){\n if(isCircle())circle.__clear();\n else polygon.__clear();\n }\n public var aabb:ZPP_AABB=null;\n public var zip_aabb:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_aabb(){\n if(zip_aabb){\n if(body!=null){\n zip_aabb=false;\n if(isCircle())circle.__validate_aabb();\n else polygon.__validate_aabb();\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function force_validate_aabb(){\n if(isCircle())circle._force_validate_aabb();\n else polygon._force_validate_aabb();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_aabb(){\n zip_aabb=true;\n if(body!=null)body.invalidate_aabb();\n }\n public function validate_area_inertia(){\n if(zip_area_inertia){\n zip_area_inertia=false;\n if(isCircle())circle.__validate_area_inertia();\n else polygon.__validate_area_inertia();\n }\n }\n public function validate_angDrag(){\n if(zip_angDrag||refmaterial.dynamicFriction!=material.dynamicFriction){\n zip_angDrag=false;\n refmaterial.dynamicFriction=material.dynamicFriction;\n if(isCircle())circle.__validate_angDrag();\n else polygon.__validate_angDrag();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_localCOM(){\n if(zip_localCOM){\n zip_localCOM=false;\n if(isPolygon())polygon.__validate_localCOM();\n if(wrap_localCOM!=null){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_worldCOM(){\n if(zip_worldCOM){\n if(body!=null){\n zip_worldCOM=false;\n validate_localCOM();\n body.validate_axis();\n {\n worldCOMx=body.posx+(body.axisy*localCOMx-body.axisx*localCOMy);\n worldCOMy=body.posy+(localCOMx*body.axisx+localCOMy*body.axisy);\n };\n }\n }\n }\n public function getworldCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: worldCOM only makes sense when Shape belongs to a Body\";\n #end\n validate_worldCOM();\n {\n wrap_worldCOM.zpp_inner.x=worldCOMx;\n wrap_worldCOM.zpp_inner.y=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.x!=wrap_worldCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.y!=wrap_worldCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n }\n public function invalidate_area_inertia(){\n zip_area_inertia=true;\n if(body!=null){\n body.invalidate_localCOM();\n body.invalidate_mass();\n body.invalidate_inertia();\n }\n }\n public function invalidate_angDrag(){\n zip_angDrag=true;\n }\n public function invalidate_localCOM(){\n zip_localCOM=true;\n invalidate_area_inertia();\n if(isCircle())invalidate_sweepRadius();\n invalidate_angDrag();\n invalidate_worldCOM();\n if(body!=null)body.invalidate_localCOM();\n }\n public function invalidate_worldCOM(){\n zip_worldCOM=true;\n invalidate_aabb();\n }\n public function invalidate_material(flags:Int){\n if((flags&ZPP_Material.WAKE)!=0)wake();\n if((flags&ZPP_Material.ARBITERS)!=0){\n if(body!=null)body.refreshArbiters();\n }\n if((flags&ZPP_Material.PROPS)!=0){\n if(body!=null){\n body.invalidate_localCOM();\n body.invalidate_mass();\n body.invalidate_inertia();\n }\n }\n if((flags&ZPP_Material.ANGDRAG)!=0){\n invalidate_angDrag();\n }\n refmaterial.set(material);\n }\n public function invalidate_filter(){\n wake();\n }\n public function invalidate_fluidprops(){\n if(fluidEnabled)wake();\n }\n private function aabb_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: bounds only makes sense when Shape belongs to a Body\";\n #end\n validate_aabb();\n }\n function new(type:Int){\n super();\n pairs=new ZNPList_ZPP_AABBPair();\n ishape=this;\n this.type=type;\n aabb=ZPP_AABB.get(0,0,0,0);\n aabb._immutable=true;\n var me=this;\n aabb._validate=aabb_validate;\n zip_area_inertia=zip_angDrag=zip_localCOM=zip_sweepRadius=true;\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n worldCOMx=0;\n worldCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMx!=worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMy!=worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n fluidEnabled=false;\n sensorEnabled=false;\n fluidProperties=null;\n body=null;\n refmaterial=new ZPP_Material();\n sweepRadius=sweepCoef=0;\n }\n public function setMaterial(material:ZPP_Material){\n if(this.material!=material){\n if(body!=null&&body.space!=null){\n if(this.material!=null)this.material.remShape(this);\n }\n this.material=material;\n if(body!=null&&body.space!=null)material.addShape(this);\n wake();\n if(body!=null)body.refreshArbiters();\n }\n }\n public function setFilter(filter:ZPP_InteractionFilter){\n if(this.filter!=filter){\n if(body!=null&&body.space!=null){\n if(this.filter!=null)this.filter.remShape(this);\n }\n this.filter=filter;\n if(body!=null&&body.space!=null)filter.addShape(this);\n wake();\n }\n }\n public function setFluid(fluid:ZPP_FluidProperties){\n if(fluidProperties!=fluid){\n if(body!=null&&body.space!=null){\n if(fluidProperties!=null)fluidProperties.remShape(this);\n }\n fluidProperties=fluid;\n if(body!=null&&body.space!=null)fluid.addShape(this);\n if(fluidEnabled)wake();\n }\n }\n public function __immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body.space!=null&&body.space.midstep)throw \"Error: \"+name+\" cannot be set during a space step()\";\n #end\n }\n public function addedToBody(){\n invalidate_worldCOM();\n invalidate_aabb();\n }\n public function removedFromBody(){}\n public function addedToSpace(){\n __iaddedToSpace();\n material.addShape(this);\n filter.addShape(this);\n if(fluidProperties!=null)fluidProperties.addShape(this);\n }\n public function removedFromSpace(){\n __iremovedFromSpace();\n material.remShape(this);\n filter.remShape(this);\n if(fluidProperties!=null)fluidProperties.remShape(this);\n }\n public function copy(){\n var ret:ZPP_Shape=null;\n if(isCircle())ret=circle.__copy();\n else ret=polygon.__copy();\n if(!zip_area_inertia){\n ret.area=area;\n ret.inertia=inertia;\n }\n else ret.invalidate_area_inertia();\n if(!zip_sweepRadius){\n ret.sweepRadius=sweepRadius;\n ret.sweepCoef=sweepCoef;\n }\n else ret.invalidate_sweepRadius();\n if(!zip_angDrag)ret.angDrag=angDrag;\n else ret.invalidate_angDrag();\n if(!zip_aabb){\n {\n ret.aabb.minx=aabb.minx;\n ret.aabb.miny=aabb.miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.minx!=ret.aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.miny!=ret.aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n };\n {\n ret.aabb.maxx=aabb.maxx;\n ret.aabb.maxy=aabb.maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxx!=ret.aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxy!=ret.aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n };\n }\n else ret.invalidate_aabb();\n {\n var o=ret.material;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Material\"+\", in obj: \"+\"ret.material\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT++;\n ZPP_Material.POOL_SUB++;\n #end\n };\n {\n var o=ret.filter;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_InteractionFilter\"+\", in obj: \"+\"ret.filter\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT++;\n ZPP_InteractionFilter.POOL_SUB++;\n #end\n };\n ret.material=material;\n ret.filter=filter;\n if(fluidProperties!=null)ret.fluidProperties=fluidProperties;\n ret.fluidEnabled=fluidEnabled;\n ret.sensorEnabled=sensorEnabled;\n if(userData!=null)ret.userData=Reflect.copy(userData);\n copyto(ret.outer);\n return ret.outer;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Circle extends ZPP_Shape{\n public var outer_zn:Circle=null;\n public var radius:Float=0.0;\n public function new(){\n super(ZPP_Flags.id_ShapeType_CIRCLE);\n circle=this;\n zip_localCOM=false;\n }\n public function __clear(){}\n public function invalidate_radius(){\n invalidate_area_inertia();\n invalidate_angDrag();\n invalidate_aabb();\n if(body!=null)body.wake();\n }\n private function localCOM_validate(){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n }\n private function localCOM_invalidate(x:ZPP_Vec2){\n {\n localCOMx=x.x;\n localCOMy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n invalidate_localCOM();\n if(body!=null)body.wake();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function localCOM_immutable(){\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modify localCOM of Circle added to a static Body whilst within a Space\";\n }\n #end\n public function setupLocalCOM(){\n var me=this;\n wrap_localCOM=Vec2.get(localCOMx,localCOMy);\n wrap_localCOM.zpp_inner._inuse=true;\n wrap_localCOM.zpp_inner._validate=localCOM_validate;\n wrap_localCOM.zpp_inner._invalidate=localCOM_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_localCOM.zpp_inner._isimmutable=localCOM_immutable;\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_aabb(){\n validate_worldCOM();\n var rx:Float=radius;\n var ry:Float=radius;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rx!=rx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rx)\"+\") :: \"+(\"vec_new(in n: \"+\"r\"+\",in x: \"+\"radius\"+\",in y: \"+\"radius\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ry!=ry));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ry)\"+\") :: \"+(\"vec_new(in n: \"+\"r\"+\",in x: \"+\"radius\"+\",in y: \"+\"radius\"+\")\");\n #end\n };\n {\n aabb.minx=worldCOMx-rx;\n aabb.miny=worldCOMy-ry;\n };\n {\n aabb.maxx=worldCOMx+rx;\n aabb.maxy=worldCOMy+ry;\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function _force_validate_aabb(){\n {\n worldCOMx=body.posx+(body.axisy*localCOMx-body.axisx*localCOMy);\n worldCOMy=body.posy+(localCOMx*body.axisx+localCOMy*body.axisy);\n };\n aabb.minx=worldCOMx-radius;\n aabb.miny=worldCOMy-radius;\n aabb.maxx=worldCOMx+radius;\n aabb.maxy=worldCOMy+radius;\n }\n public function __validate_sweepRadius(){\n sweepCoef=Math.sqrt((localCOMx*localCOMx+localCOMy*localCOMy));\n sweepRadius=sweepCoef+radius;\n }\n public function __validate_area_inertia(){\n var r2=radius*radius;\n area=r2*Math.PI;\n inertia=r2*0.5+(localCOMx*localCOMx+localCOMy*localCOMy);\n }\n public function __validate_angDrag(){\n var lc=(localCOMx*localCOMx+localCOMy*localCOMy);\n var r2=radius*radius;\n var skin=material.dynamicFriction*Config.fluidAngularDragFriction;\n angDrag=(lc+2*r2)*skin+0.5*Config.fluidAngularDrag*(1+Config.fluidVacuumDrag)*lc;\n angDrag/=(2*(lc+0.5*r2));\n }\n public function __scale(sx:Float,sy:Float){\n var factor=((sx<0?-sx:sx)+(sy<0?-sy:sy))/2;\n radius*=factor<0?-factor:factor;\n invalidate_radius();\n if((localCOMx*localCOMx+localCOMy*localCOMy)>0){\n localCOMx*=sx;\n localCOMy*=sy;\n invalidate_localCOM();\n }\n }\n public function __translate(x:Float,y:Float){\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"localCOM\"+\",in b: \"+\"\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n localCOMx+=x*t;\n localCOMy+=y*t;\n };\n invalidate_localCOM();\n }\n public function __rotate(x:Float,y:Float){\n if((localCOMx*localCOMx+localCOMy*localCOMy)>0){\n var tx:Float=0.0;\n var ty:Float=0.0;\n {\n tx=(y*localCOMx-x*localCOMy);\n ty=(localCOMx*x+localCOMy*y);\n };\n {\n localCOMx=tx;\n localCOMy=ty;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n };\n invalidate_localCOM();\n }\n }\n public function __transform(m:Mat23){\n var det=(m.a*m.d-m.b*m.c);\n if(det<0)det=-det;\n radius*=Math.sqrt(det);\n {\n var t=m.a*localCOMx+m.b*localCOMy+m.tx;\n localCOMy=m.c*localCOMx+m.d*localCOMy+m.ty;\n localCOMx=t;\n };\n invalidate_radius();\n invalidate_localCOM();\n }\n public function __copy(){\n var ret=new Circle(radius).zpp_inner_zn;\n {\n ret.localCOMx=localCOMx;\n ret.localCOMy=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMx!=ret.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMy!=ret.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n ret.zip_localCOM=false;\n return ret;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Edge{\n public var next:ZPP_Edge=null;\n static public var zpp_pool:ZPP_Edge=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n polygon=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var polygon:ZPP_Polygon=null;\n static public var internal:Bool=false;\n public var outer:Edge=null;\n public function wrapper(){\n if(outer==null){\n internal=true;\n outer=new Edge();\n internal=false;\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var lnormx:Float=0.0;\n public var lnormy:Float=0.0;\n public var wrap_lnorm:Vec2=null;\n public var gnormx:Float=0.0;\n public var gnormy:Float=0.0;\n public var wrap_gnorm:Vec2=null;\n public var length:Float=0.0;\n public var lprojection:Float=0.0;\n public var gprojection:Float=0.0;\n public var lp0:ZPP_Vec2=null;\n public var gp0:ZPP_Vec2=null;\n public var lp1:ZPP_Vec2=null;\n public var gp1:ZPP_Vec2=null;\n public var tp0:Float=0.0;\n public var tp1:Float=0.0;\n private function lnorm_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(polygon==null)throw \"Error: Edge not currently in use\";\n #end\n polygon.validate_laxi();\n {\n wrap_lnorm.zpp_inner.x=lnormx;\n wrap_lnorm.zpp_inner.y=lnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_lnorm.zpp_inner.x!=wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_lnorm.zpp_inner.\"+\",in x: \"+\"lnormx\"+\",in y: \"+\"lnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_lnorm.zpp_inner.y!=wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_lnorm.zpp_inner.\"+\",in x: \"+\"lnormx\"+\",in y: \"+\"lnormy\"+\")\");\n #end\n };\n };\n }\n private function gnorm_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(polygon==null)throw \"Error: Edge not currently in use\";\n if(polygon.body==null)throw \"Error: Edge worldNormal only makes sense if the parent Polygon is contained within a rigid body\";\n #end\n polygon.validate_gaxi();\n {\n wrap_gnorm.zpp_inner.x=gnormx;\n wrap_gnorm.zpp_inner.y=gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gnorm.zpp_inner.x!=wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gnorm.zpp_inner.\"+\",in x: \"+\"gnormx\"+\",in y: \"+\"gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gnorm.zpp_inner.y!=wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gnorm.zpp_inner.\"+\",in x: \"+\"gnormx\"+\",in y: \"+\"gnormy\"+\")\");\n #end\n };\n };\n }\n public function getlnorm(){\n wrap_lnorm=Vec2.get(lnormx,lnormy);\n wrap_lnorm.zpp_inner._immutable=true;\n wrap_lnorm.zpp_inner._validate=lnorm_validate;\n }\n public function getgnorm(){\n wrap_gnorm=Vec2.get(gnormx,gnormy);\n wrap_gnorm.zpp_inner._immutable=true;\n wrap_gnorm.zpp_inner._validate=gnorm_validate;\n }\n public function new(){\n {\n lnormx=0;\n lnormy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((lnormx!=lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"lnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((lnormy!=lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"lnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n gnormx=0;\n gnormy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gnormx!=gnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"gnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gnormy!=gnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"gnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n length=0;\n lprojection=0;\n gprojection=0;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Polygon extends ZPP_Shape{\n public var outer_zn:Polygon=null;\n public var lverts:ZPP_Vec2=null;\n public var wrap_lverts:Vec2List=null;\n public var gverts:ZPP_Vec2=null;\n public var wrap_gverts:Vec2List=null;\n public var edges:ZNPList_ZPP_Edge=null;\n public var wrap_edges:EdgeList=null;\n public var edgeCnt:Int=0;\n public var reverse_flag:Bool=false;\n public function __clear(){}\n private function lverts_pa_invalidate(x:ZPP_Vec2){\n invalidate_lverts();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function lverts_pa_immutable(){\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modify local vertex of Polygon added to a static body whilst within a Space\";\n }\n #end\n private function gverts_pa_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: World vertex only makes sense when Polygon is contained in a rigid body\";\n #end\n validate_gverts();\n }\n private function lverts_post_adder(x:Vec2){\n x.zpp_inner._invalidate=lverts_pa_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n x.zpp_inner._isimmutable=lverts_pa_immutable;\n #end\n var ite:ZPP_Vec2=null;\n var ite2:ZNPNode_ZPP_Edge=null;\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i==x.zpp_inner)break;\n else{\n ite=ite==null?gverts.begin():ite.next;\n ite2=ite2==null?edges.begin():ite2.next;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n var vec=ZPP_Vec2.get(0,0,true);\n gverts.insert(ite,vec);\n if(lverts.begin().next!=null){\n if(lverts.begin().next.next==null){\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.add(ed);\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.add(ed);\n edgeCnt+=2;\n }\n else{\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.insert(ite2,ed);\n edgeCnt++;\n }\n }\n vec._validate=gverts_pa_validate;\n }\n private function lverts_subber(x:Vec2){\n cleanup_lvert(x.zpp_inner);\n }\n private function lverts_invalidate(_){\n invalidate_lverts();\n }\n private function lverts_validate(){\n validate_lverts();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function lverts_modifiable(){\n immutable_midstep(\"Polygon::localVerts\");\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modifiy shapes of static object once added to Space\";\n #end\n }\n #end\n private function gverts_validate(){\n validate_gverts();\n }\n private function edges_validate(){\n validate_lverts();\n }\n #if nape_swc@:keep #end\n public function getlverts(){\n var me=this;\n wrap_lverts=ZPP_MixVec2List.get(lverts);\n wrap_lverts.zpp_inner.post_adder=lverts_post_adder;\n wrap_lverts.zpp_inner.subber=lverts_subber;\n wrap_lverts.zpp_inner._invalidate=lverts_invalidate;\n wrap_lverts.zpp_inner._validate=lverts_validate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_lverts.zpp_inner._modifiable=lverts_modifiable;\n #end\n wrap_lverts.zpp_inner.reverse_flag=reverse_flag;\n }\n public function getgverts(){\n var me=this;\n wrap_gverts=ZPP_MixVec2List.get(gverts,true);\n wrap_gverts.zpp_inner.reverse_flag=reverse_flag;\n wrap_gverts.zpp_inner._validate=gverts_validate;\n }\n public function getedges(){\n var me=this;\n wrap_edges=ZPP_EdgeList.get(edges,true);\n wrap_edges.zpp_inner.reverse_flag=reverse_flag;\n wrap_edges.zpp_inner._validate=edges_validate;\n }\n public var zip_lverts:Bool=false;\n public function invalidate_lverts(){\n invalidate_laxi();\n invalidate_area_inertia();\n invalidate_angDrag();\n invalidate_localCOM();\n invalidate_gverts();\n zip_lverts=true;\n zip_valid=true;\n zip_sanitation=true;\n if(body!=null)body.wake();\n }\n public var zip_laxi:Bool=false;\n public function invalidate_laxi(){\n invalidate_gaxi();\n invalidate_sweepRadius();\n zip_laxi=true;\n }\n public var zip_gverts:Bool=false;\n public function invalidate_gverts(){\n invalidate_aabb();\n zip_gverts=true;\n }\n public var zip_gaxi:Bool=false;\n public function invalidate_gaxi(){\n zip_gaxi=true;\n }\n public var zip_valid:Bool=false;\n public var validation:ValidationResult;\n public function valid(){\n if(zip_valid){\n zip_valid=false;\n splice_collinear();\n if(lverts.size()<3)return validation=ValidationResult.DEGENERATE;\n else{\n validate_lverts();\n validate_area_inertia();\n if(areaConfig.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg){\n cx_cont=false;\n break;\n };\n };\n {\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n cx_ite=lverts.begin();\n var w=cx_ite.elem();\n do{\n {\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>Config.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg){\n cx_cont=false;\n break;\n };\n };\n }\n while(false);\n if(cx_cont){\n {\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n };\n var w=cx_ite.elem();\n do{\n {\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>Config.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg)break;\n };\n }\n while(false);\n }\n }\n };\n if(pos&&neg)return validation=ValidationResult.CONCAVE;\n else{\n var cont=true;\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n if(!cont){\n cx_cont=false;\n break;\n };\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var a=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(u==a||u==b||v==a||v==b){\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n continue;\n };\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n {\n cx_cont=false;\n break;\n };\n }\n }\n }\n };\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var b=lverts.front();\n {\n if(u==a||u==b||v==a||v==b)break;\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n break;\n }\n }\n }\n };\n }\n while(false);\n }\n };\n };\n {\n u=v;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var v=lverts.front();\n {\n if(!cont)break;\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var a=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(u==a||u==b||v==a||v==b){\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n continue;\n };\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n {\n cx_cont=false;\n break;\n };\n }\n }\n }\n };\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var b=lverts.front();\n {\n if(u==a||u==b||v==a||v==b)break;\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n break;\n }\n }\n }\n };\n }\n while(false);\n }\n };\n };\n }\n while(false);\n }\n };\n if(!cont)return validation=ValidationResult.SELF_INTERSECTING;\n else return validation=ValidationResult.VALID;\n }\n }\n }\n }\n else return validation;\n }\n public function validate_lverts(){\n if(zip_lverts){\n zip_lverts=false;\n if(lverts.size()>2){\n validate_area_inertia();\n if(area<0){\n reverse_vertices();\n area=-area;\n }\n }\n }\n }\n public function cleanup_lvert(x:ZPP_Vec2){\n var ite:ZPP_Vec2=null;\n var ite2:ZNPNode_ZPP_Edge=null;\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i==x)break;\n else{\n ite=ite==null?gverts.begin():ite.next;\n ite2=ite2==null?edges.begin():ite2.next;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n var rem=(ite==null?gverts.front():ite.next.elem());\n gverts.erase(ite);\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n if(edgeCnt==2){\n var rem=edges.pop_unsafe();\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n rem=edges.pop_unsafe();\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n edgeCnt=0;\n }\n else if(edgeCnt!=0){\n var rem=(ite2==null?edges.front():ite2.next.elem());\n edges.erase(ite2);\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n edgeCnt--;\n }\n }\n public var zip_sanitation:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function splice_collinear(){\n if(zip_sanitation){\n zip_sanitation=false;\n splice_collinear_real();\n }\n }\n public function splice_collinear_real(){\n if(lverts.begin()==null)return;\n if(lverts.begin().next==null)return;\n if(lverts.begin().next.next==null)return;\n var pre=null;\n var cur=lverts.begin();\n while(cur!=null){\n var nxt=if(cur.next==null)lverts.begin()else cur.next;\n var u=cur.elem();\n var v=nxt.elem();\n if(ZPP_VecMath.vec_dsq(u.x,u.y,v.x,v.y)=Config.epsilon*Config.epsilon){\n pre=pre.next;\n }\n else{\n cleanup_lvert(cur.elem());\n lverts.erase(pre.next==null?null:pre);\n removed=true;\n pre=pre.next;\n }\n }\n }\n while(removed);\n }\n public function reverse_vertices(){\n lverts.reverse();\n gverts.reverse();\n edges.reverse();\n var ite=edges.iterator_at(edgeCnt-1);\n var elem=edges.pop_unsafe();\n edges.insert(ite,elem);\n reverse_flag=!reverse_flag;\n if(wrap_lverts!=null)wrap_lverts.zpp_inner.reverse_flag=reverse_flag;\n if(wrap_gverts!=null)wrap_gverts.zpp_inner.reverse_flag=reverse_flag;\n if(wrap_edges!=null)wrap_edges.zpp_inner.reverse_flag=reverse_flag;\n }\n public function validate_laxi(){\n if(zip_laxi){\n zip_laxi=false;\n validate_lverts();\n var ite=edges.begin();\n {\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var edge=ite.elem();\n ite=ite.next;\n edge.lp0=u;\n edge.lp1=v;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=u.x-v.x;\n dy=u.y-v.y;\n };\n var l=Math.sqrt((dx*dx+dy*dy));\n edge.length=l;\n {\n var t=(1.0/(l));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"d\"+\",in s: \"+\"1.0/(l)\"+\")\");\n #end\n };\n dx*=t;\n dy*=t;\n };\n {\n var t=dx;\n dx=-dy;\n dy=t;\n };\n edge.lprojection=(dx*u.x+dy*u.y);\n {\n edge.lnormx=dx;\n edge.lnormy=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormx!=edge.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormy!=edge.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n if(edge.wrap_lnorm!=null){\n edge.wrap_lnorm.zpp_inner.x=dx;\n edge.wrap_lnorm.zpp_inner.y=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.x!=edge.wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.y!=edge.wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n };\n u=v;\n cx_ite=cx_ite.next;\n }\n var v=lverts.front();\n {\n var edge=ite.elem();\n ite=ite.next;\n edge.lp0=u;\n edge.lp1=v;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=u.x-v.x;\n dy=u.y-v.y;\n };\n var l=Math.sqrt((dx*dx+dy*dy));\n edge.length=l;\n {\n var t=(1.0/(l));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"d\"+\",in s: \"+\"1.0/(l)\"+\")\");\n #end\n };\n dx*=t;\n dy*=t;\n };\n {\n var t=dx;\n dx=-dy;\n dy=t;\n };\n edge.lprojection=(dx*u.x+dy*u.y);\n {\n edge.lnormx=dx;\n edge.lnormy=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormx!=edge.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormy!=edge.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n if(edge.wrap_lnorm!=null){\n edge.wrap_lnorm.zpp_inner.x=dx;\n edge.wrap_lnorm.zpp_inner.y=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.x!=edge.wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.y!=edge.wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n };\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_gverts(){\n if(zip_gverts){\n if(body!=null){\n zip_gverts=false;\n validate_lverts();\n body.validate_axis();\n var li=lverts.begin();\n {\n var cx_ite=gverts.begin();\n while(cx_ite!=null){\n var g=cx_ite.elem();\n {\n var l=li.elem();\n li=li.next;\n {\n g.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n g.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public#if NAPE_NO_INLINE#else inline #end\n function validate_gaxi(){\n if(zip_gaxi){\n if(body!=null){\n zip_gaxi=false;\n validate_laxi();\n body.validate_axis();\n validate_gverts();\n var ite=edges.begin();\n {\n var cx_ite=gverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var e=ite.elem();\n ite=ite.next;\n e.gp0=u;\n e.gp1=v;\n {\n e.gnormx=(body.axisy*e.lnormx-body.axisx*e.lnormy);\n e.gnormy=(e.lnormx*body.axisx+e.lnormy*body.axisy);\n };\n e.gprojection=(body.posx*e.gnormx+body.posy*e.gnormy)+e.lprojection;\n if(e.wrap_gnorm!=null){\n e.wrap_gnorm.zpp_inner.x=e.gnormx;\n e.wrap_gnorm.zpp_inner.y=e.gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.x!=e.wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.y!=e.wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n };\n e.tp0=(e.gp0.y*e.gnormx-e.gp0.x*e.gnormy);\n e.tp1=(e.gp1.y*e.gnormx-e.gp1.x*e.gnormy);\n };\n u=v;\n cx_ite=cx_ite.next;\n }\n var v=gverts.front();\n {\n var e=ite.elem();\n ite=ite.next;\n e.gp0=u;\n e.gp1=v;\n {\n e.gnormx=(body.axisy*e.lnormx-body.axisx*e.lnormy);\n e.gnormy=(e.lnormx*body.axisx+e.lnormy*body.axisy);\n };\n e.gprojection=(body.posx*e.gnormx+body.posy*e.gnormy)+e.lprojection;\n if(e.wrap_gnorm!=null){\n e.wrap_gnorm.zpp_inner.x=e.gnormx;\n e.wrap_gnorm.zpp_inner.y=e.gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.x!=e.wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.y!=e.wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n };\n e.tp0=(e.gp0.y*e.gnormx-e.gp0.x*e.gnormy);\n e.tp1=(e.gp1.y*e.gnormx-e.gp1.x*e.gnormy);\n };\n };\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_aabb(){\n validate_gverts();\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon has no meaningful bounds\";\n #end\n var p0=gverts.front();\n {\n aabb.minx=p0.x;\n aabb.miny=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=p0.x;\n aabb.maxy=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n var cx_ite=gverts.begin().next;\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n if(p.xaabb.maxx)aabb.maxx=p.x;\n if(p.yaabb.maxy)aabb.maxy=p.y;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function _force_validate_aabb(){\n var li=lverts.begin();\n var p0=gverts.front();\n var l=li.elem();\n li=li.next;\n {\n p0.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n p0.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n {\n aabb.minx=p0.x;\n aabb.miny=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=p0.x;\n aabb.maxy=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n var cx_ite=gverts.begin().next;\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var l=li.elem();\n li=li.next;\n {\n p.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n p.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n if(p.xaabb.maxx)aabb.maxx=p.x;\n if(p.yaabb.maxy)aabb.maxy=p.y;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function __validate_sweepRadius(){\n var maxRadius=0.0;\n var minRadius=0.0;\n validate_laxi();\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var r=(x.x*x.x+x.y*x.y);\n if(r>maxRadius){\n maxRadius=r;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=edges.begin();\n while(cx_ite!=null){\n var e=cx_ite.elem();\n {\n if(e.lprojection0){\n var ta=if(t>1)1 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(ta);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"ta\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*u.x-edge.lnormx*u.y);\n var dotb=(edge.lnormy*cx-edge.lnormx*cy);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*ta*edge.length*Config.fluidAngularDrag;\n }\n if(t<1){\n var tb=if(t<0)0 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(tb);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"tb\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*cx-edge.lnormx*cy);\n var dotb=(edge.lnormy*v.x-edge.lnormx*v.y);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*Config.fluidVacuumDrag*(1-tb)*edge.length*Config.fluidAngularDrag;\n }\n };\n {\n cx_itei=cx_itej;\n u=v;\n cx_itej=cx_itej.next;\n };\n }\n if(cx_cont){\n do{\n cx_itej=lverts.begin();\n var v=cx_itej.elem();\n {\n var edge=ei.elem();\n ei=ei.next;\n perim+=edge.length;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=v.x-u.x;\n dy=v.y-u.y;\n };\n accum+=edge.length*Config.fluidAngularDragFriction*material.dynamicFriction*edge.lprojection*edge.lprojection;\n var t=-(u.y*edge.lnormx-u.x*edge.lnormy)/(dy*edge.lnormx-dx*edge.lnormy);\n if(t>0){\n var ta=if(t>1)1 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(ta);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"ta\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*u.x-edge.lnormx*u.y);\n var dotb=(edge.lnormy*cx-edge.lnormx*cy);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*ta*edge.length*Config.fluidAngularDrag;\n }\n if(t<1){\n var tb=if(t<0)0 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(tb);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"tb\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*cx-edge.lnormx*cy);\n var dotb=(edge.lnormy*v.x-edge.lnormx*v.y);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*Config.fluidVacuumDrag*(1-tb)*edge.length*Config.fluidAngularDrag;\n }\n };\n }\n while(false);\n }\n };\n angDrag=accum/(inertia*perim);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_localCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon has no meaningful localCOM\";\n #end\n if(lverts.begin().next==null){\n localCOMx=lverts.front().x;\n localCOMy=lverts.front().y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n };\n else if(lverts.begin().next.next==null){\n {\n localCOMx=lverts.front().x;\n localCOMy=lverts.front().y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"localCOM\"+\",in b: \"+\"lverts.begin().next.elem().\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n localCOMx+=lverts.begin().next.elem().x*t;\n localCOMy+=lverts.begin().next.elem().y*t;\n };\n {\n var t=(0.5);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"localCOM\"+\",in s: \"+\"0.5\"+\")\");\n #end\n };\n localCOMx*=t;\n localCOMy*=t;\n };\n }\n else{\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var area=0.0;\n {\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n var v=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n }\n cx_ite=lverts.begin();\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n };\n area=1/(3*area);\n {\n var t=(area);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"localCOM\"+\",in s: \"+\"area\"+\")\");\n #end\n };\n localCOMx*=t;\n localCOMy*=t;\n };\n }\n }\n private function localCOM_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon does not have any meaningful localCOM\";\n #end\n validate_localCOM();\n }\n private function localCOM_invalidate(x:ZPP_Vec2){\n validate_localCOM();\n var delx:Float=0;\n var dely:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((delx!=delx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(delx)\"+\") :: \"+(\"vec_new(in n: \"+\"del\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dely!=dely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dely)\"+\") :: \"+(\"vec_new(in n: \"+\"del\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n delx=x.x-localCOMx;\n dely=x.y-localCOMy;\n };\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p.\"+\",in b: \"+\"del\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n p.x+=delx*t;\n p.y+=dely*t;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function setupLocalCOM(){\n wrap_localCOM=Vec2.get(localCOMx,localCOMy);\n wrap_localCOM.zpp_inner._inuse=true;\n wrap_localCOM.zpp_inner._validate=localCOM_validate;\n wrap_localCOM.zpp_inner._invalidate=localCOM_invalidate;\n }\n public function new(){\n super(ZPP_Flags.id_ShapeType_POLYGON);\n polygon=this;\n lverts=new ZPP_Vec2();\n gverts=new ZPP_Vec2();\n edges=new ZNPList_ZPP_Edge();\n edgeCnt=0;\n }\n public function __translate(dx:Float,dy:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p.\"+\",in b: \"+\"d\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n p.x+=dx*t;\n p.y+=dy*t;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __scale(sx:Float,sy:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n p.x*=sx;\n p.y*=sy;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __rotate(ax:Float,ay:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(ay*p.x-ax*p.y);\n tempy=(p.x*ax+p.y*ay);\n };\n {\n p.x=tempx;\n p.y=tempy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((p.x!=p.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(p.x)\"+\") :: \"+(\"vec_set(in n: \"+\"p.\"+\",in x: \"+\"tempx\"+\",in y: \"+\"tempy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((p.y!=p.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(p.y)\"+\") :: \"+(\"vec_set(in n: \"+\"p.\"+\",in x: \"+\"tempx\"+\",in y: \"+\"tempy\"+\")\");\n #end\n };\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __transform(mat:Mat23){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n {\n var t=mat.a*p.x+mat.b*p.y+mat.tx;\n p.y=mat.c*p.x+mat.d*p.y+mat.ty;\n p.x=t;\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __copy(){\n var ret=new Polygon(outer_zn.localVerts).zpp_inner_zn;\n return ret;\n }\n}\n","package zpp_nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Broadphase{\n public var space:ZPP_Space=null;\n public var is_sweep:Bool=false;\n public var sweep:ZPP_SweepPhase=null;\n public var dynab:ZPP_DynAABBPhase=null;\n public function insert(shape:ZPP_Shape){\n if(is_sweep)sweep.__insert(shape);\n else dynab.__insert(shape);\n }\n public function remove(shape:ZPP_Shape){\n if(is_sweep)sweep.__remove(shape);\n else dynab.__remove(shape);\n }\n public function sync(shape:ZPP_Shape){\n if(is_sweep)sweep.__sync(shape);\n else dynab.__sync(shape);\n }\n public function broadphase(space:ZPP_Space,discrete:Bool){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"not implemented\");\n #end\n };\n }\n public function clear(){}\n public function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public var aabbShape:Shape=null;\n public var matrix:Mat23=null;\n public function updateAABBShape(aabb:ZPP_AABB){\n if(aabbShape==null){\n var body=new Body(BodyType.STATIC);\n body.shapes.add(aabbShape=new Polygon(Polygon.rect(aabb.minx,aabb.miny,aabb.width(),aabb.height())));\n }\n else{\n var ab=aabbShape.zpp_inner.aabb;\n var sx=aabb.width()/ab.width();\n var sy=aabb.height()/ab.height();\n if(matrix==null)matrix=new Mat23();\n matrix.a=sx;\n matrix.b=matrix.c=0;\n matrix.d=sy;\n matrix.tx=aabb.minx-sx*ab.minx;\n matrix.ty=aabb.miny-sy*ab.miny;\n aabbShape.transform(matrix);\n }\n aabbShape.zpp_inner.validate_aabb();\n aabbShape.zpp_inner.polygon.validate_gaxi();\n }\n public function shapesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public var circShape:Shape=null;\n public function updateCircShape(x:Float,y:Float,r:Float){\n if(circShape==null){\n var body=new Body(BodyType.STATIC);\n body.shapes.add(circShape=new Circle(r,Vec2.get(x,y)));\n }\n else{\n var ci=circShape.zpp_inner.circle;\n var ss=r/ci.radius;\n if(matrix==null)matrix=new Mat23();\n matrix.a=matrix.d=ss;\n matrix.b=matrix.c=0;\n matrix.tx=x-ss*ci.localCOMx;\n matrix.ty=y-ss*ci.localCOMy;\n circShape.transform(matrix);\n }\n circShape.zpp_inner.validate_aabb();\n }\n public function shapesInCircle(x:Float,y:Float,r:Float,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInCircle(x:Float,y:Float,r:Float,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public function validateShape(s:ZPP_Shape){\n if(s.isPolygon())s.polygon.validate_gaxi();\n s.validate_aabb();\n s.validate_worldCOM();\n }\n public function shapesInShape(shape:ZPP_Shape,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInShape(shape:ZPP_Shape,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public function rayCast(ray:ZPP_Ray,inner:Bool,filter:ZPP_InteractionFilter):RayResult{\n return null;\n }\n public function rayMultiCast(ray:ZPP_Ray,inner:Bool,filter:ZPP_InteractionFilter,output:RayResultList):RayResultList{\n return null;\n }\n}\n","package zpp_nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_AABBNode{\n public var aabb:ZPP_AABB=null;\n public var shape:ZPP_Shape=null;\n public var dyn:Bool=false;\n public var parent:ZPP_AABBNode=null;\n public var child1:ZPP_AABBNode=null;\n public var child2:ZPP_AABBNode=null;\n public var height:Int=0;\n public var rayt:Float=0.0;\n public function new(){\n height=-1;\n }\n public var next:ZPP_AABBNode=null;\n static public var zpp_pool:ZPP_AABBNode=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n if(ZPP_AABB.zpp_pool==null){\n aabb=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n aabb=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=aabb.next;\n aabb.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n aabb.alloc();\n };\n moved=false;\n synced=false;\n first_sync=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n height=-1;\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n child1=child2=parent=null;\n next=null;\n snext=null;\n mnext=null;\n }\n public var mnext:ZPP_AABBNode=null;\n public var moved:Bool=false;\n public var snext:ZPP_AABBNode=null;\n public var synced:Bool=false;\n public var first_sync:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isLeaf(){\n return child1==null;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_AABBPair{\n public var n1:ZPP_AABBNode=null;\n public var n2:ZPP_AABBNode=null;\n public var first:Bool=false;\n public var sleeping:Bool=false;\n public var id:Int=0;\n public var di:Int=0;\n public var arb:ZPP_Arbiter=null;\n public var next:ZPP_AABBPair=null;\n static public var zpp_pool:ZPP_AABBPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb==null;\n };\n if(!res)throw \"assert(\"+\"arb==null\"+\") :: \"+(\"node still has an arbiter when going into pool??\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb==null;\n };\n if(!res)throw \"assert(\"+\"arb==null\"+\") :: \"+(\"node still has an arbiter when going into pool??\");\n #end\n };\n n1=n2=null;\n sleeping=false;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_AABBTree{\n public var root:ZPP_AABBNode=null;\n public function new(){}\n public function clear(){\n if(root==null)return;\n var stack:ZPP_AABBNode=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n root.next==null;\n };\n if(!res)throw \"assert(\"+\"root.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n root.next=stack;\n stack=root;\n };\n while(stack!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n stack!=null;\n };\n if(!res)throw \"assert(\"+\"stack!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=stack;\n stack=ret.next;\n ret.next=null;\n ret;\n });\n if(node.isLeaf()){\n node.shape.node=null;\n node.shape.removedFromSpace();\n node.shape=null;\n }\n else{\n if(node.child1!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.child1.next==null;\n };\n if(!res)throw \"assert(\"+\"node.child1.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.child1.next=stack;\n stack=node.child1;\n };\n if(node.child2!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.child2.next==null;\n };\n if(!res)throw \"assert(\"+\"node.child2.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.child2.next=stack;\n stack=node.child2;\n };\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n root=null;\n }\n public static var tmpaabb=new ZPP_AABB();\n function insertLeaf(leaf:ZPP_AABBNode){\n inlined_insertLeaf(leaf);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insertLeaf(leaf:ZPP_AABBNode){\n if(root==null){\n root=leaf;\n root.parent=null;\n }\n else{\n var leafaabb=leaf.aabb;\n var node=root;\n while(!node.isLeaf()){\n var child1=node.child1;\n var child2=node.child2;\n var area=node.aabb.perimeter();\n tmpaabb.setCombine(node.aabb,leafaabb);\n var carea=tmpaabb.perimeter();\n var cost=2*carea;\n var icost=2*(carea-area);\n var cost1=({\n tmpaabb.setCombine(leafaabb,child1.aabb);\n if(child1.isLeaf())tmpaabb.perimeter()+icost;\n else{\n var oarea=child1.aabb.perimeter();\n var narea=tmpaabb.perimeter();\n (narea-oarea)+icost;\n }\n });\n var cost2=({\n tmpaabb.setCombine(leafaabb,child2.aabb);\n if(child2.isLeaf())tmpaabb.perimeter()+icost;\n else{\n var oarea=child2.aabb.perimeter();\n var narea=tmpaabb.perimeter();\n (narea-oarea)+icost;\n }\n });\n if(costy?x:y;\n });\n node.aabb.setCombine(child1.aabb,child2.aabb);\n node=node.parent;\n }\n }\n }\n public function removeLeaf(leaf:ZPP_AABBNode){\n inlined_removeLeaf(leaf);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_removeLeaf(leaf:ZPP_AABBNode){\n if(leaf==root){\n root=null;\n return;\n }\n else{\n var parent=leaf.parent;\n var gparent=parent.parent;\n var sibling=if(parent.child1==leaf)parent.child2 else parent.child1;\n if(gparent!=null){\n if(gparent.child1==parent)gparent.child1=sibling;\n else gparent.child2=sibling;\n sibling.parent=gparent;\n {\n var o=parent;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"parent\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n var node=gparent;\n while(node!=null){\n node=balance(node);\n var child1=node.child1;\n var child2=node.child2;\n node.aabb.setCombine(child1.aabb,child2.aabb);\n node.height=1+({\n var x=child1.height;\n var y=child2.height;\n x>y?x:y;\n });\n node=node.parent;\n }\n }\n else{\n root=sibling;\n sibling.parent=null;\n {\n var o=parent;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"parent\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function balance(a:ZPP_AABBNode){\n if(a.isLeaf()||a.height<2)return a;\n else{\n var b=a.child1;\n var c=a.child2;\n var balance=c.height-b.height;\n if(balance>1){\n var f=c.child1;\n var g=c.child2;\n c.child1=a;\n c.parent=a.parent;\n a.parent=c;\n if(c.parent!=null){\n if(c.parent.child1==a)c.parent.child1=c;\n else c.parent.child2=c;\n }\n else root=c;\n if(f.height>g.height){\n c.child2=f;\n a.child2=g;\n g.parent=a;\n a.aabb.setCombine(b.aabb,g.aabb);\n c.aabb.setCombine(a.aabb,f.aabb);\n a.height=1+({\n var x=b.height;\n var y=g.height;\n x>y?x:y;\n });\n c.height=1+({\n var x=a.height;\n var y=f.height;\n x>y?x:y;\n });\n };\n else{\n c.child2=g;\n a.child2=f;\n f.parent=a;\n a.aabb.setCombine(b.aabb,f.aabb);\n c.aabb.setCombine(a.aabb,g.aabb);\n a.height=1+({\n var x=b.height;\n var y=f.height;\n x>y?x:y;\n });\n c.height=1+({\n var x=a.height;\n var y=g.height;\n x>y?x:y;\n });\n };\n return c;\n };\n else if(balance<-1){\n var f=b.child1;\n var g=b.child2;\n b.child1=a;\n b.parent=a.parent;\n a.parent=b;\n if(b.parent!=null){\n if(b.parent.child1==a)b.parent.child1=b;\n else b.parent.child2=b;\n }\n else root=b;\n if(f.height>g.height){\n b.child2=f;\n a.child1=g;\n g.parent=a;\n a.aabb.setCombine(c.aabb,g.aabb);\n b.aabb.setCombine(a.aabb,f.aabb);\n a.height=1+({\n var x=c.height;\n var y=g.height;\n x>y?x:y;\n });\n b.height=1+({\n var x=a.height;\n var y=f.height;\n x>y?x:y;\n });\n };\n else{\n b.child2=g;\n a.child1=f;\n f.parent=a;\n a.aabb.setCombine(c.aabb,f.aabb);\n b.aabb.setCombine(a.aabb,g.aabb);\n a.height=1+({\n var x=c.height;\n var y=f.height;\n x>y?x:y;\n });\n b.height=1+({\n var x=a.height;\n var y=g.height;\n x>y?x:y;\n });\n };\n return b;\n };\n else return a;\n }\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_DynAABBPhase extends ZPP_Broadphase{\n #if NAPE_NO_INLINE#else inline #end\n static var FATTEN=3.0;\n #if NAPE_NO_INLINE#else inline #end\n static var VEL_STEPS=2.0;\n public var stree:ZPP_AABBTree=null;\n public var dtree:ZPP_AABBTree=null;\n public var pairs:ZPP_AABBPair=null;\n public var syncs:ZPP_AABBNode=null;\n public var moves:ZPP_AABBNode=null;\n public function new(space:ZPP_Space){\n this.space=space;\n is_sweep=false;\n dynab=this;\n stree=new ZPP_AABBTree();\n dtree=new ZPP_AABBTree();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function dyn(shape:ZPP_Shape){\n if(shape.body.isStatic())return false;\n else return!shape.body.component.sleeping;\n }\n public function __insert(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.node==null;\n };\n if(!res)throw \"assert(\"+\"shape.node==null\"+\") :: \"+(\"shape has been inserted already\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape inserted with no body\");\n #end\n };\n var node;\n {\n if(ZPP_AABBNode.zpp_pool==null){\n node=new ZPP_AABBNode();\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_TOT++;\n ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n node=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=node.next;\n node.next=null;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT--;\n ZPP_AABBNode.POOL_ADD++;\n #end\n }\n node.alloc();\n };\n node.shape=shape;\n shape.node=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !node.synced;\n };\n if(!res)throw \"assert(\"+\"!node.synced\"+\") :: \"+(\"node is already in sync list?\");\n #end\n };\n node.synced=true;\n node.first_sync=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.snext==null;\n };\n if(!res)throw \"assert(\"+\"node.snext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.snext=syncs;\n syncs=node;\n };\n }\n public function __remove(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"do i need this assertion?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.node!=null;\n };\n if(!res)throw \"assert(\"+\"shape.node!=null\"+\") :: \"+(\"shape has no node?\");\n #end\n };\n var node=shape.node;\n if(!node.first_sync){\n if(node.dyn)dtree.removeLeaf(node);\n else stree.removeLeaf(node);\n }\n shape.node=null;\n if(node.synced){\n {\n var pre=null;\n var cur=syncs;\n while(cur!=null){\n if(cur==node)break;\n pre=cur;\n cur=cur.snext;\n }\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"cur = null\");\n #end\n };\n if(pre==null)syncs=cur.snext;\n else pre.snext=cur.snext;\n cur.snext=null;\n };\n };\n node.synced=false;\n }\n if(node.moved){\n {\n var pre=null;\n var cur=moves;\n while(cur!=null){\n if(cur==node)break;\n pre=cur;\n cur=cur.mnext;\n }\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"cur = null\");\n #end\n };\n if(pre==null)moves=cur.mnext;\n else pre.mnext=cur.mnext;\n cur.mnext=null;\n };\n };\n node.moved=false;\n }\n var pre=null;\n var cur=pairs;\n while(cur!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cur.sleeping;\n };\n if(!res)throw \"assert(\"+\"!cur.sleeping\"+\") :: \"+(\"sleeping pair in pairs\");\n #end\n };\n var nxt=cur.next;\n if(cur.n1==node||cur.n2==node){\n if(pre==null)pairs=nxt;\n else pre.next=nxt;\n if(cur.arb!=null)cur.arb.pair=null;\n cur.arb=null;\n cur.n1.shape.pairs.remove(cur);\n cur.n2.shape.pairs.remove(cur);\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBPair.zpp_pool;\n ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBPair.POOL_CNT++;\n ZPP_AABBPair.POOL_SUB++;\n #end\n };\n cur=nxt;\n continue;\n }\n pre=cur;\n cur=nxt;\n }\n while(!shape.pairs.empty()){\n var cur=shape.pairs.pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.sleeping;\n };\n if(!res)throw \"assert(\"+\"cur.sleeping\"+\") :: \"+(\"non-sleeping pair remaining after removing them from pairs\");\n #end\n };\n if(cur.n1==node)cur.n2.shape.pairs.remove(cur);\n else cur.n1.shape.pairs.remove(cur);\n if(cur.arb!=null)cur.arb.pair=null;\n cur.arb=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBPair.zpp_pool;\n ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBPair.POOL_CNT++;\n ZPP_AABBPair.POOL_SUB++;\n #end\n };\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __sync(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !shape.body.isStatic();\n };\n if(!res)throw \"assert(\"+\"!shape.body.isStatic()\"+\") :: \"+(\"static shape being synced?\");\n #end\n };\n var node=shape.node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"shape has no node?\");\n #end\n };\n if(!node.synced){\n if(!space.continuous)shape.validate_aabb();\n var sync=node.dyn!=dyn(shape)||!node.aabb.contains(shape.aabb);\n if(sync){\n #if NAPE_TIMES Debug.BROADCLASH++;\n #end\n node.synced=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.snext==null;\n };\n if(!res)throw \"assert(\"+\"node.snext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.snext=syncs;\n syncs=node;\n };\n }\n #if NAPE_TIMES Debug.BROADTOTAL++;\n #end\n }\n }\n public function sync_broadphase(){\n space.validation();\n if(syncs!=null){\n if(moves==null){\n var node=syncs;\n while(node!=null){\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !node.moved;\n };\n if(!res)throw \"assert(\"+\"!node.moved\"+\") :: \"+(\"node already moved apparently?\");\n #end\n };\n node.moved=true;\n node.mnext=node.snext;\n node.snext=null;\n node=node.mnext;\n }\n {\n var t=syncs;\n syncs=moves;\n moves=t;\n }\n }\n else{\n while(syncs!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n syncs!=null;\n };\n if(!res)throw \"assert(\"+\"syncs!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=syncs;\n syncs=ret.snext;\n ret.snext=null;\n ret;\n });\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n if(!node.moved){\n node.moved=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.mnext==null;\n };\n if(!res)throw \"assert(\"+\"node.mnext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.mnext=moves;\n moves=node;\n };\n }\n }\n }\n }\n }\n public override function broadphase(space:ZPP_Space,discrete:Bool){\n var node=syncs;\n while(node!=null){\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n node=node.snext;\n }\n {\n while(syncs!=null){\n var leaf=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n syncs!=null;\n };\n if(!res)throw \"assert(\"+\"syncs!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=syncs;\n syncs=ret.snext;\n ret.snext=null;\n ret;\n });\n if(\"syncs\"!=\"moves\"&&leaf.moved)continue;\n leaf.moved=false;\n var lshape=leaf.shape;\n var lbody=lshape.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(lbody.component.sleeping&&lbody.isStatic());\n };\n if(!res)throw \"assert(\"+\"!(lbody.component.sleeping&&lbody.isStatic())\"+\") :: \"+(\"a sleeping static?\");\n #end\n };\n if(lbody.component.sleeping)continue;\n var ab=leaf.aabb;\n var stack=null;\n {\n if(dtree.root!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n dtree.root.next==null;\n };\n if(!res)throw \"assert(\"+\"dtree.root.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n dtree.root.next=stack;\n stack=dtree.root;\n };\n while(stack!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n stack!=null;\n };\n if(!res)throw \"assert(\"+\"stack!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=stack;\n stack=ret.next;\n ret.next=null;\n ret;\n });\n if(node==leaf)continue;\n if(node.isLeaf()){\n var shape=node.shape;\n if(shape.body!=lshape.body&&!(shape.body.isStatic()&&lshape.body.isStatic())){\n if(ab.intersect(node.aabb)){\n var id:Int;\n var di:Int;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n lshape!=shape;\n };\n if(!res)throw \"assert(\"+\"lshape!=shape\"+\") :: \"+(\"narrowphase area of dyn-aabb with same shape?\");\n #end\n };\n if(lshape.id=0&&t=0&&t=mint)break;\n if(cnode.isLeaf()){\n var shape=cnode.shape;\n if(filter==null||shape.filter.shouldCollide(filter)){\n var result=if(shape.isCircle())ray.circlesect(shape.circle,inner,mint)else if(ray.aabbtest(shape.aabb))ray.polysect(shape.polygon,inner,mint);\n else null;\n if(result!=null){\n mint=result.distance;\n if(minres!=null){\n minres.dispose();\n }\n minres=result;\n }\n }\n }\n else{\n {\n if(cnode.child1!=null){\n if(ray.aabbtest(cnode.child1.aabb)){\n var t=ray.aabbsect(cnode.child1.aabb);\n if(t>=0&&t=0&&t=ZPP_Const.POSINF();\n var ret=(output==null?new RayResultList():output);\n {\n if(dtree.root!=null){\n if(ray.aabbtest(dtree.root.aabb)){\n if(inf)openlist.add(dtree.root);\n else{\n var t=ray.aabbsect(dtree.root.aabb);\n if(t>=0&&t=0&&t=0&&t=0&&t o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Island,o:ZPP_Island):ZPP_Island{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Island,o:ZPP_Island):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Island{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Island):ZPP_Island{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Island):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Island;\n var ret:ZPP_Island;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Island,n:Int):ZPP_Island{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Island):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Island{\n return begin().elem();\n }\n public function back():ZPP_Island{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n public var comps:ZNPList_ZPP_Component=null;\n public var sleep:Bool=false;\n public var waket:Int=0;\n static public var zpp_pool:ZPP_Island=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n comps.empty();\n };\n if(!res)throw \"assert(\"+\"comps.empty()\"+\") :: \"+(\"Island freed with components in island\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n waket=0;\n }\n public function new(){\n comps=new ZNPList_ZPP_Component();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Component{\n public var next:ZPP_Component=null;\n static public var zpp_pool:ZPP_Component=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var parent:ZPP_Component=null;\n public var rank:Int=0;\n public var isBody:Bool=false;\n public var body:ZPP_Body=null;\n public var constraint:ZPP_Constraint=null;\n public var island:ZPP_Island=null;\n public var sleeping:Bool=false;\n public var waket:Int=0;\n public var woken:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n body=null;\n constraint=null;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n island==null;\n };\n if(!res)throw \"assert(\"+\"island==null\"+\") :: \"+(\"component freeed whilst connected to an island?\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public function new(){\n reset();\n woken=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function reset(){\n sleeping=false;\n island=null;\n parent=this;\n rank=0;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CallbackSet{\n public var id:Int=0;\n public var di:Int=0;\n public var int1:ZPP_Interactor=null;\n public var int2:ZPP_Interactor=null;\n public static function get(i1:ZPP_Interactor,i2:ZPP_Interactor){\n var ret;\n {\n if(ZPP_CallbackSet.zpp_pool==null){\n ret=new ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_TOT++;\n ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT--;\n ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i1!=i2;\n };\n if(!res)throw \"assert(\"+\"i1!=i2\"+\") :: \"+(\"CallbackSet between the same interactor?\");\n #end\n };\n if(i1.id o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_CallbackSet,o:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_CallbackSet,o:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CallbackSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_CallbackSet;\n var ret:ZPP_CallbackSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_CallbackSet,n:Int):ZPP_CallbackSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CallbackSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CallbackSet{\n return begin().elem();\n }\n public function back():ZPP_CallbackSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n static public var zpp_pool:ZPP_CallbackSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var freed:Bool=false;\n public var lazydel:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n int1=int2=null;\n id=di=-1;\n freed=true;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arbiters.empty();\n };\n if(!res)throw \"assert(\"+\"arbiters.empty()\"+\") :: \"+(\"callbackset released with lingering arbs\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n freed=false;\n lazydel=false;\n \n COLLISIONstate=ZPP_Flags.id_PreFlag_ACCEPT;\n COLLISIONstamp=0;\n SENSORstate=ZPP_Flags.id_PreFlag_ACCEPT;\n SENSORstamp=0;\n FLUIDstate=ZPP_Flags.id_PreFlag_ACCEPT;\n FLUIDstamp=0;\n }\n public function new(){\n arbiters=new ZNPList_ZPP_Arbiter();\n }\n public#if NAPE_NO_INLINE#else inline #end\n function add_arb(x:ZPP_Arbiter){\n if(!arbiters.inlined_has(x)){\n arbiters.inlined_add(x);\n return true;\n }\n else return false;\n }\n public function try_remove_arb(x:ZPP_Arbiter){\n return arbiters.inlined_try_remove(x);\n }\n public function remove_arb(x:ZPP_Arbiter){\n arbiters.inlined_remove(x);\n }\n public function empty_arb(type:Int){\n var retvar;\n {\n retvar=true;\n {\n var cx_ite=arbiters.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if((x.type&type)==0){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n retvar=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return retvar;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function really_empty(){\n return arbiters.empty();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sleeping(){\n var ret;\n {\n ret=true;\n {\n var cx_ite=arbiters.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x.sleeping){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n ret=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CbSetManager{\n public var cbsets:ZPP_Set_ZPP_CbSet=null;\n public var space:ZPP_Space=null;\n public function get(cbTypes:ZNPList_ZPP_CbType){\n if(cbTypes.empty())return null;\n #if NAPE_ASSERT ZPP_CbSet.assert_cbTypes(cbTypes);\n #end\n var fake;\n {\n if(ZPP_CbSet.zpp_pool==null){\n fake=new ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_TOT++;\n ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n fake=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=fake.next;\n fake.next=null;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT--;\n ZPP_CbSet.POOL_ADD++;\n #end\n }\n fake.alloc();\n };\n var faketypes=fake.cbTypes;\n fake.cbTypes=cbTypes;\n var res=cbsets.find_weak(fake);\n var ret=if(res!=null)res.data else{\n var set=ZPP_CbSet.get(cbTypes);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cbsets.has_weak(set);\n };\n if(!res)throw \"assert(\"+\"!cbsets.has_weak(set)\"+\") :: \"+(\"CbSet exists in Set already, but not found??\");\n #end\n };\n cbsets.insert(set);\n set.manager=this;\n set;\n }\n fake.cbTypes=faketypes;\n {\n var o=fake;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSet\"+\", in obj: \"+\"fake\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT++;\n ZPP_CbSet.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function remove(set:ZPP_CbSet){\n cbsets.remove(set);\n {\n while(!set.cbpairs.empty()){\n var pair=set.cbpairs.pop_unsafe();\n {\n if(pair.a!=pair.b){\n if(set==pair.a)pair.b.cbpairs.remove(pair);\n else pair.a.cbpairs.remove(pair);\n }\n {\n var o=pair;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSetPair\"+\", in obj: \"+\"pair\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT++;\n ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n };\n }\n };\n set.manager=null;\n }\n public function clear(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbsets.empty();\n };\n if(!res)throw \"assert(\"+\"cbsets.empty()\"+\") :: \"+(\"space cleared, called setmanager clear(), and tree was non-empty. wuh\");\n #end\n };\n }\n public function new(space:ZPP_Space){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n cbsets=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n cbsets=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=cbsets.next;\n cbsets.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n cbsets.alloc();\n };\n cbsets.lt=ZPP_CbSet.setlt;\n this.space=space;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbsets!=null;\n };\n if(!res)throw \"assert(\"+\"cbsets!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!cbsets.empty()){\n var set_ite=cbsets.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var cb=set_ite.data;\n cb.validate();\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function pair(a:ZPP_CbSet,b:ZPP_CbSet){\n var ret:ZPP_CbSetPair=null;\n var pairs=if(a.cbpairs.length=null;\n public var gravityx:Float=0.0;\n public var gravityy:Float=0.0;\n public var wrap_gravity:Vec2=null;\n public function getgravity(){\n wrap_gravity=Vec2.get(gravityx,gravityy);\n wrap_gravity.zpp_inner._inuse=true;\n wrap_gravity.zpp_inner._invalidate=gravity_invalidate;\n wrap_gravity.zpp_inner._validate=gravity_validate;\n }\n private function gravity_invalidate(x:ZPP_Vec2){\n #if(!NAPE_RELEASE_BUILD)\n if(midstep)throw \"Error: Space::gravity cannot be set during space step\";\n #end\n {\n gravityx=x.x;\n gravityy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n var stack=new ZNPList_ZPP_Compound();\n {\n var cx_ite=bodies.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var o=x;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n while(!stack.empty()){\n var s=stack.pop_unsafe();\n {\n var cx_ite=s.bodies.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var o=x;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=s.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n private function gravity_validate(){\n {\n wrap_gravity.zpp_inner.x=gravityx;\n wrap_gravity.zpp_inner.y=gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.x!=wrap_gravity.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.y!=wrap_gravity.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n };\n }\n public var bodies:ZNPList_ZPP_Body=null;\n public var wrap_bodies:BodyList=null;\n public var compounds:ZNPList_ZPP_Compound=null;\n public var wrap_compounds:CompoundList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n public var kinematics:ZNPList_ZPP_Body=null;\n public var bphase:ZPP_Broadphase=null;\n public var __static:Body=null;\n public var global_lin_drag:Float=0.0;\n public var global_ang_drag:Float=0.0;\n public var stamp:Int=0;\n public var midstep:Bool=false;\n public var time:Float=0.0;\n public var sortcontacts:Bool=false;\n \n public var c_arbiters_true:ZNPList_ZPP_ColArbiter=null;\n public var c_arbiters_false:ZNPList_ZPP_ColArbiter=null;\n public var f_arbiters:ZNPList_ZPP_FluidArbiter=null;\n public var s_arbiters:ZNPList_ZPP_SensorArbiter=null;\n public var wrap_arbiters:ArbiterList=null;\n public var live:ZNPList_ZPP_Body=null;\n public var wrap_live:BodyList=null;\n public var live_constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_livecon:ConstraintList=null;\n public var staticsleep:ZNPList_ZPP_Body=null;\n public var islands:ZPP_Island=null;\n public var listeners:ZNPList_ZPP_Listener=null;\n public var wrap_listeners:ListenerList=null;\n public var callbacks:ZPP_Callback=null;\n public var callbackset_list:ZPP_CallbackSet=null;\n public var cbsets:ZPP_CbSetManager=null;\n public function clear(){\n {\n while(!listeners.empty()){\n var c=listeners.pop_unsafe();\n remListener(c);\n }\n };\n {\n while(!callbackset_list.empty()){\n var c=callbackset_list.pop_unsafe();\n {\n c.arbiters.clear();\n {\n var o=c;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CallbackSet\"+\", in obj: \"+\"c\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT++;\n ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n };\n }\n };\n {\n while(!c_arbiters_true.empty()){\n var arb=c_arbiters_true.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!c_arbiters_false.empty()){\n var arb=c_arbiters_false.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!s_arbiters.empty()){\n var arb=s_arbiters.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!f_arbiters.empty()){\n var arb=f_arbiters.pop_unsafe();\n arb.retire();\n }\n };\n bphase.clear();\n {\n while(!bodies.empty()){\n var b=bodies.pop_unsafe();\n {\n {\n if(b.component!=null){\n var i=b.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n b.removedFromSpace();\n b.space=null;\n };\n }\n };\n {\n while(!constraints.empty()){\n var c=constraints.pop_unsafe();\n {\n {\n if(c.component!=null){\n var i=c.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n c.removedFromSpace();\n c.space=null;\n };\n }\n };\n kinematics.clear();\n var stack=new ZNPList_ZPP_Compound();\n {\n while(!compounds.empty()){\n var c=compounds.pop_unsafe();\n stack.add(c);\n }\n };\n while(!stack.empty()){\n var comp=stack.pop_unsafe();\n comp.removedFromSpace();\n comp.space=null;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n {\n if(b.component!=null){\n var i=b.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n b.removedFromSpace();\n b.space=null;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.constraints.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n {\n if(c.component!=null){\n var i=c.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n c.removedFromSpace();\n c.space=null;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n islands.empty();\n };\n if(!res)throw \"assert(\"+\"islands.empty()\"+\") :: \"+(\"islands exist... wuh?\");\n #end\n };\n staticsleep.clear();\n live.clear();\n live_constraints.clear();\n stamp=0;\n time=0.0;\n #if NAPE_TIMES Debug.FOR=Debug.BROAD=Debug.PRE=Debug.POS=Debug.VEL=Debug.DRAW=Debug.SORT=0;\n Debug.ltime=0;\n #end\n mrca1.clear();\n mrca2.clear();\n prelisteners.clear();\n cbsets.clear();\n }\n private function bodies_adder(x:Body){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.bodies.remove(x);\n addBody(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function bodies_subber(x:Body){\n remBody(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function bodies_modifiable(){\n if(midstep)throw \"Error: Space::bodies cannot be set during space step()\";\n }\n #end\n private function compounds_adder(x:Compound){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of an inner Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_compounds.remove(x);\n addCompound(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function compounds_subber(x:Compound){\n remCompound(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function compounds_modifiable(){\n if(midstep)throw \"Error: Space::compounds cannot be set during space step()\";\n }\n #end\n private function constraints_adder(x:Constraint){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Constraint belonging to a Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.constraints.remove(x);\n this.addConstraint(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function constraints_subber(x:Constraint){\n remConstraint(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function constraints_modifiable(){\n if(midstep)throw \"Error: Space::constraints cannot be set during space step()\";\n }\n #end\n private function listeners_adder(x:Listener){\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.listeners.remove(x);\n addListener(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function listeners_subber(x:Listener){\n remListener(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function listeners_modifiable(){\n if(midstep)throw \"Error: Space::listeners cannot be set during space step()\";\n }\n #end\n public function new(gravity:ZPP_Vec2,broadphase:Broadphase){\n toiEvents=new ZNPList_ZPP_ToiEvent();\n global_lin_drag=0.015;\n global_ang_drag=0.015;\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Callback.internal=true;\n #end\n precb=new PreCallback();\n precb.zpp_inner=new ZPP_Callback();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Callback.internal=false;\n #end\n sortcontacts=true;\n pre_dt=0.0;\n if(broadphase==null||broadphase==Broadphase.DYNAMIC_AABB_TREE)bphase=new ZPP_DynAABBPhase(this);\n else if(broadphase==Broadphase.SWEEP_AND_PRUNE)bphase=new ZPP_SweepPhase(this);\n time=0.0;\n var me=this;\n if(gravity!=null){\n this.gravityx=gravity.x;\n this.gravityy=gravity.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityx!=this.gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"gravity.x\"+\",in y: \"+\"gravity.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityy!=this.gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"gravity.x\"+\",in y: \"+\"gravity.y\"+\")\");\n #end\n };\n };\n else{\n this.gravityx=0;\n this.gravityy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityx!=this.gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityy!=this.gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n bodies=new ZNPList_ZPP_Body();\n wrap_bodies=ZPP_BodyList.get(bodies);\n wrap_bodies.zpp_inner.adder=bodies_adder;\n wrap_bodies.zpp_inner.subber=bodies_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_bodies.zpp_inner._modifiable=bodies_modifiable;\n #end\n compounds=new ZNPList_ZPP_Compound();\n wrap_compounds=ZPP_CompoundList.get(compounds);\n wrap_compounds.zpp_inner.adder=compounds_adder;\n wrap_compounds.zpp_inner.subber=compounds_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_compounds.zpp_inner._modifiable=compounds_modifiable;\n #end\n kinematics=new ZNPList_ZPP_Body();\n c_arbiters_true=new ZNPList_ZPP_ColArbiter();\n c_arbiters_false=new ZNPList_ZPP_ColArbiter();\n f_arbiters=new ZNPList_ZPP_FluidArbiter();\n s_arbiters=new ZNPList_ZPP_SensorArbiter();\n islands=new ZPP_Island();\n live=new ZNPList_ZPP_Body();\n wrap_live=ZPP_BodyList.get(live,true);\n staticsleep=new ZNPList_ZPP_Body();\n constraints=new ZNPList_ZPP_Constraint();\n wrap_constraints=ZPP_ConstraintList.get(constraints);\n wrap_constraints.zpp_inner.adder=constraints_adder;\n wrap_constraints.zpp_inner.subber=constraints_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_constraints.zpp_inner._modifiable=constraints_modifiable;\n #end\n live_constraints=new ZNPList_ZPP_Constraint();\n wrap_livecon=ZPP_ConstraintList.get(live_constraints,true);\n __static=ZPP_Body.__static();\n __static.zpp_inner.space=this;\n callbacks=new ZPP_Callback();\n midstep=false;\n listeners=new ZNPList_ZPP_Listener();\n wrap_listeners=ZPP_ListenerList.get(listeners);\n wrap_listeners.zpp_inner.adder=listeners_adder;\n wrap_listeners.zpp_inner.subber=listeners_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_listeners.zpp_inner._modifiable=listeners_modifiable;\n #end\n callbackset_list=new ZPP_CallbackSet();\n mrca1=new ZNPList_ZPP_Interactor();\n mrca2=new ZNPList_ZPP_Interactor();\n prelisteners=new ZNPList_ZPP_InteractionListener();\n cbsets=new ZPP_CbSetManager(this);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function revoke_listener(x:ZPP_InteractionListener){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function unrevoke_listener(x:ZPP_InteractionListener){}\n public function addListener(x:ZPP_Listener){\n x.space=this;\n x.addedToSpace();\n if(x.interaction!=null){\n unrevoke_listener(x.interaction);\n }\n }\n public function remListener(x:ZPP_Listener){\n if(x.interaction!=null){\n revoke_listener(x.interaction);\n }\n x.removedFromSpace();\n x.space=null;\n }\n public function add_callbackset(cb:ZPP_CallbackSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(cb.freed||cb.lazydel);\n };\n if(!res)throw \"assert(\"+\"!(cb.freed||cb.lazydel)\"+\") :: \"+(\"adding callbacket which is freed or lazydel??\");\n #end\n };\n cb.int1.cbsets.inlined_add(cb);\n cb.int2.cbsets.inlined_add(cb);\n callbackset_list.inlined_add(cb);\n }\n public function remove_callbackset(cb:ZPP_CallbackSet){\n cb.lazydel=true;\n cb.int1.cbsets.inlined_remove(cb);\n cb.int2.cbsets.inlined_remove(cb);\n }\n public function transmitType(p:ZPP_Body,new_type:Int){\n {\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(p.type==ZPP_Flags.id_BodyType_DYNAMIC){\n live.remove(p);\n }\n else if(p.type==ZPP_Flags.id_BodyType_KINEMATIC){\n kinematics.remove(p);\n staticsleep.remove(p);\n }\n else if(p.type==ZPP_Flags.id_BodyType_STATIC){\n staticsleep.remove(p);\n }\n p.type=new_type;\n if(p.type==ZPP_Flags.id_BodyType_KINEMATIC)kinematics.add(p);\n if(p.type==ZPP_Flags.id_BodyType_STATIC)static_validation(p);\n p.component.sleeping=true;\n {\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n }\n public#if NAPE_NO_INLINE#else inline #end\n function added_shape(s:ZPP_Shape,dontwake:Bool=false){\n if(!dontwake){\n {\n var o=s.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n bphase.insert(s);\n s.addedToSpace();\n }\n public function removed_shape(s:ZPP_Shape,deleting=false){\n var body=s.body;\n if(!deleting){\n body.wake();\n }\n var pre=null;\n {\n var cx_ite=body.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n var rem=xarb.ws1==s||xarb.ws2==s;\n if(rem){\n if(xarb.present!=0){\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cbsets from MRCA_chains?\");\n #end\n };\n cb1.validate();\n cb2.validate();\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n callbackset!=null;\n };\n if(!res)throw \"assert(\"+\"callbackset!=null\"+\") :: \"+(\"null callbackset on arbiter deletion?\");\n #end\n };\n callbackset.remove_arb(xarb);\n xarb.present--;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_END,function(listener:ZPP_InteractionListener){\n if((listener.itype&xarb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_END;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n xarb.present>=0;\n };\n if(!res)throw \"assert(\"+\"xarb.present>=0\"+\") :: \"+(\"xarb present < 0?\");\n #end\n };\n }\n if(xarb.b1!=body&&xarb.b1.isDynamic()){\n var o=xarb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(xarb.b2!=body&&xarb.b2.isDynamic()){\n var o=xarb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n xarb.lazyRetire(this,body);\n cx_ite=body.arbiters.erase(pre);\n continue;\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n bphase.remove(s);\n s.removedFromSpace();\n }\n public function addConstraint(con:ZPP_Constraint){\n con.space=this;\n con.addedToSpace();\n if(con.active){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component.island==null;\n };\n if(!res)throw \"assert(\"+\"con.component.island==null\"+\") :: \"+(\"newly added constraint has an island??\");\n #end\n };\n con.component.sleeping=true;\n wake_constraint(con,true);\n }\n }\n public function remConstraint(con:ZPP_Constraint){\n if(con.active){\n wake_constraint(con,true);\n live_constraints.remove(con);\n }\n con.removedFromSpace();\n con.space=null;\n }\n public function addCompound(x:ZPP_Compound){\n x.space=this;\n x.addedToSpace();\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addBody(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addConstraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function remCompound(x:ZPP_Compound){\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remBody(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remConstraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n x.removedFromSpace();\n x.space=null;\n }\n public function addBody(body:ZPP_Body,flag:Int=-1){\n body.space=this;\n body.addedToSpace();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n body.component.island==null;\n };\n if(!res)throw \"assert(\"+\"body.component.island==null\"+\") :: \"+(\"newly added body has an island??\");\n #end\n };\n body.component.sleeping=true;\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n added_shape(shape,true);\n cx_ite=cx_ite.next;\n }\n };\n if(body.isStatic()){\n static_validation(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"a2b f=\"+flag);\n #end\n };\n }\n else{\n if(body.isDynamic()){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n live.has(body);\n };\n if(!res)throw \"assert(\"+\"live.has(body)\"+\") :: \"+(\"a4b f=\"+flag);\n #end\n };\n }\n else{\n if(flag!=ZPP_Flags.id_BodyType_KINEMATIC)kinematics.add(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"a6b f=\"+flag);\n #end\n };\n }\n }\n }\n public function remBody(body:ZPP_Body,flag:Int=-1){\n if(body.isStatic()){\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !body.component.sleeping;\n };\n if(!res)throw \"assert(\"+\"!body.component.sleeping\"+\") :: \"+(\"as3\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"as4\");\n #end\n };\n staticsleep.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"!staticsleep.has(body)\"+\") :: \"+(\"e1\");\n #end\n };\n }\n else{\n if(body.isDynamic()){\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n live.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !live.has(body);\n };\n if(!res)throw \"assert(\"+\"!live.has(body)\"+\") :: \"+(\"e3b\");\n #end\n };\n }\n else{\n if(flag!=ZPP_Flags.id_BodyType_KINEMATIC)kinematics.remove(body);\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n staticsleep.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"!staticsleep.has(body)\"+\") :: \"+(\"e4\");\n #end\n };\n }\n }\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n removed_shape(shape,true);\n cx_ite=cx_ite.next;\n }\n };\n body.removedFromSpace();\n body.space=null;\n }\n public function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesUnderPoint(x,y,filter,output);\n }\n public function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesUnderPoint(x,y,filter,output);\n }\n public function shapesInAABB(aabb:AABB,strict:Bool,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInAABB(aabb.zpp_inner,strict,cont,filter,output);\n }\n public function bodiesInAABB(aabb:AABB,strict:Bool,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInAABB(aabb.zpp_inner,strict,cont,filter,output);\n }\n public function shapesInCircle(pos:Vec2,rad:Float,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInCircle(pos.x,pos.y,rad,cont,filter,output);\n }\n public function bodiesInCircle(pos:Vec2,rad:Float,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInCircle(pos.x,pos.y,rad,cont,filter,output);\n }\n public function shapesInShape(shape:ZPP_Shape,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInShape(shape,cont,filter,output);\n }\n public function bodiesInShape(shape:ZPP_Shape,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInShape(shape,cont,filter,output);\n }\n public function rayCast(ray:Ray,inner:Bool,filter:InteractionFilter){\n return bphase.rayCast(ray.zpp_inner,inner,filter==null?null:filter.zpp_inner);\n }\n public function rayMultiCast(ray:Ray,inner:Bool,filter:InteractionFilter,output:RayResultList){\n return bphase.rayMultiCast(ray.zpp_inner,inner,filter==null?null:filter.zpp_inner,output);\n }\n var convexShapeList:ShapeList=null;\n public function convexCast(shape:ZPP_Shape,deltaTime:Float,filter:InteractionFilter,dynamics:Bool){\n var toi;\n {\n if(ZPP_ToiEvent.zpp_pool==null){\n toi=new ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_TOT++;\n ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n toi=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=toi.next;\n toi.next=null;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT--;\n ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n toi.alloc();\n };\n prepareCast(shape);\n var body=shape.body;\n var prex=body.posx;\n var prey=body.posy;\n body.sweepTime=0;\n body.sweep_angvel=body.angvel;\n body.sweepIntegrate(deltaTime);\n var postx=body.posx;\n var posty=body.posy;\n shape.validate_sweepRadius();\n var rad=shape.sweepRadius;\n var aabb;\n {\n if(ZPP_AABB.zpp_pool==null){\n aabb=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n aabb=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=aabb.next;\n aabb.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n aabb.alloc();\n };\n aabb.minx=({\n var x=prex;\n var y=postx;\n xy?x:y;\n })+rad;\n aabb.miny=({\n var x=prey;\n var y=posty;\n xy?x:y;\n })+rad;\n var list=convexShapeList=bphase.shapesInAABB(aabb,false,false,filter==null?null:filter.zpp_inner,convexShapeList);\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n var minAxisx:Float=0.0;\n var minAxisy:Float=0.0;\n {\n minAxisx=0;\n minAxisy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minAxisx!=minAxisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minAxisx)\"+\") :: \"+(\"vec_set(in n: \"+\"minAxis\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minAxisy!=minAxisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minAxisy)\"+\") :: \"+(\"vec_set(in n: \"+\"minAxis\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var minPosx:Float=0.0;\n var minPosy:Float=0.0;\n {\n minPosx=0;\n minPosy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minPosx!=minPosx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minPosx)\"+\") :: \"+(\"vec_set(in n: \"+\"minPos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minPosy!=minPosy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minPosy)\"+\") :: \"+(\"vec_set(in n: \"+\"minPos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var mins=null;\n var mint=deltaTime+1;\n for(s in list){\n if(s!=shape.outer&&s.body!=body.outer){\n toi.s1=shape;\n toi.s2=s.zpp_inner;\n if(dynamics){\n s.zpp_inner.validate_sweepRadius();\n s.body.zpp_inner.sweep_angvel=s.body.zpp_inner.angvel;\n s.body.zpp_inner.sweepTime=0;\n ZPP_SweepDistance.dynamicSweep(toi,deltaTime,0,0,true);\n s.body.zpp_inner.sweepIntegrate(0);\n s.body.zpp_inner.sweepValidate(s.zpp_inner);\n }\n else{\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,0);\n }\n toi.toi*=deltaTime;\n if(toi.toi>0&&toi.toiy?x:y;\n })+rad;\n aabb.miny=({\n var x=prey;\n var y=posty;\n xy?x:y;\n })+rad;\n var list=convexShapeList=bphase.shapesInAABB(aabb,false,false,filter==null?null:filter.zpp_inner,convexShapeList);\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n var ret=(output==null?new ConvexResultList():output);\n for(s in list){\n if(s!=shape.outer&&s.body!=body.outer){\n toi.s1=shape;\n toi.s2=s.zpp_inner;\n if(dynamics){\n s.zpp_inner.validate_sweepRadius();\n s.body.zpp_inner.sweep_angvel=s.body.zpp_inner.angvel;\n s.body.zpp_inner.sweepTime=0;\n ZPP_SweepDistance.dynamicSweep(toi,deltaTime,0,0,true);\n s.body.zpp_inner.sweepIntegrate(0);\n s.body.zpp_inner.sweepValidate(s.zpp_inner);\n }\n else{\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,0);\n }\n toi.toi*=deltaTime;\n if(toi.toi>0){\n var res=ZPP_ConvexRayResult.getConvex(Vec2.get(-toi.axis.x,-toi.axis.y),Vec2.get(toi.c2.x,toi.c2.y),toi.toi,s);\n {\n var pre=null;\n {\n var cx_ite=ret.zpp_inner.inner.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if((res.toi0||(rightSize>0&&right!=null)){\n if(leftSize==0){\n nxt=right;\n right=right.next;\n rightSize--;\n }\n else if(rightSize==0||right==null){\n nxt=left;\n left=left.next;\n leftSize--;\n }\n else if({\n if(left.elem().active&&right.elem().active)left.elem().oc1.dist1);\n xxlist.setbegin(head);\n }\n };\n }\n #if NAPE_TIMES Debug.SORT+=flash.Lib.getTimer()-pt;\n #end\n updateVel(deltaTime);\n warmStart();\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n iterateVel(velocityIterations);\n #if NAPE_TIMES Debug.VEL+=flash.Lib.getTimer()-pt;\n #end\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n updatePos(deltaTime);\n continuous=true;\n continuousCollisions(deltaTime);\n continuous=false;\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n iteratePos(positionIterations);\n #if NAPE_TIMES Debug.POS+=flash.Lib.getTimer()-pt;\n #end\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n var upos=!(cur.posx==cur.pre_posx&&cur.posy==cur.pre_posy);\n var urot=cur.pre_rot!=cur.rot;\n if(upos)cur.invalidate_pos();\n if(urot)cur.invalidate_rot();\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n var upos=!(cur.posx==cur.pre_posx&&cur.posy==cur.pre_posy);\n var urot=cur.pre_rot!=cur.rot;\n if(upos)cur.invalidate_pos();\n if(urot)cur.invalidate_rot();\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n var pre=null;\n {\n var cx_ite=staticsleep.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !b.isDynamic();\n };\n if(!res)throw \"assert(\"+\"!b.isDynamic()\"+\") :: \"+(\"step :: swef static/kinematics\");\n #end\n };\n if(!b.isKinematic()||(b.velx==0&&b.vely==0&&b.angvel==0)){\n if(b.kinematicDelaySleep){\n b.kinematicDelaySleep=false;\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n b.component.sleeping=true;\n cx_ite=staticsleep.inlined_erase(pre);\n continue;\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n doForests(deltaTime);\n sleepArbiters();\n #if NAPE_TIMES Debug.FOR+=flash.Lib.getTimer()-pt;\n #end\n midstep=false;\n var pre=null;\n {\n var cx_ite=callbackset_list.begin();\n while(cx_ite!=null){\n var set=cx_ite.elem();\n {\n if(set.really_empty()){\n cx_ite=callbackset_list.inlined_erase(pre);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !set.int1.cbsets.has(set);\n };\n if(!res)throw \"assert(\"+\"!set.int1.cbsets.has(set)\"+\") :: \"+(\"freeing set that wasn't lazy del'ed \"+set.int1.id+\" \"+set.int2.id);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !set.int2.cbsets.has(set);\n };\n if(!res)throw \"assert(\"+\"!set.int2.cbsets.has(set)\"+\") :: \"+(\"freeing set that wasn't lazy del'ed \"+set.int1.id+\" \"+set.int2.id);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n set.lazydel;\n };\n if(!res)throw \"assert(\"+\"set.lazydel\"+\") :: \"+(\"freeing set not with lazydel true\");\n #end\n };\n {\n var o=set;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CallbackSet\"+\", in obj: \"+\"set\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT++;\n ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n continue;\n }\n var sleeping=set.sleeping();\n ZPP_CbSet.find_all(set.int1.cbSet,set.int2.cbSet,ZPP_Flags.id_CbEvent_ONGOING,function(x:ZPP_InteractionListener){\n if((!sleeping||x.allowSleepingCallbacks)&&!set.empty_arb(x.itype)){\n var cb=push_callback(x);\n cb.event=ZPP_Flags.id_CbEvent_ONGOING;\n ZPP_Interactor.int_callback(set,x,cb);\n cb.set=set;\n }\n });\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n while(!callbacks.empty()){\n var cb=callbacks.pop();\n if(cb.listener.type==ZPP_Flags.id_ListenerType_BODY){\n var o=cb.listener.body;\n o.handler(cb.wrapper_body());\n }\n else if(cb.listener.type==ZPP_Flags.id_ListenerType_CONSTRAINT){\n var o=cb.listener.constraint;\n o.handler(cb.wrapper_con());\n }\n else if(cb.listener.type==ZPP_Flags.id_ListenerType_INTERACTION){\n var o=cb.listener.interaction;\n o.handleri(cb.wrapper_int());\n }\n {\n var o=cb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Callback\"+\", in obj: \"+\"cb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Callback.zpp_pool;\n ZPP_Callback.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Callback.POOL_CNT++;\n ZPP_Callback.POOL_SUB++;\n #end\n };\n }\n }\n public var toiEvents:ZNPList_ZPP_ToiEvent=null;\n public function continuousCollisions(deltaTime:Float){\n var MAX_VEL=2*Math.PI/deltaTime;\n bphase.broadphase(this,false);\n var curTimeAlpha=0.0;\n while(curTimeAlpha<1&&!toiEvents.empty()){\n var minTOI:ZPP_ToiEvent=null;\n var minTime=2.0;\n var minKinematic=false;\n var preMin:ZNPNode_ZPP_ToiEvent=null;\n var pre:ZNPNode_ZPP_ToiEvent=null;\n {\n var cx_ite=toiEvents.begin();\n while(cx_ite!=null){\n var toi=cx_ite.elem();\n {\n var b1=toi.s1.body;\n var b2=toi.s2.body;\n if(b1.sweepFrozen&&b2.sweepFrozen){\n if(toi.toi!=0&&ZPP_Collide.testCollide_safe(toi.s1,toi.s2)){\n toi.toi=0;\n }\n else{\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n if((toi.frozen1!=b1.sweepFrozen||toi.frozen2!=b2.sweepFrozen)){\n if(!toi.kinematic){\n toi.frozen1=b1.sweepFrozen;\n toi.frozen2=b2.sweepFrozen;\n if(toi.frozen1){\n var tmp=toi.s1;\n toi.s1=toi.s2;\n toi.s2=tmp;\n toi.frozen1=false;\n toi.frozen2=true;\n }\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,Config.collisionSlopCCD);\n if(toi.toi<0){\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n else{\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n if(toi.toi>=0&&(toi.toi=0;\n };\n if(!res)throw \"assert(\"+\"arb.present>=0\"+\") :: \"+(\"xarb present <0 ?\");\n #end\n };\n };\n }\n };\n remove_callbackset(callbackset);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public function nullInteractorType(intx:ZPP_Interactor,me:ZPP_Interactor=null){\n if(me==null)me=intx;\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var body=cx_ite.elem();\n nullInteractorType(body,me);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var comp=cx_ite.elem();\n nullInteractorType(comp,me);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(xarb.present==0){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if(i1!=me&&i2!=me){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset!=null){\n xarb.present--;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n xarb.present>=0;\n };\n if(!res)throw \"assert(\"+\"xarb.present>=0\"+\") :: \"+(\"xarb present <0?\");\n #end\n };\n callbackset.remove_arb(xarb);\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n public function freshListenerType(cb1:ZPP_CbSet,cb2:ZPP_CbSet){\n var stack=new ZNPList_ZPP_Interactor();\n {\n var cx_ite=cb1.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n if(cb1!=cb2){\n var cx_ite=cb2.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n while(!stack.empty()){\n var intx=stack.pop_unsafe();\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(!xarb.presentable){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n if(i1.cbSet!=cb1&&i1.cbSet!=cb2){\n cx_ite=cx_ite.next;\n continue;\n };\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if((i1.cbSet==cb1&&i2.cbSet!=cb2)||(i1.cbSet==cb2&&i2.cbSet!=cb1)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n if(callbackset.add_arb(xarb)){\n xarb.present++;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public function freshInteractorType(intx:ZPP_Interactor,me:ZPP_Interactor=null){\n if(me==null)me=intx;\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var body=cx_ite.elem();\n freshInteractorType(body,me);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var comp=cx_ite.elem();\n freshInteractorType(comp,me);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(!xarb.presentable){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if(i1!=me&&i2!=me){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cbset from MRCA_chain?\");\n #end\n };\n cb1.validate();\n cb2.validate();\n if(!ZPP_CbSet.empty_intersection(cb1,cb2)){\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n if(callbackset.add_arb(xarb)){\n xarb.present++;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n public function wakeCompound(x:ZPP_Compound){\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n {\n var o=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n wake_constraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n wakeCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function wakeIsland(i:ZPP_Island){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i.sleep;\n };\n if(!res)throw \"assert(\"+\"i.sleep\"+\") :: \"+(\"this island is not sleeping but referenced? wtf\");\n #end\n };\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n c.sleeping;\n };\n if(!res)throw \"assert(\"+\"c.sleeping\"+\") :: \"+(\"???\");\n #end\n };\n c.waket=stamp+(midstep?0:1);\n if(c.isBody){\n var b=c.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b.space==this;\n };\n if(!res)throw \"assert(\"+\"b.space==this\"+\") :: \"+(\"wakeIsland:: body is not actually IN this space??\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b.isDynamic();\n };\n if(!res)throw \"assert(\"+\"b.isDynamic()\"+\") :: \"+(\"din din\");\n #end\n };\n live.add(b);\n {\n var cx_ite=b.arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(arb.sleeping){\n arb.sleeping=false;\n arb.up_stamp+=stamp-arb.sleep_stamp;\n if(arb.type==ZPP_Arbiter.COL){\n var carb=arb.colarb;\n if(carb.stat)c_arbiters_true.inlined_add(carb);\n else c_arbiters_false.inlined_add(carb);\n }\n else if(arb.type==ZPP_Arbiter.FLUID)f_arbiters.inlined_add(arb.fluidarb);\n else s_arbiters.inlined_add(arb.sensorarb);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n bodyCbWake(b);\n c.reset();\n if(!b.isStatic()){\n var cx_ite=b.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n if(shape.node!=null)bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var con=c.constraint;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.space==this;\n };\n if(!res)throw \"assert(\"+\"con.space==this\"+\") :: \"+(\"wakeIsland:: constraint is not actually IN this space??\");\n #end\n };\n live_constraints.inlined_add(con);\n constraintCbWake(con);\n c.reset();\n }\n }\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n public function non_inlined_wake(o:ZPP_Body,fst=false){\n {\n var o=o;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,fst);\n }\n }\n };\n }\n public function really_wake(o:ZPP_Body,fst=false){\n if(o.component.island==null){\n o.component.sleeping=false;\n if(o.isKinematic()||o.isStatic())staticsleep.inlined_add(o);\n else live.inlined_add(o);\n {\n var cx_ite=o.constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n if(con.space==this)wake_constraint(con);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=o.arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(arb.sleeping){\n arb.sleeping=false;\n arb.up_stamp+=stamp+(midstep?0:1)-arb.sleep_stamp;\n if(arb.type==ZPP_Arbiter.COL){\n var carb=arb.colarb;\n if(carb.stat)c_arbiters_true.inlined_add(carb);\n else c_arbiters_false.inlined_add(carb);\n }\n else if(arb.type==ZPP_Arbiter.FLUID)f_arbiters.inlined_add(arb.fluidarb);\n else s_arbiters.inlined_add(arb.sensorarb);\n }\n if(arb.type!=ZPP_Arbiter.SENSOR&&!arb.cleared&&arb.up_stamp>=stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(!fst&&o.isDynamic())bodyCbWake(o);\n if(!fst&&!bphase.is_sweep&&!o.isStatic()){\n var cx_ite=o.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n if(shape.node!=null)bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n wakeIsland(o.component.island);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component.island==null;\n };\n if(!res)throw \"assert(\"+\"o.component.island==null\"+\") :: \"+(\"woken, but island non-null?\");\n #end\n };\n }\n public function wake_constraint(con:ZPP_Constraint,fst=false){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.space==this;\n };\n if(!res)throw \"assert(\"+\"con.space==this\"+\") :: \"+(\"constraint woken, but not actually IN the space!\");\n #end\n };\n if(con.active){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component!=null;\n };\n if(!res)throw \"assert(\"+\"con.component!=null\"+\") :: \"+(\"constraint woken but no component exists?\");\n #end\n };\n con.component.waket=stamp+(midstep?0:1);\n if(con.component.sleeping){\n if(con.component.island==null){\n con.component.sleeping=false;\n live_constraints.inlined_add(con);\n con.wake_connected();\n if(!fst)constraintCbWake(con);\n }\n else{\n wakeIsland(con.component.island);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component.island==null;\n };\n if(!res)throw \"assert(\"+\"con.component.island==null\"+\") :: \"+(\"woken (con), but island non-null?\");\n #end\n };\n return true;\n }\n else return false;\n }\n else return false;\n }\n public function doForests(dt:Float){\n {\n var cx_ite=c_arbiters_false.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(!arb.cleared&&arb.up_stamp==stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b2.isDynamic()){\n var xr=({\n if(arb.b1.component==arb.b1.component.parent)arb.b1.component;\n else{\n var obj=arb.b1.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n var yr=({\n if(arb.b2.component==arb.b2.component.parent)arb.b2.component;\n else{\n var obj=arb.b2.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(xr!=yr){\n if(xr.rankyr.rank)yr.parent=xr;\n else{\n yr.parent=xr;\n xr.rank++;\n }\n }\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=f_arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(!arb.cleared&&arb.up_stamp==stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b2.isDynamic()){\n var xr=({\n if(arb.b1.component==arb.b1.component.parent)arb.b1.component;\n else{\n var obj=arb.b1.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n var yr=({\n if(arb.b2.component==arb.b2.component.parent)arb.b2.component;\n else{\n var obj=arb.b2.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(xr!=yr){\n if(xr.rankyr.rank)yr.parent=xr;\n else{\n yr.parent=xr;\n xr.rank++;\n }\n }\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=live_constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n con.forest();\n cx_ite=cx_ite.next;\n }\n };\n while(!live.empty()){\n var o=live.inlined_pop_unsafe();\n var oc=o.component;\n var root=({\n if(oc==oc.parent)oc;\n else{\n var obj=oc;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(root.island==null){\n {\n if(ZPP_Island.zpp_pool==null){\n root.island=new ZPP_Island();\n #if NAPE_POOL_STATS ZPP_Island.POOL_TOT++;\n ZPP_Island.POOL_ADDNEW++;\n #end\n }\n else{\n root.island=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=root.island.next;\n root.island.next=null;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT--;\n ZPP_Island.POOL_ADD++;\n #end\n }\n root.island.alloc();\n };\n islands.inlined_add(root.island);\n root.island.sleep=true;\n }\n oc.island=root.island;\n oc.island.comps.inlined_add(oc);\n var rest=o.atRest(dt);\n oc.island.sleep=oc.island.sleep&&rest;\n if(oc.waket>oc.island.waket)oc.island.waket=oc.waket;\n }\n while(!live_constraints.empty()){\n var o=live_constraints.inlined_pop_unsafe();\n var oc=o.component;\n var root=({\n if(oc==oc.parent)oc;\n else{\n var obj=oc;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n root.island!=null;\n };\n if(!res)throw \"assert(\"+\"root.island!=null\"+\") :: \"+(\"constraint without bodies?\");\n #end\n };\n oc.island=root.island;\n oc.island.comps.inlined_add(oc);\n if(oc.waket>oc.island.waket)oc.island.waket=oc.waket;\n }\n while(!islands.empty()){\n var i=islands.inlined_pop_unsafe();\n if(i.sleep){\n {\n var cx_ite=i.comps.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c.isBody){\n var b=c.body;\n {\n b.velx=0;\n b.vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((b.velx!=b.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(b.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"b.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((b.vely!=b.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(b.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"b.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n b.angvel=0;\n c.sleeping=true;\n {\n var cx_ite=b.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n }\n bodyCbSleep(b);\n }\n else{\n var con=c.constraint;\n constraintCbSleep(con);\n c.sleeping=true;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n while(!i.comps.empty()){\n var c=i.comps.inlined_pop_unsafe();\n c.waket=i.waket;\n if(c.isBody)live.inlined_add(c.body);\n else live_constraints.inlined_add(c.constraint);\n c.reset();\n }\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n }\n public function sleepArbiters(){\n {\n var pre=null;\n var arbs=c_arbiters_true;\n var arbite=arbs.begin();\n var fst=c_arbiters_false!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n }\n };\n {\n var pre=null;\n var arbs=f_arbiters;\n var arbite=arbs.begin();\n var fst=null!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n }\n };\n {\n var pre=null;\n var arbs=s_arbiters;\n var arbite=arbs.begin();\n var fst=null!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n }\n };\n }\n public function static_validation(body:ZPP_Body){\n if(!body.shapes.empty()){\n body.validate_aabb();\n }\n body.validate_mass();\n body.validate_inertia();\n #if(!NAPE_RELEASE_BUILD)\n if(body.velx!=0||body.vely!=0||body.angvel!=0)throw \"Error: Static body cannot have any real velocity, only kinematic or surface velocities\";\n #end\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n body.sweepFrozen=true;\n }\n public function validation(){\n cbsets.validate();\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n cur.sweepRadius=0;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n s.validate_sweepRadius();\n if(s.sweepRadius>cur.sweepRadius)cur.sweepRadius=s.sweepRadius;\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.validate_mass();\n cur.validate_inertia();\n if(!cur.shapes.empty()){\n cur.validate_aabb();\n cur.validate_worldCOM();\n }\n cur.validate_gravMass();\n cur.validate_axis();\n #if(!NAPE_RELEASE_BUILD)\n if(!cur.nomove&&cur.isDynamic()&&cur.mass==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false\";\n }\n if(!cur.norotate&&cur.isDynamic()&&cur.inertia==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false\";\n }\n #end\n if(!false){\n if(cur.component.woken&&cur.cbSet!=null){\n {\n var cx_ite=cur.cbSet.bodylisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.body=cur;\n };\n cx_ite=cx_ite.next;\n }\n }\n }\n cur.component.woken=false;\n }\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n cur.sweepRadius=0;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n s.validate_sweepRadius();\n if(s.sweepRadius>cur.sweepRadius)cur.sweepRadius=s.sweepRadius;\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.validate_mass();\n cur.validate_inertia();\n if(!cur.shapes.empty()){\n cur.validate_aabb();\n cur.validate_worldCOM();\n }\n cur.validate_gravMass();\n cur.validate_axis();\n #if(!NAPE_RELEASE_BUILD)\n if(!cur.nomove&&cur.isDynamic()&&cur.mass==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false\";\n }\n if(!cur.norotate&&cur.isDynamic()&&cur.inertia==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false\";\n }\n #end\n if(!true){\n if(cur.component.woken&&cur.cbSet!=null){\n {\n var cx_ite=cur.cbSet.bodylisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.body=cur;\n };\n cx_ite=cx_ite.next;\n }\n }\n }\n cur.component.woken=false;\n }\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n var cx_ite=live_constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n {\n if(con.active){\n #if(!NAPE_RELEASE_BUILD)\n con.validate();\n #end\n if(con.component.woken&&con.cbSet!=null){\n {\n var cx_ite=con.cbSet.conlisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.constraint=con;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n con.component.woken=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function updateVel(dt:Float){\n var pre=null;\n var linDrag=1-(dt*global_lin_drag);\n var angDrag=1-(dt*global_ang_drag);\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n if(cur.smass!=0.0){\n var time=dt*cur.imass;\n cur.velx=(linDrag*cur.velx)+(cur.forcex+gravityx*cur.gravMass)*time;\n cur.vely=(linDrag*cur.vely)+(cur.forcey+gravityy*cur.gravMass)*time;\n }\n if(cur.sinertia!=0.0){\n var dpx:Float=0.0;\n var dpy:Float=0.0;\n {\n dpx=cur.worldCOMx-cur.posx;\n dpy=cur.worldCOMy-cur.posy;\n };\n var torque=cur.torque+((gravityy*dpx-gravityx*dpy)*cur.gravMass);\n cur.angvel=(angDrag*cur.angvel)+(torque*dt*cur.iinertia);\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function updatePos(dt:Float){\n var MAX_VEL=2*Math.PI/dt;\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n cur.sweepTime=0;\n cur.sweep_angvel=(cur.angvel)%MAX_VEL;\n cur.sweepIntegrate(dt);\n if(!cur.disableCCD){\n var linThreshold=Config.staticCCDLinearThreshold*cur.sweepRadius;\n var angThreshold=Config.staticCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold*linThreshold)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold*angThreshold))||cur.isKinematic()){\n var angvel=cur.sweep_angvel;\n if(angvel<0)angvel=-angvel;\n var iangvel=1/angvel;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n var aabb=s.aabb;\n var minx=aabb.minx;\n var miny=aabb.miny;\n var maxx=aabb.maxx;\n var maxy=aabb.maxy;\n var count:Int=(#if flash9 untyped __int__(angvel*dt*s.sweepCoef*(1/120))#else Std.int(angvel*dt*s.sweepCoef*(1/120))#end);\n if(count>8)count=8;\n var anginc=(angvel*dt)/count;\n cur.sweepIntegrate(dt);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n for(i in 1...count){\n cur.sweepIntegrate(anginc*i*iangvel);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n }\n bphase.sync(s);\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.sweepFrozen=false;\n if(cur.isDynamic()&&cur.bulletEnabled){\n var linThreshold2=Config.bulletCCDLinearThreshold*cur.sweepRadius;\n var angThreshold2=Config.bulletCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold2*linThreshold2)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold2*angThreshold2))){\n cur.bullet=true;\n }\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n cur.sweepTime=0;\n cur.sweep_angvel=(cur.angvel)%MAX_VEL;\n cur.sweepIntegrate(dt);\n if(!cur.disableCCD){\n var linThreshold=Config.staticCCDLinearThreshold*cur.sweepRadius;\n var angThreshold=Config.staticCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold*linThreshold)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold*angThreshold))||cur.isKinematic()){\n var angvel=cur.sweep_angvel;\n if(angvel<0)angvel=-angvel;\n var iangvel=1/angvel;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n var aabb=s.aabb;\n var minx=aabb.minx;\n var miny=aabb.miny;\n var maxx=aabb.maxx;\n var maxy=aabb.maxy;\n var count:Int=(#if flash9 untyped __int__(angvel*dt*s.sweepCoef*(1/120))#else Std.int(angvel*dt*s.sweepCoef*(1/120))#end);\n if(count>8)count=8;\n var anginc=(angvel*dt)/count;\n cur.sweepIntegrate(dt);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n for(i in 1...count){\n cur.sweepIntegrate(anginc*i*iangvel);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n }\n bphase.sync(s);\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.sweepFrozen=false;\n if(cur.isDynamic()&&cur.bulletEnabled){\n var linThreshold2=Config.bulletCCDLinearThreshold*cur.sweepRadius;\n var angThreshold2=Config.bulletCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold2*linThreshold2)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold2*angThreshold2))){\n cur.bullet=true;\n }\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n public var continuous:Bool=false;\n public function presteparb(arb:ZPP_Arbiter,dt:Float,?cont=false){\n if(!arb.cleared&&(arb.b1.component.sleeping&&arb.b2.component.sleeping)){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"sleep in prestep (no longer should occur)\");\n #end\n };\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n return true;\n }\n #if NAPE_TIMES Debug.ACNT++;\n #end\n if(!arb.cleared||arb.present!=0||arb.intchange){\n var endcb=(!cont&&arb.up_stamp==stamp-1)&&!arb.cleared&&!arb.intchange;\n var begcb=(arb.fresh)&&!arb.cleared&&!arb.intchange;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !begcb||arb.up_stamp==stamp;\n };\n if(!res)throw \"assert(\"+\"!begcb||arb.up_stamp==stamp\"+\") :: \"+(\" fresh -> active=true hasn't held :(\"+begcb+\" \"+arb.up_stamp+\" \"+stamp);\n #end\n };\n if(endcb){\n arb.endGenerated=stamp;\n }\n if(begcb||endcb||arb.cleared||arb.intchange){\n inlined_MRCA_chains(arb.ws1,arb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(begcb||arb.intchange){\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_BEGIN,function(listener:ZPP_InteractionListener){\n if((listener.itype&arb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_BEGIN;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.add_arb(arb))arb.present++;\n }\n else{\n arb.present--;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb.present>=0;\n };\n if(!res)throw \"assert(\"+\"arb.present>=0\"+\") :: \"+(\"arb present < 0?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n callbackset!=null;\n };\n if(!res)throw \"assert(\"+\"callbackset!=null\"+\") :: \"+(\"end arbiter with no callbackset\");\n #end\n };\n callbackset.remove_arb(arb);\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_END,function(listener:ZPP_InteractionListener){\n if((listener.itype&arb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_END;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n arb.fresh=false;\n arb.intchange=false;\n }\n if(arb.cleared||arb.up_stamp+(arb.type==ZPP_Arbiter.COL?Config.arbiterExpirationDelay:0)s2.type){\n sa=s2;\n sb=s1;\n }\n else if(s1.type==s2.type){\n if(s1.id\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n if(ZPP_FluidArbiter.zpp_pool==null){\n arb=new ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_TOT++;\n ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT--;\n ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n }\n else{\n if(xarb.fluidarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_FluidArbiter.zpp_pool==null){\n arb=new ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_TOT++;\n ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT--;\n ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n first=true;\n swapped=true;\n }\n else arb=xarb.fluidarb;\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_FLUID;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.flowCollide(sa,sb,arb)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n f_arbiters.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.FLUIDstamp!=stamp||continuous)&&(callbackset.FLUIDstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.FLUIDstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if false arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.FLUIDstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.FLUIDstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(true){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(true&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n f_arbiters.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT++;\n ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n else if(itype==1){\n var carbs=stat?c_arbiters_true:c_arbiters_false;\n var xarb=if(in_arb==null)({\n var ret:ZPP_Arbiter=null;\n var b=if(b1.arbiters.length\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n {\n if(ZPP_ColArbiter.zpp_pool==null){\n arb=new ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_TOT++;\n ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT--;\n ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.stat=stat;\n }\n else{\n if(xarb.colarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_ColArbiter.zpp_pool==null){\n arb=new ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_TOT++;\n ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT--;\n ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n arb.stat=stat;\n first=true;\n swapped=true;\n }\n else{\n arb=xarb.colarb;\n reverse=sa!=arb.s1;\n if(arb.stat!=stat){\n arb.stat=stat;\n if(!arb.sleeping){\n (if(stat)c_arbiters_false else c_arbiters_true).remove(arb);\n carbs.add(arb);\n }\n }\n }\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_COLLISION;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.contactCollide(sa,sb,arb,reverse)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n carbs.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.COLLISIONstamp!=stamp||continuous)&&(callbackset.COLLISIONstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.COLLISIONstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if true arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.COLLISIONstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.COLLISIONstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(true){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(true&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n carbs.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ColArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT++;\n ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n else{\n var xarb=if(in_arb==null)({\n var ret:ZPP_Arbiter=null;\n var b=if(b1.arbiters.length\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n if(ZPP_SensorArbiter.zpp_pool==null){\n arb=new ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_TOT++;\n ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT--;\n ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n }\n else{\n if(xarb.sensorarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_SensorArbiter.zpp_pool==null){\n arb=new ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_TOT++;\n ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT--;\n ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n first=true;\n swapped=true;\n }\n else arb=xarb.sensorarb;\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_SENSOR;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.testCollide(sa,sb)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n s_arbiters.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.SENSORstamp!=stamp||continuous)&&(callbackset.SENSORstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.SENSORstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if false arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.SENSORstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.SENSORstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(false){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(false&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n s_arbiters.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SensorArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT++;\n ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n }\n #if NAPE_TIMES Debug.NARROW+=flash.Lib.getTimer()-pt;\n #end\n return ret;\n }\n public var mrca1:ZNPList_ZPP_Interactor;\n public var mrca2:ZNPList_ZPP_Interactor;\n public function MRCA_chains(s1:ZPP_Shape,s2:ZPP_Shape){\n inlined_MRCA_chains(s1,s2);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_MRCA_chains(s1:ZPP_Shape,s2:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n s1!=s2&&s1.body!=s2.body;\n };\n if(!res)throw \"assert(\"+\"s1!=s2&&s1.body!=s2.body\"+\") :: \"+(\"MRCA chain for equal shapes, or shapes of the same body?\");\n #end\n };\n mrca1.inlined_clear();\n mrca2.inlined_clear();\n if(s1.cbSet!=null)mrca1.inlined_add(s1);\n if(s1.body.cbSet!=null)mrca1.inlined_add(s1.body);\n if(s2.cbSet!=null)mrca2.inlined_add(s2);\n if(s2.body.cbSet!=null)mrca2.inlined_add(s2.body);\n var c1=s1.body.compound;\n var c2=s2.body.compound;\n while(c1!=c2){\n var d1=if(c1==null)0 else c1.depth;\n var d2=if(c2==null)0 else c2.depth;\n if(d1x.aabb.minx;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SweepPhase extends ZPP_Broadphase{\n public var list:ZPP_SweepData=null;\n public function new(space:ZPP_Space){\n this.space=space;\n is_sweep=true;\n sweep=this;\n }\n public function __insert(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.sweep==null;\n };\n if(!res)throw \"assert(\"+\"shape.sweep==null\"+\") :: \"+(\"SweepPhase::insert\");\n #end\n };\n var dat;\n {\n if(ZPP_SweepData.zpp_pool==null){\n dat=new ZPP_SweepData();\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_TOT++;\n ZPP_SweepData.POOL_ADDNEW++;\n #end\n }\n else{\n dat=ZPP_SweepData.zpp_pool;\n ZPP_SweepData.zpp_pool=dat.next;\n dat.next=null;\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_CNT--;\n ZPP_SweepData.POOL_ADD++;\n #end\n }\n dat.alloc();\n };\n shape.sweep=dat;\n dat.shape=shape;\n dat.aabb=shape.aabb;\n dat.next=list;\n if(list!=null)list.prev=dat;\n list=dat;\n }\n public function __remove(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.sweep!=null;\n };\n if(!res)throw \"assert(\"+\"shape.sweep!=null\"+\") :: \"+(\"SweepPhase::remove\");\n #end\n };\n var dat=shape.sweep;\n if(dat.prev==null)list=dat.next;\n else dat.prev.next=dat.next;\n if(dat.next!=null)dat.next.prev=dat.prev;\n shape.sweep=null;\n {\n var o=dat;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SweepData\"+\", in obj: \"+\"dat\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SweepData.zpp_pool;\n ZPP_SweepData.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_CNT++;\n ZPP_SweepData.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __sync(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !shape.body.isStatic();\n };\n if(!res)throw \"assert(\"+\"!shape.body.isStatic()\"+\") :: \"+(\"static shape being synced?\");\n #end\n };\n if(!space.continuous)shape.validate_aabb();\n }\n public function sync_broadphase(){\n space.validation();\n if(list!=null)sync_broadphase_fast();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sync_broadphase_fast(){\n var a=list.next;\n while(a!=null){\n #if NAPE_TIMES Debug.BROADTOTAL++;\n #end\n var n=a.next;\n var b=a.prev;\n if(a.gt(b)){\n a=n;\n continue;\n }\n #if NAPE_TIMES Debug.BROADCLASH++;\n #end\n while(b.prev!=null&&b.prev.gt(a))b=b.prev;\n var prev=a.prev;\n prev.next=a.next;\n if(a.next!=null)a.next.prev=prev;\n if(b.prev==null){\n a.prev=null;\n list=a;\n a.next=b;\n b.prev=a;\n }\n else{\n a.prev=b.prev;\n b.prev=a;\n a.prev.next=a;\n a.next=b;\n }\n a=n;\n }\n }\n public override function broadphase(space:ZPP_Space,discrete:Bool){\n if(list!=null){\n sync_broadphase_fast();\n var d1=list;\n while(d1!=null){\n var d2=d1.next;\n var s1=d1.shape;\n var b1=s1.body;\n var bottom=d1.aabb.maxx;\n while(d2!=null){\n if(d2.aabb.minx>bottom)break;\n var s2=d2.shape;\n var b2=s2.body;\n if(b2==b1){\n d2=d2.next;\n continue;\n }\n if(b1.isStatic()&&b2.isStatic()){\n d2=d2.next;\n continue;\n }\n if(b1.component.sleeping&&b2.component.sleeping){\n d2=d2.next;\n continue;\n }\n if(s1.aabb.intersectY(s2.aabb)){\n if(discrete){\n space.narrowPhase(s1,s2,!b1.isDynamic()||!b2.isDynamic(),null,false);\n }\n else{\n space.continuousEvent(s1,s2,!b1.isDynamic()||!b2.isDynamic(),null,false);\n }\n }\n d2=d2.next;\n }\n d1=d1.next;\n }\n }\n }\n public override function clear(){\n while(list!=null){\n list.shape.removedFromSpace();\n __remove(list.shape);\n }\n }\n public override function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList){\n sync_broadphase();\n var v=ZPP_Vec2.get(x,y);\n var ret=(output==null?new ShapeList():output);\n var a=list;\n while(a!=null&&a.aabb.minx>x)a=a.next;\n while(a!=null&&a.aabb.minx<=x){\n if(a.aabb.maxx>=x&&a.aabb.miny<=y&&a.aabb.maxy>=y){\n var shape=a.shape;\n if(filter==null||shape.filter.shouldCollide(filter)){\n if(shape.isCircle()){\n if(ZPP_Collide.circleContains(shape.circle,v))ret.push(shape.outer);\n }\n else{\n if(ZPP_Collide.polyContains(shape.polygon,v))ret.push(shape.outer);\n }\n }\n }\n a=a.next;\n }\n {\n var o=v;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"v\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n return ret;\n }\n public override function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList){\n sync_broadphase();\n var v=ZPP_Vec2.get(x,y);\n var ret=(output==null?new BodyList():output);\n var a=list;\n while(a!=null&&a.aabb.minx>x)a=a.next;\n while(a!=null&&a.aabb.minx<=x){\n if(a.aabb.maxx>=x&&a.aabb.miny<=y&&a.aabb.maxy>=y){\n var shape=a.shape;\n var body=shape.body.outer;\n if(!ret.has(body)){\n if(filter==null||shape.filter.shouldCollide(filter)){\n if(shape.isCircle()){\n if(ZPP_Collide.circleContains(shape.circle,v))ret.push(body);\n }\n else{\n if(ZPP_Collide.polyContains(shape.polygon,v))ret.push(body);\n }\n }\n }\n }\n a=a.next;\n }\n {\n var o=v;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"v\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n return ret;\n }\n public override function shapesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n sync_broadphase();\n updateAABBShape(aabb);\n var ab=aabbShape.zpp_inner.aabb;\n var ret=(output==null?new ShapeList():output);\n var a=list;\n while(a!=null&&a.aabb.maxx=0&&t=0&&t=0&&t=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.next;\n }\n }\n else if(ray.dirx<0){\n var a=list;\n var b=null;\n while(a!=null&&a.aabb.minx<=rayab.maxx){\n b=a;\n a=a.next;\n }\n a=b;\n while(a!=null){\n if(a.aabb.intersect(rayab)&&(filter==null||a.shape.filter.shouldCollide(filter))){\n var t=ray.aabbsect(a.aabb);\n if(t>=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.prev;\n }\n }\n else{\n var a=list;\n while(a!=null&&a.aabb.minx<=rayab.maxx){\n if(a.aabb.intersect(rayab)&&(filter==null||a.shape.filter.shouldCollide(filter))){\n var t=ray.aabbsect(a.aabb);\n if(t>=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.next;\n }\n }\n {\n var o=rayab;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"rayab\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n return ret;\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if flash10 import flash.Memory;\nimport flash.utils.ByteArray;\n#end\n#if nape_swc@:keep #end\nclass ZPP_Math{\n public static#if NAPE_NO_INLINE#else inline #end\n function sqrt(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)\"+\") :: \"+(\"PR(Math).sqrt\");\n #end\n };\n #if flash10 return if(x==0.0)0.0 else 1/invsqrt(x);\n #else return Math.sqrt(x);\n #end\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function invsqrt(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&x!=0.0;\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&x!=0.0\"+\") :: \"+(\"PR(Math).invsqrt\");\n #end\n };\n #if flash10 Memory.setFloat(0,x);\n Memory.setI32(0,0x5f3759df-(Memory.getI32(0)>>1));\n var x2=Memory.getFloat(0);\n return x2*(1.5-0.5*x*x2*x2);\n #else return 1.0/sqrt(x);\n #end\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function sqr(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)\"+\") :: \"+(\"PR(Math).sqr\");\n #end\n };\n return x*x;\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function clamp2(x:Float,a:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&!((a!=a));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&!assert_isNaN(a)\"+\") :: \"+(\"PR(Math).clamp2 -> \"+x+\" -> \"+a);\n #end\n };\n return clamp(x,-a,a);\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function clamp(x:Float,a:Float,b:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&!((a!=a))&&!((b!=b));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&!assert_isNaN(a)&&!assert_isNaN(b)\"+\") :: \"+(\"PR(Math).clamp2 -> \"+x+\" -> \"+a+\" -> \"+b);\n #end\n };\n return if(xb)b else x;\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_Body{\n static public var zpp_pool:ZPP_Set_ZPP_Body=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_Body->ZPP_Body->Bool=null;\n public var swapped:ZPP_Body->ZPP_Body->Void=null;\n public var data:ZPP_Body=null;\n public var prev:ZPP_Set_ZPP_Body=null;\n public var next:ZPP_Set_ZPP_Body=null;\n public var parent:ZPP_Set_ZPP_Body=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_Body){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_Body){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_Body){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_Body){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_Body){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_Body){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_Body\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT++;\n ZPP_Set_ZPP_Body.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_Body->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_Body,lambda:ZPP_Body->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_Body\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT++;\n ZPP_Set_ZPP_Body.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_Body){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_Body){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_Body,n2:ZPP_Set_ZPP_Body,n3:ZPP_Set_ZPP_Body,t1:ZPP_Set_ZPP_Body,t2:ZPP_Set_ZPP_Body,t3:ZPP_Set_ZPP_Body,t4:ZPP_Set_ZPP_Body;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_Body){\n var x:ZPP_Set_ZPP_Body=null;\n var cur:ZPP_Set_ZPP_Body=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_Body){\n var x:ZPP_Set_ZPP_Body=null;\n var cur:ZPP_Set_ZPP_Body=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_CbSetPair{\n static public var zpp_pool:ZPP_Set_ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_CbSetPair->ZPP_CbSetPair->Bool=null;\n public var swapped:ZPP_CbSetPair->ZPP_CbSetPair->Void=null;\n public var data:ZPP_CbSetPair=null;\n public var prev:ZPP_Set_ZPP_CbSetPair=null;\n public var next:ZPP_Set_ZPP_CbSetPair=null;\n public var parent:ZPP_Set_ZPP_CbSetPair=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_CbSetPair){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_CbSetPair){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_CbSetPair){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_CbSetPair){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_CbSetPair){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_CbSetPair){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_CbSetPair->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_CbSetPair,lambda:ZPP_CbSetPair->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_CbSetPair){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_CbSetPair){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_CbSetPair,n2:ZPP_Set_ZPP_CbSetPair,n3:ZPP_Set_ZPP_CbSetPair,t1:ZPP_Set_ZPP_CbSetPair,t2:ZPP_Set_ZPP_CbSetPair,t3:ZPP_Set_ZPP_CbSetPair,t4:ZPP_Set_ZPP_CbSetPair;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_CbSetPair){\n var x:ZPP_Set_ZPP_CbSetPair=null;\n var cur:ZPP_Set_ZPP_CbSetPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_CbSetPair){\n var x:ZPP_Set_ZPP_CbSetPair=null;\n var cur:ZPP_Set_ZPP_CbSetPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_PartitionVertex{\n static public var zpp_pool:ZPP_Set_ZPP_PartitionVertex=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_PartitionVertex->ZPP_PartitionVertex->Bool=null;\n public var swapped:ZPP_PartitionVertex->ZPP_PartitionVertex->Void=null;\n public var data:ZPP_PartitionVertex=null;\n public var prev:ZPP_Set_ZPP_PartitionVertex=null;\n public var next:ZPP_Set_ZPP_PartitionVertex=null;\n public var parent:ZPP_Set_ZPP_PartitionVertex=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_PartitionVertex){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_PartitionVertex){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_PartitionVertex){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_PartitionVertex){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_PartitionVertex){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_PartitionVertex){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionVertex\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_PartitionVertex->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_PartitionVertex,lambda:ZPP_PartitionVertex->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionVertex\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_PartitionVertex){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_PartitionVertex){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_PartitionVertex,n2:ZPP_Set_ZPP_PartitionVertex,n3:ZPP_Set_ZPP_PartitionVertex,t1:ZPP_Set_ZPP_PartitionVertex,t2:ZPP_Set_ZPP_PartitionVertex,t3:ZPP_Set_ZPP_PartitionVertex,t4:ZPP_Set_ZPP_PartitionVertex;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_PartitionVertex){\n var x:ZPP_Set_ZPP_PartitionVertex=null;\n var cur:ZPP_Set_ZPP_PartitionVertex=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_PartitionVertex){\n var x:ZPP_Set_ZPP_PartitionVertex=null;\n var cur:ZPP_Set_ZPP_PartitionVertex=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_PartitionPair{\n static public var zpp_pool:ZPP_Set_ZPP_PartitionPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_PartitionPair->ZPP_PartitionPair->Bool=null;\n public var swapped:ZPP_PartitionPair->ZPP_PartitionPair->Void=null;\n public var data:ZPP_PartitionPair=null;\n public var prev:ZPP_Set_ZPP_PartitionPair=null;\n public var next:ZPP_Set_ZPP_PartitionPair=null;\n public var parent:ZPP_Set_ZPP_PartitionPair=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_PartitionPair){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_PartitionPair){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_PartitionPair){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_PartitionPair){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_PartitionPair){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_PartitionPair){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT++;\n ZPP_Set_ZPP_PartitionPair.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_PartitionPair->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_PartitionPair,lambda:ZPP_PartitionPair->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionPair\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT++;\n ZPP_Set_ZPP_PartitionPair.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_PartitionPair){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_PartitionPair){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_PartitionPair,n2:ZPP_Set_ZPP_PartitionPair,n3:ZPP_Set_ZPP_PartitionPair,t1:ZPP_Set_ZPP_PartitionPair,t2:ZPP_Set_ZPP_PartitionPair,t3:ZPP_Set_ZPP_PartitionPair,t4:ZPP_Set_ZPP_PartitionPair;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_PartitionPair){\n var x:ZPP_Set_ZPP_PartitionPair=null;\n var cur:ZPP_Set_ZPP_PartitionPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_PartitionPair){\n var x:ZPP_Set_ZPP_PartitionPair=null;\n var cur:ZPP_Set_ZPP_PartitionPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleVert{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleVert->ZPP_SimpleVert->Bool=null;\n public var swapped:ZPP_SimpleVert->ZPP_SimpleVert->Void=null;\n public var data:ZPP_SimpleVert=null;\n public var prev:ZPP_Set_ZPP_SimpleVert=null;\n public var next:ZPP_Set_ZPP_SimpleVert=null;\n public var parent:ZPP_Set_ZPP_SimpleVert=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleVert){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleVert){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleVert){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleVert){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleVert){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleVert){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleVert\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT++;\n ZPP_Set_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleVert->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleVert,lambda:ZPP_SimpleVert->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleVert\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT++;\n ZPP_Set_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleVert){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleVert){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleVert,n2:ZPP_Set_ZPP_SimpleVert,n3:ZPP_Set_ZPP_SimpleVert,t1:ZPP_Set_ZPP_SimpleVert,t2:ZPP_Set_ZPP_SimpleVert,t3:ZPP_Set_ZPP_SimpleVert,t4:ZPP_Set_ZPP_SimpleVert;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleVert){\n var x:ZPP_Set_ZPP_SimpleVert=null;\n var cur:ZPP_Set_ZPP_SimpleVert=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleVert){\n var x:ZPP_Set_ZPP_SimpleVert=null;\n var cur:ZPP_Set_ZPP_SimpleVert=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleSeg{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleSeg=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleSeg->ZPP_SimpleSeg->Bool=null;\n public var swapped:ZPP_SimpleSeg->ZPP_SimpleSeg->Void=null;\n public var data:ZPP_SimpleSeg=null;\n public var prev:ZPP_Set_ZPP_SimpleSeg=null;\n public var next:ZPP_Set_ZPP_SimpleSeg=null;\n public var parent:ZPP_Set_ZPP_SimpleSeg=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleSeg){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleSeg){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleSeg){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleSeg){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleSeg){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleSeg){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleSeg\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleSeg->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleSeg,lambda:ZPP_SimpleSeg->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleSeg\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleSeg){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleSeg){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleSeg,n2:ZPP_Set_ZPP_SimpleSeg,n3:ZPP_Set_ZPP_SimpleSeg,t1:ZPP_Set_ZPP_SimpleSeg,t2:ZPP_Set_ZPP_SimpleSeg,t3:ZPP_Set_ZPP_SimpleSeg,t4:ZPP_Set_ZPP_SimpleSeg;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleSeg){\n var x:ZPP_Set_ZPP_SimpleSeg=null;\n var cur:ZPP_Set_ZPP_SimpleSeg=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleSeg){\n var x:ZPP_Set_ZPP_SimpleSeg=null;\n var cur:ZPP_Set_ZPP_SimpleSeg=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleEvent{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleEvent->ZPP_SimpleEvent->Bool=null;\n public var swapped:ZPP_SimpleEvent->ZPP_SimpleEvent->Void=null;\n public var data:ZPP_SimpleEvent=null;\n public var prev:ZPP_Set_ZPP_SimpleEvent=null;\n public var next:ZPP_Set_ZPP_SimpleEvent=null;\n public var parent:ZPP_Set_ZPP_SimpleEvent=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleEvent){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleEvent){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleEvent){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleEvent){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleEvent){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleEvent){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleEvent\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleEvent->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleEvent,lambda:ZPP_SimpleEvent->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleEvent\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleEvent){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleEvent){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleEvent,n2:ZPP_Set_ZPP_SimpleEvent,n3:ZPP_Set_ZPP_SimpleEvent,t1:ZPP_Set_ZPP_SimpleEvent,t2:ZPP_Set_ZPP_SimpleEvent,t3:ZPP_Set_ZPP_SimpleEvent,t4:ZPP_Set_ZPP_SimpleEvent;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleEvent){\n var x:ZPP_Set_ZPP_SimpleEvent=null;\n var cur:ZPP_Set_ZPP_SimpleEvent=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleEvent){\n var x:ZPP_Set_ZPP_SimpleEvent=null;\n var cur:ZPP_Set_ZPP_SimpleEvent=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_CbSet{\n static public var zpp_pool:ZPP_Set_ZPP_CbSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_CbSet->ZPP_CbSet->Bool=null;\n public var swapped:ZPP_CbSet->ZPP_CbSet->Void=null;\n public var data:ZPP_CbSet=null;\n public var prev:ZPP_Set_ZPP_CbSet=null;\n public var next:ZPP_Set_ZPP_CbSet=null;\n public var parent:ZPP_Set_ZPP_CbSet=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_CbSet){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_CbSet){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_CbSet){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_CbSet){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_CbSet){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_CbSet){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSet\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT++;\n ZPP_Set_ZPP_CbSet.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_CbSet->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_CbSet,lambda:ZPP_CbSet->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSet\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT++;\n ZPP_Set_ZPP_CbSet.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_CbSet){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_CbSet){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_CbSet,n2:ZPP_Set_ZPP_CbSet,n3:ZPP_Set_ZPP_CbSet,t1:ZPP_Set_ZPP_CbSet,t2:ZPP_Set_ZPP_CbSet,t3:ZPP_Set_ZPP_CbSet,t4:ZPP_Set_ZPP_CbSet;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_CbSet){\n var x:ZPP_Set_ZPP_CbSet=null;\n var cur:ZPP_Set_ZPP_CbSet=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_CbSet){\n var x:ZPP_Set_ZPP_CbSet=null;\n var cur:ZPP_Set_ZPP_CbSet=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n","package nape;\n/**\n * Configuration parameters for Nape\n */\n@:final class Config{\n /**\n * @private\n */\n function new(){}\n /**\n * Generic epsilon value for float comparisons\n *

\n * @default 1e-8\n */\n public static var epsilon:Float=1e-8;\n /**\n * Parameter used in computing shape fluid angular drag coeffecient.\n *

\n * Defines the contribution to the drag coeffecient due to Material dynamicFriction\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has units kg/px\n * @default 2.5 kg/px\n */\n public static var fluidAngularDragFriction:Float=2.5;\n /**\n * Parameter used in computing shape fluid angular drag coeffecient.\n *

\n * Defines the contribution to the drag coeffecient due to shape's surface\n * area rotating into a fluid.\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has units kg/px\n * @default 100kg/px\n */\n public static var fluidAngularDrag:Float=100;\n /**\n * Parameter used in computing fluid drags.\n *

\n * Defines an added weight for scaling the contribution of forward drag due\n * to leaving a vaccuum behind the shape pulling it back.\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has no units.\n * @default 0.5\n */\n public static var fluidVacuumDrag:Float=0.5;\n /**\n * Parameter used in computing shapes linear drag in fluid.\n *

\n * Used in determining the amount of linear drag for the shape based on forward profile.\n *

\n * This parameter has units kg/px\n * @default 0.5kg/px\n */\n public static var fluidLinearDrag:Float=0.5;\n /**\n * Amount of overlap permitted between Shapes for collisions.\n *

\n * This parameter has units of pixels.\n * @default 0.2px\n */\n public static var collisionSlop:Float=0.2;\n /**\n * Amount of overlap permitted between Shapes before CCD kicks in.\n *

\n * This parameter has units of pixels, and should always be larger\n * than collisionSlop parameter.\n * @default 0.5px\n */\n public static var collisionSlopCCD:Float=0.5;\n /**\n * Biased distance treshold for CCD collisions.\n *

\n * In CCD collision routines, two Shapes will be considered intersecting\n * when the distance between them + collisionSlopCCD falls below this\n * value.\n *

\n * This parameter has units of pixels, and should always be > 0\n * @default 0.05px\n */\n public static var distanceThresholdCCD:Float=0.05;\n /**\n * Linear sweep threshold-ratio for static CCD collisions\n *

\n * In deciding what non-bullet objects should be collided continuously against\n * static/kinematic objects, the linear speed of the body is considered.\n * \n * ccdCollide if: bodyLinearSpeed * deltaTime > threshold * bodyRadius\n * \n * Intuitively, a value of 0.5 would mean that a body, in the worst case scenario\n * will be permitted to move half of its width in a single time step, before CCD\n * is enabled for this reason.\n *

\n * This parameter has no units.\n * @default 0.05\n */\n public static var staticCCDLinearThreshold:Float=0.05;\n /**\n * Angular sweep threshold for static CCD collisions\n *

\n * In deciding what non-bullet objects should be collided continuously against\n * static/kinematic objects, the angular speed of the body is considered.\n * \n * ccdCollide if: bodyAngularSpeed * deltaTime > threshold\n * \n * Intuitively, a value of 0.5 would mean that a body would have to rotate more than\n * 0.5 radians in a single time step, before CCD is enabled for this reason. Noting that\n * at 60fps physics, the body would need an angularVel greater than 30rad/s for this\n * limit of 0.5 to be reached; the default is far smaller.\n *

\n * This parameter has units of rad.\n * @default 0.005rad\n */\n public static var staticCCDAngularThreshold:Float=0.005;\n /**\n * Linear sweep threshold-ratio for bullet CCD collisions\n *

\n * A dynamic body marked as a bullet, will not necessarigly always be collided\n * with continuously.\n *

\n * Should a body be moving, or rotating fast enough to pass the tests determined\n * by staticCCD#Threshold parameters, and is marked as a bullet, it must then\n * have its velocities checked against the equivalent bullet thresholds to actually\n * be collided continuously against other dynamic bodies too.\n *

\n * This parameter has no units.\n * @default 0.125\n */\n public static var bulletCCDLinearThreshold:Float=0.125;\n /**\n * Angular sweep threshold for bullet CCD collisions.\n *

\n * See description of bulletCCDLinearThreshold.\n *

\n * This parameter has units of rad.\n * @default 0.0125rad\n */\n public static var bulletCCDAngularThreshold:Float=0.0125;\n /**\n * Relative linear threshold for dynamic-dynamic sweeps.\n *

\n * When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,\n * should the relative velocity of the bodies fall beneath this magnitude, they\n * may be considered (based on angular velocities also) to be moving together, and\n * this specific CCD test will be skipped.\n *

\n * This parameter has units of px/s\n * @default 17px/s\n */\n public static var dynamicSweepLinearThreshold:Float=17;\n /**\n * Relative angular bias threshold for dynamic-dynamic sweeps.\n *

\n * When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,\n * should the relative angular velocity (weighted by the shape bias values) fall\n * beneath this magnitude, they may be considered (based on linear velocities also) to\n * be moving together, and this specific CCD test will be skipped.\n *

\n * The shape bias, is an internal value which indicates the 'amount of radius' of\n * a shape about the centre of rotation that can be considered to change under rotations.\n * eg: A circle at origin has a bias of 0 (Its rotation has no effect on sweeps)\n * whilst A circle far from the origin may have a large bias.\n *

\n * This parameter has units of px.rad/s\n * @default 0.6px.rad/s\n */\n public static var dynamicSweepAngularThreshold:Float=0.6;\n /**\n * Angular velocity scaling during CCD slips.\n *

\n * In rare cases, a Body can be moving in such a way that we fail to compute a perfect\n * time of impact; generally when a thin box-like object is rotating very quickly. The\n * time of impact solver in Nape attempts to avoid impacts which are seperating; so that\n * we can catch true impact times; but in a 'slip' case we are unable to achieve this and\n * to avoid a possible tunneling from the other side during later operations we will in\n * these rare cases scale down the angular velocity of a Body by this parameter.\n *

\n * This parameter has no units.\n * @default 0.75\n */\n public static var angularCCDSlipScale:Float=0.75;\n /**\n * Expiration delay length for collision arbiter destruction.\n *

\n * In unstable physics conditions, two colliding shapes may jitter such as to constantly\n * seperate, and then come back together again. This parameter controls the number of time\n * steps during which we will delay this destruction so that cached impulse values may\n * persist and improve stability of strenuous simulations.\n *

\n * This parameter has units of 'steps' I suppose.\n * @default 6steps\n */\n public static var arbiterExpirationDelay:Int=6;\n /**\n * Contact velocity threshold for static-dynamic friction\n *

\n * This is the threshold on projected contact velocities at which Nape will use\n * dynamic friction Mateiral values, in place of static friction Material values.\n *

\n * This parameter has units of px/s\n * @default 2px/s\n */\n public static var staticFrictionThreshold:Float=2;\n /**\n * Contact velocity threshold for elastic collisions\n *

\n * This is the threshold on weighted projected normal-contact velocities at which Nape will\n * decide to stop using elastic collisions. Nape will take the normal velocities at contact\n * and scale by the combined elasticity coeffecient for the Arbiter, if this value falls\n * below the threshold, then elasticity is ignored for stability in stacking.\n *

\n * This parameter has units of px/s\n * @default 20px/s\n */\n public static var elasticThreshold:Float=20;\n /**\n * Sleep delay for stationary bodies.\n *

\n * By default, Nape considers a body to be stationary even if it has a very small linear\n * or angular velocity. This parameter controls how many steps such a Body will continue\n * to be simulated for, before being put to sleep (Assuming everything else in the island\n * is also stationary for a sufficiently long time).\n *

\n * This parameter has units of 'steps' I suppose.\n * @default 60steps\n */\n public static var sleepDelay:Int=60;\n /**\n * Linear speed threshold for sleeping of Bodies.\n *

\n * A body in Nape will be considered stationary only if its linear velocity has magnitude\n * under this threshold.\n *

\n * This parameter has units of px/s\n * @default 0.2px/s\n */\n public static var linearSleepThreshold:Float=0.2;\n /**\n * Angular speed threshold for sleeping of Bodies.\n *

\n * A body in Nape will be considered stationary only if its angular velocity, multiplied\n * by the body radius (never under-estimated) about the origin, falls below this threshold.\n *

\n * The body radius scaling, ensures that a very large body needs to be rotating more slowly\n * to be considered stationary than a very small body. Intuitively we're designating this\n * a threshold on the maximum tangentenial velocity of the body due to rotation.\n *

\n * This parameter has units of px.rad/s\n * @default 0.4px.rad/s\n */\n public static var angularSleepThreshold:Float=0.4;\n /**\n * Fraction of contact slop resolved per-step for dynamic-dynamic discrete collisions.\n *

\n * This value determines, in the case of two non-continuously colliding dynamic objects\n * the fraction of the contact overlap that will attempt to be resolved during positional\n * iterations.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.3/step\n */\n public static var contactBiasCoef:Float=0.3;\n /**\n * Fraction of contact slop resolved per-step for static/kinematic discrete collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for non-continuous collisions\n * between a dynamic, and a static or kinematic object.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.6/step\n */\n public static var contactStaticBiasCoef:Float=0.6;\n /**\n * Fraction of contact slop resolved per-step for dynamic-dynamic continuous collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for continuous collisions\n * between two dynamic bodies.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.4/step\n */\n public static var contactContinuousBiasCoef:Float=0.4;\n /**\n * Fraction of contact slop resolved per-step for static/kinematic continuous collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for continuous collisions\n * between a dynamic, and a static or kinematic object.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.5/step\n */\n public static var contactContinuousStaticBiasCoef:Float=0.5;\n /**\n * Amount of linear slop permitted in constraints.\n *

\n * A constraint will be considered to be 'relaxed' during positional iterations\n * only if the linear error falls below this threshold.\n *

\n * Assuming a 'sensible' constraint, this has units of px\n * @default 0.1px\n */\n public static var constraintLinearSlop:Float=0.1;\n /**\n * Amount of angular slop permitted in constraints.\n *

\n * A constraint will be considered to be 'relaxed' during positional iterations\n * only if the angular error falls below this threshold.\n *

\n * Assuming a 'sensible' constraint, this has units of rad\n * @default 1e-3rad\n */\n public static var constraintAngularSlop:Float=1e-3;\n /**\n * Ill-conditioned threshold for 2-contact collision constraints.\n *

\n * This is a threshold on the measure of ill-conditioning of the effective-mass-matrix\n * in a 2-contact collision at which the contact manifold will be forced into a 1-contact\n * constraint. This can occur quite readily when two contact points are almost exactly equal\n * or in certain other conditions where the mathematics quite simply breaks down when using\n * a block solver.\n *

\n * This parameter has no units.\n * @default 2e+8\n */\n public static var illConditionedThreshold:Float=2e+8;\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport zpp_nape.util.Math;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.Ray;\nimport nape.geom.GeomPoly;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.shape.ValidationResult;\nimport nape.geom.Geom;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.CollisionArbiter;\nimport nape.dynamics.ArbiterType;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Flags{\n public static var internal:Bool=false;\n \n public static var id_ImmState_ACCEPT=1;\n public static var id_ImmState_IGNORE=2;\n public static var id_ImmState_ALWAYS=4;\n public static var id_GravMassMode_DEFAULT=0;\n public static var id_GravMassMode_FIXED=1;\n public static var id_GravMassMode_SCALED=2;\n public static var id_InertiaMode_DEFAULT=0;\n public static var id_InertiaMode_FIXED=1;\n public static var id_MassMode_DEFAULT=0;\n public static var id_MassMode_FIXED=1;\n public static var id_BodyType_STATIC=1;\n public static var id_BodyType_DYNAMIC=2;\n public static var id_BodyType_KINEMATIC=3;\n public static var id_ListenerType_BODY=0;\n public static var id_ListenerType_CONSTRAINT=1;\n public static var id_PreFlag_ACCEPT=1;\n public static var id_ListenerType_INTERACTION=2;\n public static var id_PreFlag_IGNORE=2;\n public static var id_ListenerType_PRE=3;\n public static var id_PreFlag_ACCEPT_ONCE=3;\n public static var id_PreFlag_IGNORE_ONCE=4;\n public static var id_CbEvent_BEGIN=0;\n public static var id_CbEvent_ONGOING=6;\n public static var id_InteractionType_COLLISION=1;\n public static var id_CbEvent_END=1;\n public static var id_InteractionType_SENSOR=2;\n public static var id_CbEvent_WAKE=2;\n public static var id_InteractionType_FLUID=4;\n public static var id_CbEvent_SLEEP=3;\n public static var id_InteractionType_ANY=7;\n public static var id_CbEvent_BREAK=4;\n public static var id_CbEvent_PRE=5;\n public static var id_Winding_UNDEFINED=0;\n public static var id_Winding_CLOCKWISE=1;\n public static var id_Winding_ANTICLOCKWISE=2;\n public static var id_ValidationResult_VALID=0;\n public static var id_ValidationResult_DEGENERATE=1;\n public static var id_ValidationResult_CONCAVE=2;\n public static var id_ValidationResult_SELF_INTERSECTING=3;\n public static var id_ShapeType_CIRCLE=0;\n public static var id_ShapeType_POLYGON=1;\n public static var id_Broadphase_DYNAMIC_AABB_TREE=0;\n public static var id_Broadphase_SWEEP_AND_PRUNE=1;\n public static var id_ArbiterType_COLLISION=1;\n public static var id_ArbiterType_SENSOR=2;\n public static var id_ArbiterType_FLUID=4;\n \n public static var GravMassMode_DEFAULT:GravMassMode;\n public static var GravMassMode_FIXED:GravMassMode;\n public static var GravMassMode_SCALED:GravMassMode;\n public static var InertiaMode_DEFAULT:InertiaMode;\n public static var InertiaMode_FIXED:InertiaMode;\n public static var MassMode_DEFAULT:MassMode;\n public static var MassMode_FIXED:MassMode;\n public static var BodyType_STATIC:BodyType;\n public static var BodyType_DYNAMIC:BodyType;\n public static var BodyType_KINEMATIC:BodyType;\n public static var ListenerType_BODY:ListenerType;\n public static var ListenerType_CONSTRAINT:ListenerType;\n public static var PreFlag_ACCEPT:PreFlag;\n public static var ListenerType_INTERACTION:ListenerType;\n public static var PreFlag_IGNORE:PreFlag;\n public static var ListenerType_PRE:ListenerType;\n public static var PreFlag_ACCEPT_ONCE:PreFlag;\n public static var PreFlag_IGNORE_ONCE:PreFlag;\n public static var CbEvent_BEGIN:CbEvent;\n public static var CbEvent_ONGOING:CbEvent;\n public static var InteractionType_COLLISION:InteractionType;\n public static var CbEvent_END:CbEvent;\n public static var InteractionType_SENSOR:InteractionType;\n public static var CbEvent_WAKE:CbEvent;\n public static var InteractionType_FLUID:InteractionType;\n public static var CbEvent_SLEEP:CbEvent;\n public static var InteractionType_ANY:InteractionType;\n public static var CbEvent_BREAK:CbEvent;\n public static var CbEvent_PRE:CbEvent;\n public static var Winding_UNDEFINED:Winding;\n public static var Winding_CLOCKWISE:Winding;\n public static var Winding_ANTICLOCKWISE:Winding;\n public static var ValidationResult_VALID:ValidationResult;\n public static var ValidationResult_DEGENERATE:ValidationResult;\n public static var ValidationResult_CONCAVE:ValidationResult;\n public static var ValidationResult_SELF_INTERSECTING:ValidationResult;\n public static var ShapeType_CIRCLE:ShapeType;\n public static var ShapeType_POLYGON:ShapeType;\n public static var Broadphase_DYNAMIC_AABB_TREE:Broadphase;\n public static var Broadphase_SWEEP_AND_PRUNE:Broadphase;\n public static var ArbiterType_COLLISION:ArbiterType;\n public static var ArbiterType_SENSOR:ArbiterType;\n public static var ArbiterType_FLUID:ArbiterType;\n}\n"], +"sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/usr/local/lib/haxe/std/haxe/Timer.hx","/usr/local/lib/haxe/std/js/Boot.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/Callback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/BodyCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/Listener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/BodyListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/CbEvent.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/CbType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/CbTypeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/CbTypeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/ConstraintCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/ConstraintListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/InteractionCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/InteractionListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/InteractionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/ListenerIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/ListenerList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/ListenerType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/OptionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/PreCallback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/PreFlag.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/callbacks/PreListener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/constraint/Constraint.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/constraint/ConstraintIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/constraint/ConstraintList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/Arbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/ArbiterIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/ArbiterList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/ArbiterType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/CollisionArbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/Contact.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/ContactIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/ContactList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/FluidArbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/InteractionFilter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/InteractionGroup.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/InteractionGroupIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/dynamics/InteractionGroupList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/AABB.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/ConvexResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/ConvexResultIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/ConvexResultList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/GeomPoly.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/GeomPolyIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/GeomPolyList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Mat23.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/MatMN.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/RayResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/RayResultIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/RayResultList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Vec2.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Vec2Iterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Vec2List.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Vec3.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/geom/Winding.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/Interactor.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/Body.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/BodyIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/BodyList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/BodyType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/Compound.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/CompoundIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/CompoundList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/FluidProperties.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/GravMassMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/InertiaMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/InteractorIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/InteractorList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/MassMode.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/phys/Material.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/Shape.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/Circle.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/Edge.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/EdgeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/EdgeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/Polygon.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/ShapeIterator.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/ShapeList.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/ShapeType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/shape/ValidationResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/space/Broadphase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/space/Space.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/nape/Main.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/ID.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/Callback.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/CbSet.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/CbSetPair.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/util/Lists.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/CbType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/Listener.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/callbacks/OptionType.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/constraint/Constraint.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/dynamics/Arbiter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/dynamics/Contact.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/dynamics/InteractionFilter.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/dynamics/InteractionGroup.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/AABB.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/Collide.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/ConvexRayResult.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/GeomPoly.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/Mat23.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/MatMN.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/SweepDistance.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/Vec2.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/Vec3.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/geom/VecMath.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/phys/Interactor.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/phys/Body.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/phys/Compound.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/phys/FluidProperties.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/phys/Material.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/shape/Shape.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/shape/Circle.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/shape/Edge.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/shape/Polygon.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/space/Broadphase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/space/DynAABBPhase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/space/Space.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/space/SweepPhase.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/util/Math.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/util/RBTree.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/nape/Config.hx","/projects/pixi-haxe/.haxelib/nape/2,0,20/zpp_nape/util/Flags.hx"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2013 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage haxe;\n\n/**\n\tThe Timer class allows you to create asynchronous timers on platforms that\n\tsupport events.\n\n\tThe intended usage is to create an instance of the Timer class with a given\n\tinterval, set its run() method to a custom function to be invoked and\n\teventually call stop() to stop the Timer.\n\n\tNote that a running Timer may or may not prevent the program to exit\n\tautomatically when main() returns.\n\n\tIt is also possible to extend this class and override its run() method in\n\tthe child class.\n**/\nclass Timer {\n\t#if (flash || js || java || python)\n\n\t#if (flash || js)\n\t\tprivate var id : Null;\n\t#elseif java\n\t\tprivate var timer : java.util.Timer;\n\t\tprivate var task : java.util.TimerTask;\n\t#end\n\n\t/**\n\t\tCreates a new timer that will run every `time_ms` milliseconds.\n\n\t\tAfter creating the Timer instance, it calls `this].run` repeatedly,\n\t\twith delays of `time_ms` milliseconds, until `this.stop` is called.\n\n\t\tThe first invocation occurs after `time_ms` milliseconds, not\n\t\timmediately.\n\n\t\tThe accuracy of this may be platform-dependent.\n\t**/\n\tpublic function new( time_ms : Int ){\n\t\t#if flash\n\t\t\tvar me = this;\n\t\t\tid = untyped __global__[\"flash.utils.setInterval\"](function() { me.run(); },time_ms);\n\t\t#elseif js\n\t\t\tvar me = this;\n\t\t\tid = untyped setInterval(function() me.run(),time_ms);\n\t\t#elseif java\n\t\t\ttimer = new java.util.Timer();\n\t\t\ttimer.scheduleAtFixedRate(task = new TimerTask(this), haxe.Int64.ofInt(time_ms), haxe.Int64.ofInt(time_ms));\n\t\t#end\n\t}\n\n\t/**\n\t\tStops `this` Timer.\n\n\t\tAfter calling this method, no additional invocations of `this.run`\n\t\twill occur.\n\n\t\tIt is not possible to restart `this` Timer once stopped.\n\t**/\n\tpublic function stop() {\n\t\t#if (flash || js)\n\t\t\tif( id == null )\n\t\t\t\treturn;\n\t\t\t#if flash\n\t\t\t\tuntyped __global__[\"flash.utils.clearInterval\"](id);\n\t\t\t#elseif js\n\t\t\t\tuntyped clearInterval(id);\n\t\t\t#end\n\t\t\tid = null;\n\t\t#elseif java\n\t\t\ttimer.cancel();\n\t\t\ttimer = null;\n\t\t\ttask = null;\n\t\t#end\n\t}\n\n\t/**\n\t\tThis method is invoked repeatedly on `this` Timer.\n\n\t\tIt can be overridden in a subclass, or rebound directly to a custom\n\t\tfunction:\n\t\t\tvar timer = new haxe.Timer(1000); // 1000ms delay\n\t\t\ttimer.run = function() { ... }\n\n\t\tOnce bound, it can still be rebound to different functions until `this`\n\t\tTimer is stopped through a call to `this.stop`.\n\t**/\n\tpublic dynamic function run() {\n\n\t}\n\n\t/**\n\t\tInvokes `f` after `time_ms` milliseconds.\n\n\t\tThis is a convenience function for creating a new Timer instance with\n\t\t`time_ms` as argument, binding its run() method to `f` and then stopping\n\t\t`this` Timer upon the first invocation.\n\n\t\tIf `f` is null, the result is unspecified.\n\t**/\n\tpublic static function delay( f : Void -> Void, time_ms : Int ) {\n\t\tvar t = new haxe.Timer(time_ms);\n\t\tt.run = function() {\n\t\t\tt.stop();\n\t\t\tf();\n\t\t};\n\t\treturn t;\n\t}\n\n\t#end\n\n\t/**\n\t\tMeasures the time it takes to execute `f`, in seconds with fractions.\n\n\t\tThis is a convenience function for calculating the difference between\n\t\tTimer.stamp() before and after the invocation of `f`.\n\n\t\tThe difference is passed as argument to Log.trace(), with \"s\" appended\n\t\tto denote the unit. The optional `pos` argument is passed through.\n\n\t\tIf `f` is null, the result is unspecified.\n\t**/\n\tpublic static function measure( f : Void -> T, ?pos : PosInfos ) : T {\n\t\tvar t0 = stamp();\n\t\tvar r = f();\n\t\tLog.trace((stamp() - t0) + \"s\", pos);\n\t\treturn r;\n\t}\n\n\t/**\n\t\tReturns a timestamp, in seconds with fractions.\n\n\t\tThe value itself might differ depending on platforms, only differences\n\t\tbetween two values make sense.\n\t**/\n\tpublic static function stamp() : Float {\n\t\t#if flash\n\t\t\treturn flash.Lib.getTimer() / 1000;\n\t\t#elseif (neko || php)\n\t\t\treturn Sys.time();\n\t\t#elseif js\n\t\t\treturn Date.now().getTime() / 1000;\n\t\t#elseif cpp\n\t\t\treturn untyped __global__.__time_stamp();\n\t\t#elseif sys\n\t\t\treturn Sys.time();\n\t\t#else\n\t\t\treturn 0;\n\t\t#end\n\t}\n\n}\n\n#if java\n@:nativeGen\nprivate class TimerTask extends java.util.TimerTask {\n\tvar timer:Timer;\n\tpublic function new(timer:Timer):Void {\n\t\tsuper();\n\t\tthis.timer = timer;\n\t}\n\n\t@:overload override public function run():Void {\n\t\ttimer.run();\n\t}\n}\n#end\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\npackage js;\n\nprivate class HaxeError extends js.Error {\n\n\tvar val:Dynamic;\n\n\tpublic function new(val:Dynamic) untyped {\n\t\tsuper();\n\t\tthis.val = __define_feature__(\"js.Boot.HaxeError\", val);\n\t\tthis.message = String(val);\n\t\tif (js.Error.captureStackTrace) js.Error.captureStackTrace(this, HaxeError);\n\t}\n}\n\n@:dox(hide)\nclass Boot {\n\n\tprivate static function __unhtml(s : String) {\n\t\treturn s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t}\n\n\tprivate static function __trace(v,i : haxe.PosInfos) {\n\t\tuntyped {\n\t\t\tvar msg = if( i != null ) i.fileName+\":\"+i.lineNumber+\": \" else \"\";\n\t\t\t#if jsfl\n\t\t\tmsg += __string_rec(v,\"\");\n\t\t\tfl.trace(msg);\n\t\t\t#else\n\t\t\tmsg += __string_rec(v, \"\");\n\t\t\tif( i != null && i.customParams != null )\n\t\t\t\tfor( v in i.customParams )\n\t\t\t\t\tmsg += \",\" + __string_rec(v, \"\");\n\t\t\tvar d;\n\t\t\tif( __js__(\"typeof\")(document) != \"undefined\" && (d = document.getElementById(\"haxe:trace\")) != null )\n\t\t\t\td.innerHTML += __unhtml(msg)+\"
\";\n\t\t\telse if( __js__(\"typeof console\") != \"undefined\" && __js__(\"console\").log != null )\n\t\t\t\t__js__(\"console\").log(msg);\n\t\t\t#end\n\t\t}\n\t}\n\n\tprivate static function __clear_trace() {\n\t\tuntyped {\n\t\t\t#if jsfl\n\t\t\tfl.outputPanel.clear();\n\t\t\t#else\n\t\t\tvar d = document.getElementById(\"haxe:trace\");\n\t\t\tif( d != null )\n\t\t\t\td.innerHTML = \"\";\n\t\t\t#end\n\t\t}\n\t}\n\n\tstatic inline function isClass(o:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isClass\", o.__name__);\n\t}\n\n\tstatic inline function isEnum(e:Dynamic) : Bool {\n\t\treturn untyped __define_feature__(\"js.Boot.isEnum\", e.__ename__);\n\t}\n\n\tstatic function getClass(o:Dynamic) : Dynamic {\n\t\tif (Std.is(o, Array))\n\t\t\treturn Array;\n\t\telse {\n\t\t\tvar cl = untyped __define_feature__(\"js.Boot.getClass\", o.__class__);\n\t\t\tif (cl != null)\n\t\t\t\treturn cl;\n\t\t\tvar name = __nativeClassName(o);\n\t\t\tif (name != null)\n\t\t\t\treturn __resolveNativeClass(name);\n\t\t\treturn null;\n\t\t}\n\t}\n\n\t@:ifFeature(\"has_enum\")\n\tprivate static function __string_rec(o,s:String) {\n\t\tuntyped {\n\t\t\tif( o == null )\n\t\t\t return \"null\";\n\t\t\tif( s.length >= 5 )\n\t\t\t\treturn \"<...>\"; // too much deep recursion\n\t\t\tvar t = __js__(\"typeof(o)\");\n\t\t\tif( t == \"function\" && (isClass(o) || isEnum(o)) )\n\t\t\t\tt = \"object\";\n\t\t\tswitch( t ) {\n\t\t\tcase \"object\":\n\t\t\t\tif( __js__(\"o instanceof Array\") ) {\n\t\t\t\t\tif( o.__enum__ ) {\n\t\t\t\t\t\tif( o.length == 2 )\n\t\t\t\t\t\t\treturn o[0];\n\t\t\t\t\t\tvar str = o[0]+\"(\";\n\t\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\t\tfor( i in 2...o.length ) {\n\t\t\t\t\t\t\tif( i != 2 )\n\t\t\t\t\t\t\t\tstr += \",\" + __string_rec(o[i],s);\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tstr += __string_rec(o[i],s);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn str + \")\";\n\t\t\t\t\t}\n\t\t\t\t\tvar l = o.length;\n\t\t\t\t\tvar i;\n\t\t\t\t\tvar str = \"[\";\n\t\t\t\t\ts += \"\\t\";\n\t\t\t\t\tfor( i in 0...l )\n\t\t\t\t\t\tstr += (if (i > 0) \",\" else \"\")+__string_rec(o[i],s);\n\t\t\t\t\tstr += \"]\";\n\t\t\t\t\treturn str;\n\t\t\t\t}\n\t\t\t\tvar tostr;\n\t\t\t\ttry {\n\t\t\t\t\ttostr = untyped o.toString;\n\t\t\t\t} catch( e : Dynamic ) {\n\t\t\t\t\t// strange error on IE\n\t\t\t\t\treturn \"???\";\n\t\t\t\t}\n\t\t\t\tif( tostr != null && tostr != __js__(\"Object.toString\") && __typeof__(tostr) == \"function\" ) {\n\t\t\t\t\tvar s2 = o.toString();\n\t\t\t\t\tif( s2 != \"[object Object]\")\n\t\t\t\t\t\treturn s2;\n\t\t\t\t}\n\t\t\t\tvar k : String = null;\n\t\t\t\tvar str = \"{\\n\";\n\t\t\t\ts += \"\\t\";\n\t\t\t\tvar hasp = (o.hasOwnProperty != null);\n\t\t\t\t__js__(\"for( var k in o ) {\");\n\t\t\t\t\tif( hasp && !o.hasOwnProperty(k) )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( k == \"prototype\" || k == \"__class__\" || k == \"__super__\" || k == \"__interfaces__\" || k == \"__properties__\" )\n\t\t\t\t\t\t__js__(\"continue\");\n\t\t\t\t\tif( str.length != 2 )\n\t\t\t\t\t\tstr += \", \\n\";\n\t\t\t\t\tstr += s + k + \" : \"+__string_rec(o[k],s);\n\t\t\t\t__js__(\"}\");\n\t\t\t\ts = s.substring(1);\n\t\t\t\tstr += \"\\n\" + s + \"}\";\n\t\t\t\treturn str;\n\t\t\tcase \"function\":\n\t\t\t\treturn \"\";\n\t\t\tcase \"string\":\n\t\t\t\treturn o;\n\t\t\tdefault:\n\t\t\t\treturn String(o);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate static function __interfLoop(cc : Dynamic,cl : Dynamic) {\n\t\tif( cc == null )\n\t\t\treturn false;\n\t\tif( cc == cl )\n\t\t\treturn true;\n\t\tvar intf : Dynamic = cc.__interfaces__;\n\t\tif( intf != null )\n\t\t\tfor( i in 0...intf.length ) {\n\t\t\t\tvar i : Dynamic = intf[i];\n\t\t\t\tif( i == cl || __interfLoop(i,cl) )\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\treturn __interfLoop(cc.__super__,cl);\n\t}\n\n\t@:ifFeature(\"typed_catch\") private static function __instanceof(o : Dynamic,cl : Dynamic) {\n\t\tif( cl == null )\n\t\t\treturn false;\n\t\tswitch( cl ) {\n\t\tcase Int:\n\t\t\treturn (untyped __js__(\"(o|0) === o\"));\n\t\tcase Float:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"number\";\n\t\tcase Bool:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"boolean\";\n\t\tcase String:\n\t\t\treturn (untyped __js__(\"typeof\"))(o) == \"string\";\n\t\tcase Array:\n\t\t\treturn (untyped __js__(\"(o instanceof Array)\")) && o.__enum__ == null;\n\t\tcase Dynamic:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\tif( o != null ) {\n\t\t\t\t// Check if o is an instance of a Haxe class or a native JS object\n\t\t\t\tif( (untyped __js__(\"typeof\"))(cl) == \"function\" ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t\tif( __interfLoop(getClass(o),cl) )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\telse if ( (untyped __js__(\"typeof\"))(cl) == \"object\" && __isNativeObj(cl) ) {\n\t\t\t\t\tif( untyped __js__(\"o instanceof cl\") )\n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// do not use isClass/isEnum here\n\t\t\tuntyped __feature__(\"Class.*\",if( cl == Class && o.__name__ != null ) return true);\n\t\t\tuntyped __feature__(\"Enum.*\",if( cl == Enum && o.__ename__ != null ) return true);\n\t\t\treturn o.__enum__ == cl;\n\t\t}\n\t}\n\n\t@:ifFeature(\"typed_cast\") private static function __cast(o : Dynamic, t : Dynamic) {\n\t\tif (__instanceof(o, t)) return o;\n\t\telse throw \"Cannot cast \" +Std.string(o) + \" to \" +Std.string(t);\n\t}\n\n\tstatic var __toStr = untyped __js__(\"{}.toString\");\n\t// get native JS [[Class]]\n\tstatic function __nativeClassName(o:Dynamic):String {\n\t\tvar name = untyped __toStr.call(o).slice(8, -1);\n\t\t// exclude general Object and Function\n\t\t// also exclude Math and JSON, because instanceof cannot be called on them\n\t\tif (name == \"Object\" || name == \"Function\" || name == \"Math\" || name == \"JSON\")\n\t\t\treturn null;\n\t\treturn name;\n\t}\n\n\t// check for usable native JS object\n\tstatic function __isNativeObj(o:Dynamic):Bool {\n\t\treturn __nativeClassName(o) != null;\n\t}\n\n\t// resolve native JS class in the global scope:\n\tstatic function __resolveNativeClass(name:String) {\n\t\treturn untyped js.Lib.global[name];\n\t}\n\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for Callback event objects.\n *

\n * Callback objects are automatically reused and you should not keep references\n * to them.\n */\n#if nape_swc@:keep #end\nclass Callback{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Callback=null;\n /**\n * CbEvent type this callback was generated for.\n */\n #if nape_swc@:isVar #end\n public var event(get_event,never):CbEvent;\n inline function get_event():CbEvent{\n return ZPP_Listener.events[zpp_inner.event];\n }\n /**\n * The Listener which was responsive for this callback being generated.\n */\n #if nape_swc@:isVar #end\n public var listener(get_listener,never):Listener;\n inline function get_listener():Listener{\n return zpp_inner.listener.outer;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Callback.internal){\n throw \"Error: Callback cannot be instantiated derp!\";\n }\n #end\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"\";\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Body type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass BodyCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Body involved in callback event.\n */\n #if nape_swc@:isVar #end\n public var body(get_body,never):Body;\n inline function get_body():Body{\n return zpp_inner.body.outer;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"WAKE\",\"SLEEP\"][zpp_inner.event-ZPP_Flags.id_CbEvent_WAKE];\n ret+=\":\"+body.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for all Nape callback listeners.\n */\n#if nape_swc@:keep #end\nclass Listener{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Listener=null;\n /**\n * The sub-type of this listener.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ListenerType;\n inline function get_type():ListenerType{\n return ZPP_Listener.types[zpp_inner.type];\n }\n /**\n * The CbEvent this listener responds to.\n */\n #if nape_swc@:isVar #end\n public var event(get_event,set_event):CbEvent;\n inline function get_event():CbEvent{\n return ZPP_Listener.events[zpp_inner.event];\n }\n inline function set_event(event:CbEvent):CbEvent{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(event==null){\n throw \"Error: Cannot set listener event type to null\";\n }\n #end\n if(this.event!=event){\n var xevent=if(event==CbEvent.BEGIN)ZPP_Flags.id_CbEvent_BEGIN else if(event==CbEvent.ONGOING)ZPP_Flags.id_CbEvent_ONGOING else if(event==CbEvent.END)ZPP_Flags.id_CbEvent_END else if(event==CbEvent.SLEEP)ZPP_Flags.id_CbEvent_SLEEP else if(event==CbEvent.WAKE)ZPP_Flags.id_CbEvent_WAKE else if(event==CbEvent.PRE)ZPP_Flags.id_CbEvent_PRE else ZPP_Flags.id_CbEvent_BREAK;\n zpp_inner.swapEvent(xevent);\n }\n }\n return get_event();\n }\n /**\n * The precedence of this listener.\n *

\n * In any case that there is more than one suitable listener for a situation,\n * the listeners will be ordered by their precedence.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var precedence(get_precedence,set_precedence):Int;\n inline function get_precedence():Int{\n return zpp_inner.precedence;\n }\n inline function set_precedence(precedence:Int):Int{\n {\n if(this.precedence!=precedence){\n zpp_inner.precedence=precedence;\n zpp_inner.invalidate_precedence();\n }\n }\n return get_precedence();\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Listener.internal){\n throw \"Error: Cannot instantiate Listener derp!\";\n }\n #end\n }\n /**\n * The Space this listener is assigned to.\n *

\n * This value can be set, with setting to null being equivalent to removing\n * the listener from whichever Space it is presently assigned to.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n if(this.space!=space){\n if(zpp_inner.space!=null){\n zpp_inner.space.outer.listeners.remove(this);\n }\n if(space!=null){\n space.listeners.add(this);\n }\n else{\n zpp_inner.space=null;\n }\n }\n }\n return get_space();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var event=[\"BEGIN\",\"END\",\"WAKE\",\"SLEEP\",\"BREAK\",\"PRE\",\"ONGOING\"][zpp_inner.event];\n if(zpp_inner.type==ZPP_Flags.id_ListenerType_BODY){\n var body=zpp_inner.body;\n return \"BodyListener{\"+event+\"::\"+body.outer_zn.options+\"}\";\n }\n else if(zpp_inner.type==ZPP_Flags.id_ListenerType_CONSTRAINT){\n var con=zpp_inner.constraint;\n return \"ConstraintListener{\"+event+\"::\"+con.outer_zn.options+\"}\";\n }\n else{\n var con=zpp_inner.interaction;\n var itype=switch(con.itype){\n case ZPP_Flags.id_InteractionType_COLLISION:\"COLLISION\";\n case ZPP_Flags.id_InteractionType_SENSOR:\"SENSOR\";\n case ZPP_Flags.id_InteractionType_FLUID:\"FLUID\";\n default:\"ALL\";\n }\n return(if(zpp_inner.type==ZPP_Flags.id_ListenerType_INTERACTION)\"InteractionListener{\"+event+\"#\"+itype+\"::\"+con.outer_zni.options1+\":\"+con.outer_zni.options2+\"}\" else \"PreListener{\"+itype+\"::\"+con.outer_znp.options1+\":\"+con.outer_znp.options2+\"}\")+\" precedence=\"+zpp_inner.precedence;\n }\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Body type events.\n *

\n * The events that can be caught are WAKE and SLEEP type events.\n * Theses listeners will only operate on Bodys, not Interactors in general.\n */\n@:final#if nape_swc@:keep #end\nclass BodyListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_BodyListener=null;\n /**\n * The OptionType used to match against Bodies.\n *

\n * When added to the same Space, any Body who's CbType list matches\n * against this OptionType will be issued a callback when the relevant\n * event occurs.\n */\n #if nape_swc@:isVar #end\n public var options(get_options,set_options):OptionType;\n inline function get_options():OptionType{\n return zpp_inner_zn.options.outer;\n }\n inline function set_options(options:OptionType):OptionType{\n {\n zpp_inner_zn.options.set(options.zpp_inner);\n }\n return get_options();\n }\n /**\n * The callback handler for this listener.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):BodyCallback->Void;\n inline function get_handler():BodyCallback->Void{\n return zpp_inner_zn.handler;\n }\n inline function set_handler(handler:BodyCallback->Void):BodyCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: BodyListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handler=handler;\n }\n return get_handler();\n }\n /**\n * Construct a new BodyListener.\n *

\n * The possible event types are WAKE and SLEEP.\n *

\n * The options argument is typed Dynamic, and is permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param options The OptionType to match Bodys against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @return The newly constructed BodyListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If options is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,options:Null,handler:BodyCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: BodyListener::handler cannot be null\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.WAKE)xevent=ZPP_Flags.id_CbEvent_WAKE;\n else if(event==CbEvent.SLEEP)xevent=ZPP_Flags.id_CbEvent_SLEEP;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: cbEvent '\"+event.toString()+\"' is not a valid event type for a BodyListener\";\n #end\n }\n zpp_inner_zn=new ZPP_BodyListener(ZPP_OptionType.argument(options),xevent,handler);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner.precedence=precedence;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of possible callback event types.\n */\n@:final#if nape_swc@:keep #end\nclass CbEvent{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"CbEvent\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==PRE)return\"PRE\";\n else if(this==BEGIN)return\"BEGIN\";\n else if(this==ONGOING)return\"ONGOING\";\n else if(this==END)return\"END\";\n else if(this==WAKE)return\"WAKE\";\n else if(this==SLEEP)return\"SLEEP\";\n else if(this==BREAK)return\"BREAK\";\n else return \"\";\n }\n /**\n * BEGIN event corresponds to the start of an interaction\n */\n #if nape_swc@:isVar #end\n public static var BEGIN(get_BEGIN,never):CbEvent;\n inline static function get_BEGIN(){\n if(ZPP_Flags.CbEvent_BEGIN==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_BEGIN=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_BEGIN;\n }\n /**\n * ONGOING event corresponds to any step in which an interaction is occuring\n * overlapping with the BEGIN event.\n */\n #if nape_swc@:isVar #end\n public static var ONGOING(get_ONGOING,never):CbEvent;\n inline static function get_ONGOING(){\n if(ZPP_Flags.CbEvent_ONGOING==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_ONGOING=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_ONGOING;\n }\n /**\n * END event corresponds to the end of an interaction.\n */\n #if nape_swc@:isVar #end\n public static var END(get_END,never):CbEvent;\n inline static function get_END(){\n if(ZPP_Flags.CbEvent_END==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_END=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_END;\n }\n /**\n * WAKE event corresponds to the waking of a Body or Constraint in the space.\n */\n #if nape_swc@:isVar #end\n public static var WAKE(get_WAKE,never):CbEvent;\n inline static function get_WAKE(){\n if(ZPP_Flags.CbEvent_WAKE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_WAKE=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_WAKE;\n }\n /**\n * SLEEP event corresponds to the sleeping of a Body or Constraint in the space.\n */\n #if nape_swc@:isVar #end\n public static var SLEEP(get_SLEEP,never):CbEvent;\n inline static function get_SLEEP(){\n if(ZPP_Flags.CbEvent_SLEEP==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_SLEEP=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_SLEEP;\n }\n /**\n * BREAK event corresponds to the breaking of a defined limit on a Constraint.\n */\n #if nape_swc@:isVar #end\n public static var BREAK(get_BREAK,never):CbEvent;\n inline static function get_BREAK(){\n if(ZPP_Flags.CbEvent_BREAK==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_BREAK=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_BREAK;\n }\n /**\n * PRE event corresponds to a special mid-step event that occurs after it is determined\n * that two objects 'will' begin to interact, but before any interaction commences.\n */\n #if nape_swc@:isVar #end\n public static var PRE(get_PRE,never):CbEvent;\n inline static function get_PRE(){\n if(ZPP_Flags.CbEvent_PRE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.CbEvent_PRE=new CbEvent();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.CbEvent_PRE;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback Type applied to Interactors and Constraints.\n *

\n * Callback types are ranged over by listeners.\n */\n@:final#if nape_swc@:keep #end\nclass CbType{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CbType=null;\n /**\n * Unique identifier for this CbType.\n */\n #if nape_swc@:isVar #end\n public var id(get_id,never):Int;\n inline function get_id():Int{\n return zpp_inner.id;\n }\n /**\n * Construct a new CbType object.\n *\n * @return A new CbType.\n */\n public function new(){\n zpp_inner=new ZPP_CbType();\n zpp_inner.outer=this;\n }\n \n /**\n * Default CbType given to all Bodys\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Bodys\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_BODY(get_ANY_BODY,never):CbType;\n inline static function get_ANY_BODY():CbType{\n return ZPP_CbType.ANY_BODY;\n }\n /**\n * Default CbType given to all Constraints\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Constraints\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_CONSTRAINT(get_ANY_CONSTRAINT,never):CbType;\n inline static function get_ANY_CONSTRAINT():CbType{\n return ZPP_CbType.ANY_CONSTRAINT;\n }\n /**\n * Default CbType given to all Shapes\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Shapes\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_SHAPE(get_ANY_SHAPE,never):CbType;\n inline static function get_ANY_SHAPE():CbType{\n return ZPP_CbType.ANY_SHAPE;\n }\n /**\n * Default CbType given to all Compounds\n *\n * Due to the way the Callback system in Nape works, you can use this\n * CbType to match against 'all'\n * Compounds\n * In a Listener (Assuming you do not 'remove' this type from the object)\n */\n #if nape_swc@:isVar #end\n public static var ANY_COMPOUND(get_ANY_COMPOUND,never):CbType;\n inline static function get_ANY_COMPOUND():CbType{\n return ZPP_CbType.ANY_COMPOUND;\n }\n /**\n * Construct OptionType with given extra includes.\n *

\n * Equivalent to new OptionType(this).including(includes)\n *

\n * The includes argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n *\n * @param includes The CbTypes to include.\n * @return A new OptionType whose includes are equal to this CbType\n * and all the CbTypes given as argument.\n * @throws # If includes is null.\n */\n public function including(includes:Dynamic):OptionType{\n return(new OptionType(this)).including(includes);\n }\n /**\n * Construct OptionType with given excludes.\n *

\n * Equivalent to new OptionType(this).excluding(excludes)\n *

\n * The excludes argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n *\n * @param excludes The CbTypes to exclude.\n * @return A new OptionType whose included types are just 'this' and whose\n * excluded types are those given as argument.\n * @throws # If excludes is null.\n */\n public function excluding(excludes:Dynamic):OptionType{\n return(new OptionType(this)).excluding(excludes);\n }\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * List of all Interactors using this CbType.\n *

\n * This list contains only those Interactors that are inside of a Space\n *

\n * This list is not only readonly, but also immutable.\n */\n #if nape_swc@:isVar #end\n public var interactors(get_interactors,never):InteractorList;\n inline function get_interactors():InteractorList{\n if(zpp_inner.wrap_interactors==null){\n zpp_inner.wrap_interactors=ZPP_InteractorList.get(zpp_inner.interactors,true);\n }\n return zpp_inner.wrap_interactors;\n }\n /**\n * List of all Constraints using this CbType.\n *

\n * This list contains only those Constraints that are inside of a Space\n *

\n * This list is not only readonly, but also immutable.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n if(zpp_inner.wrap_constraints==null){\n zpp_inner.wrap_constraints=ZPP_ConstraintList.get(zpp_inner.constraints,true);\n }\n return zpp_inner.wrap_constraints;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return if(this==ANY_BODY)\"ANY_BODY\";\n else if(this==ANY_SHAPE)\"ANY_SHAPE\";\n else if(this==ANY_COMPOUND)\"ANY_COMPOUND\";\n else if(this==ANY_CONSTRAINT)\"ANY_CONSTRAINT\";\n else \"CbType#\"+id;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CbTypeIterator{\n /**\n * @private\n */\n public var zpp_inner:CbTypeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:CbTypeIterator=null;\n /**\n * @private\n */\n public var zpp_next:CbTypeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_CbTypeList.internal)throw \"Error: Cannot instantiate \"+\"CbType\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:CbTypeList){\n var ret=if(zpp_pool==null){\n ZPP_CbTypeList.internal=true;\n var ret=new CbTypeIterator();\n ZPP_CbTypeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:CbType = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:CbType = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:CbType = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CbTypeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CbTypeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than CbType\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new CbTypeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,CbType)#else Std.is(i,CbType)#end)throw \"Error: Array contains non \"+\"CbType\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new CbTypeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:CbType):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):CbType{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():CbType{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():CbType{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:CbType):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:CbType):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"CbType\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return CbTypeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new CbTypeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"CbType\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:CbTypeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_CbTypeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:CbType->Void):CbTypeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=CbTypeIterator.zpp_pool;\n CbTypeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:CbType->Bool):CbTypeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass ConstraintCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Constraint involved in callback event.\n */\n #if nape_swc@:isVar #end\n public var constraint(get_constraint,never):Constraint;\n inline function get_constraint():Constraint{\n return zpp_inner.constraint.outer;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"WAKE\",\"SLEEP\",\"BREAK\"][zpp_inner.event-ZPP_Flags.id_CbEvent_WAKE];\n ret+=\":\"+constraint.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Constraint type events.\n *

\n * The events that can be caught are WAKE, SLEEP and BREAK type events.\n * Theses listeners will only operate on Constraints.\n */\n@:final#if nape_swc@:keep #end\nclass ConstraintListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_ConstraintListener=null;\n /**\n * The OptionType used to match against Constraints.\n *

\n * When added to the same Space, any Constraint who's CbType list matches\n * against this OptionType will be issued a callback when the relevant\n * event occurs.\n */\n #if nape_swc@:isVar #end\n public var options(get_options,set_options):OptionType;\n inline function get_options():OptionType{\n return zpp_inner_zn.options.outer;\n }\n inline function set_options(options:OptionType):OptionType{\n {\n zpp_inner_zn.options.set(options.zpp_inner);\n }\n return get_options();\n }\n /**\n * The callback handler for this event.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):ConstraintCallback->Void;\n inline function get_handler():ConstraintCallback->Void{\n return zpp_inner_zn.handler;\n }\n inline function set_handler(handler:ConstraintCallback->Void):ConstraintCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: ConstraintListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handler=handler;\n }\n return get_handler();\n }\n /**\n * Construct a new ConstraintListener.\n *

\n * The possible event types are WAKE, SLEEP and BREAK.\n *

\n * The options argument is typed Dynamic, and is permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param options The OptionType to match Constraints against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable ConstraintListener existing for the same\n * event on the same Constraint. (default 0)\n * @return The newly constructed ConstraintListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If options is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,options:Null,handler:ConstraintCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: ConstraintListener::handler cannot be null\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.WAKE)xevent=ZPP_Flags.id_CbEvent_WAKE;\n else if(event==CbEvent.SLEEP)xevent=ZPP_Flags.id_CbEvent_SLEEP;\n else if(event==CbEvent.BREAK)xevent=ZPP_Flags.id_CbEvent_BREAK;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: cbEvent '\"+event.toString()+\"' is not a valid event type for a ConstraintListener\";\n #end\n }\n zpp_inner_zn=new ZPP_ConstraintListener(ZPP_OptionType.argument(options),xevent,handler);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner.precedence=precedence;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Interaction type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * First Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the first\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int1(get_int1,never):Interactor;\n inline function get_int1():Interactor{\n return zpp_inner.int1.outer_i;\n }\n /**\n * Second Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the second\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int2(get_int2,never):Interactor;\n inline function get_int2():Interactor{\n return zpp_inner.int2.outer_i;\n }\n /**\n * Existing arbiters between interactors.\n *

\n * This list will at present contain 'all' arbiters, not just those matching the\n * interactionType in the InteractionListener. (This may be subject to change).\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n return zpp_inner.wrap_arbiters;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:\";\n ret+=[\"BEGIN\",\"END\",\"\",\"\",\"\",\"\",\"ONGOING\"][zpp_inner.event];\n ret+=\":\"+int1.toString()+\"/\"+int2.toString();\n ret+=\" : \"+arbiters.toString();\n ret+=\" : listener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Interaction type events.\n *

\n * Interaction type events can occur between any two Interactors (whether they\n * be Shapes, Bodys, Compounds or a mix thereof).\n *

\n * The events that can be caught are BEGIN, ONGOING, and END type events.\n * Theses listeners will operate between pairs of Interactors.\n *
\n *          _Space\n *         /      \\\n *     Cmp1        Cmp3\n *    /    \\         |\n * Body1  Cmp2     Body3\n *   |      |        |\n * Shp1   Body2    Shp3\n *          |\n *        Shp2\n * 
\n * The possible interactor pairs for callbacks are formed by finding the most\n * recent common ancestor in the world for the given pair of shapes and taking all\n * possible pairings. In the above situation we have:\n *
\n * MRCA(Shp1, Shp2) = Cmp1  --> Possible pairings = [Shp1, Body1] x [Shp2, Body2, Cmp2]\n * MRCA(Shp1, Shp3) = Space --> Possible pairings = [Shp1, Body1, Cmp1] x [Shp3, Body3, Cmp3]\n * MRCA(Shp2, Shp3) = Space --> Possible pairings = [Shp2, Body2, Cmp2, Cmp1] x [Shp3, Body3, Cmp3]\n * 
\n * Of course, not all of these pairings will generate callbacks, only those for which\n * a valid listener exists for the event type, and for the cbtypes of each interactor.\n *

\n * Furthermore, the listener specifies an interaction type which works even in mixed\n * cases where many types of interaction between two objects is happening at once.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_InteractionListener=null;\n /**\n * The OptionType used to match against Interactors for the first object.\n */\n #if nape_swc@:isVar #end\n public var options1(get_options1,set_options1):OptionType;\n inline function get_options1():OptionType{\n return zpp_inner_zn.options1.outer;\n }\n inline function set_options1(options1:OptionType):OptionType{\n {\n zpp_inner_zn.options1.set(options1.zpp_inner);\n }\n return get_options1();\n }\n /**\n * The OptionType used to match against Interactors for the second object.\n */\n #if nape_swc@:isVar #end\n public var options2(get_options2,set_options2):OptionType;\n inline function get_options2():OptionType{\n return zpp_inner_zn.options2.outer;\n }\n inline function set_options2(options2:OptionType):OptionType{\n {\n zpp_inner_zn.options2.set(options2.zpp_inner);\n }\n return get_options2();\n }\n /**\n * The specific type of interaction that is to be listened for.\n *

\n * If we specify that we only want to listen for a fluid type interaction, then\n * this listener will operate so that any other interactions for the same pair\n * of objects is ignored.\n */\n #if nape_swc@:isVar #end\n public var interactionType(get_interactionType,set_interactionType):InteractionType;\n inline function get_interactionType():InteractionType{\n var ret=zpp_inner_zn.itype;\n return if(ret==ZPP_Flags.id_InteractionType_COLLISION)InteractionType.COLLISION;\n else if(ret==ZPP_Flags.id_InteractionType_SENSOR)InteractionType.SENSOR;\n else if(ret==ZPP_Flags.id_InteractionType_FLUID)InteractionType.FLUID;\n else if(ret==ZPP_Flags.id_InteractionType_ANY)InteractionType.ANY;\n else null;\n }\n inline function set_interactionType(interactionType:InteractionType):InteractionType{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(interactionType==null){\n throw \"Error: Cannot set listener interaction type to null\";\n }\n #end\n if(this.interactionType!=interactionType){\n var xtype=if(interactionType==InteractionType.COLLISION)ZPP_Flags.id_InteractionType_COLLISION else if(interactionType==InteractionType.SENSOR)ZPP_Flags.id_InteractionType_SENSOR else if(interactionType==InteractionType.FLUID)ZPP_Flags.id_InteractionType_FLUID else ZPP_Flags.id_InteractionType_ANY;\n zpp_inner_zn.setInteractionType(xtype);\n }\n }\n return get_interactionType();\n }\n /**\n * The callback handler for this listener.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):InteractionCallback->Void;\n inline function get_handler():InteractionCallback->Void{\n return zpp_inner_zn.handleri;\n }\n inline function set_handler(handler:InteractionCallback->Void):InteractionCallback->Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: InteractionListener::handler cannot be null\";\n }\n #end\n zpp_inner_zn.handleri=handler;\n }\n return get_handler();\n }\n /**\n * For ONGOING listeners only, permit ONGOING callbacks whilst sleeping.\n *

\n * This property determines whether we will still receive\n * ONGOING callbacks between two sleeping Interactors. The default action is to\n * inhibit callbacks between sleeping objects for performance. Setting this field to true\n * will permit Nape to always generate callbacks.\n */\n #if nape_swc@:isVar #end\n public var allowSleepingCallbacks(get_allowSleepingCallbacks,set_allowSleepingCallbacks):Bool;\n inline function get_allowSleepingCallbacks():Bool{\n return zpp_inner_zn.allowSleepingCallbacks;\n }\n inline function set_allowSleepingCallbacks(allowSleepingCallbacks:Bool):Bool{\n {\n zpp_inner_zn.allowSleepingCallbacks=allowSleepingCallbacks;\n }\n return get_allowSleepingCallbacks();\n }\n /**\n * Construct a new InteractionListener.\n *

\n * The possible event types are BEGIN, ONGOING and END.\n *

\n * The options arguments are typed Dynamic, and are permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param event The event type to listen for.\n * @param interactionType The interaction type to listen for.\n * @param options1 The OptionType to match first Interactor against, passing null\n * will equate to an empty OptionType.\n * @param options2 The OptionType to match second Interactor against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @return The newly constructed InteractionListener\n * @throws # If handler is null.\n * @throws # If the event type is not permitted for this listener.\n * @throws # If either option is not of the expected Type.\n */\n #if flib@:keep function flibopts_1(){}\n #end\n public function new(event:CbEvent,interactionType:InteractionType,options1:Null,options2:Null,handler:InteractionCallback->Void,precedence:Int=0){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: InteractionListener::handler cannot be null\";\n }\n if(event==null){\n throw \"Error: CbEvent cannot be null for InteractionListener\";\n }\n #end\n var xevent=-1;\n if(event==CbEvent.BEGIN)xevent=ZPP_Flags.id_CbEvent_BEGIN;\n else if(event==CbEvent.END)xevent=ZPP_Flags.id_CbEvent_END;\n else if(event==CbEvent.ONGOING)xevent=ZPP_Flags.id_CbEvent_ONGOING;\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: CbEvent '\"+event.toString()+\"' is not a valid event type for InteractionListener\";\n #end\n }\n zpp_inner_zn=new ZPP_InteractionListener(ZPP_OptionType.argument(options1),ZPP_OptionType.argument(options2),xevent,ZPP_Flags.id_ListenerType_INTERACTION);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_zni=this;\n zpp_inner.precedence=precedence;\n zpp_inner_zn.handleri=handler;\n this.interactionType=interactionType;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of Interaction types.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionType{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"InteractionType\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==COLLISION)return\"COLLISION\";\n else if(this==SENSOR)return\"SENSOR\";\n else if(this==FLUID)return\"FLUID\";\n else if(this==ANY)return\"ANY\";\n else return \"\";\n }\n /**\n * Collision interaction type.\n */\n #if nape_swc@:isVar #end\n public static var COLLISION(get_COLLISION,never):InteractionType;\n inline static function get_COLLISION(){\n if(ZPP_Flags.InteractionType_COLLISION==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_COLLISION=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_COLLISION;\n }\n /**\n * Sensor interaction type.\n \"\"*/#if nape_swc@:isVar #end\n public static var SENSOR(get_SENSOR,never):InteractionType;\n inline static function get_SENSOR(){\n if(ZPP_Flags.InteractionType_SENSOR==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_SENSOR=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_SENSOR;\n }\n /**\n * Fluid interaction type.\n */\n #if nape_swc@:isVar #end\n public static var FLUID(get_FLUID,never):InteractionType;\n inline static function get_FLUID(){\n if(ZPP_Flags.InteractionType_FLUID==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_FLUID=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_FLUID;\n }\n /**\n * Special enum corresponding to 'all' interaction types.\n */\n #if nape_swc@:isVar #end\n public static var ANY(get_ANY,never):InteractionType;\n inline static function get_ANY(){\n if(ZPP_Flags.InteractionType_ANY==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InteractionType_ANY=new InteractionType();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InteractionType_ANY;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ListenerIterator{\n /**\n * @private\n */\n public var zpp_inner:ListenerList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ListenerIterator=null;\n /**\n * @private\n */\n public var zpp_next:ListenerIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ListenerList.internal)throw \"Error: Cannot instantiate \"+\"Listener\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ListenerList){\n var ret=if(zpp_pool==null){\n ZPP_ListenerList.internal=true;\n var ret=new ListenerIterator();\n ZPP_ListenerList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Listener = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Listener = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Listener = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ListenerList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ListenerList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Listener\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ListenerList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Listener)#else Std.is(i,Listener)#end)throw \"Error: Array contains non \"+\"Listener\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ListenerList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Listener):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Listener{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Listener{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Listener{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Listener):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Listener):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Listener\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ListenerIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ListenerList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Listener\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ListenerList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ListenerList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Listener->Void):ListenerList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ListenerIterator.zpp_pool;\n ListenerIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Listener->Bool):ListenerList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * An object's set of CbType's 'matches' against an OptionType iff.\n * the OptionType's includes list intersects the object's set of CbTypes\n * and the OptionType's excludes list 'does not' intersect the object's set\n * of CbTypes.\n *
\n * option = new OptionType([A, B], [C, D]);\n * obj.cbTypes = [] // => does not match option.\n * obj.cbTypes = [A] // => matches the option\n * obj.cbTypes = [A, C] // => does not match option.\n * 
\n * The optionType's includes and excludes list are managed to be always\n * disjoint: The action of including an already excluded type serves to\n * remove it from the excludes list, equalliy excluding an already included\n * type serves to remove it from the includes list.\n *
\n * var option = new OptionType();\n * option.including(A); // option = {[A]:[]}\n * option.excluding(A); // option = {[]:[]}\n * option.excluding(A); // option = {[]:[A]}\n * option.including(A); // option = {[A]:[]}\n * 
\n */\n@:final#if nape_swc@:keep #end\nclass OptionType{\n /**\n * @private\n */\n public var zpp_inner:ZPP_OptionType=null;\n /**\n * List of included CbTypes.\n *

\n * This list is both readonly, and immutable. To remove an element\n * from this list you can use: option.excluding(cbType)\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var includes(get_includes,never):CbTypeList;\n inline function get_includes():CbTypeList{\n if(zpp_inner.wrap_includes==null)zpp_inner.setup_includes();\n return zpp_inner.wrap_includes;\n }\n /**\n * List of excluded CbTypes.\n *

\n * This list is both readonly, and immutable. To remove an element\n * from this list you can use: option.including(cbType)\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var excludes(get_excludes,never):CbTypeList;\n inline function get_excludes():CbTypeList{\n if(zpp_inner.wrap_excludes==null)zpp_inner.setup_excludes();\n return zpp_inner.wrap_excludes;\n }\n /**\n * Construct a new OptionType.\n *

\n * The type of the arguments is Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param includes The set of CbTypes to be included in the matching process.\n * (default null)\n * @param excludes The set of CbTypes to be excluded in the matching process.\n * (default null)\n * @return Return new OptionType with give sets of CbTypes.\n * @throws # If either argument is not of the expected Type.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(includes:Dynamic=null,excludes:Dynamic=null){\n zpp_inner=new ZPP_OptionType();\n zpp_inner.outer=this;\n if(includes!=null)including(includes);\n if(excludes!=null)excluding(excludes);\n }\n /**\n * Append set of types to includes list.\n *

\n * This method was originally named the more appropriate 'include'\n * but this conflicted with the AS3 keyword include and had to be\n * change.\n *

\n * The argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param includes The set of CbTypes to be included. (default null)\n * @return A reference to this OptionType.\n * @throws # If argument is not of the expected Type.\n */\n public function including(includes:Dynamic=null):OptionType{\n zpp_inner.append(zpp_inner.includes,includes);\n return this;\n }\n /**\n * Append set of types to excludes list.\n *

\n * This method was originally named the more appropriate 'exclude'\n * but to match the necessary change for the include function, this was\n * renamed as excluding.\n *

\n * The argument is typed Dynamic, and is permitted to be one of:\n * CbType, CbTypeList, Array<CbType> flash.Vector<CbType>\n *\n * @param excludes The set of CbTypes to be excluded. (default null)\n * @return A reference to this OptionType.\n * @throws # If argument is not of the expected Type.\n */\n public function excluding(excludes:Dynamic=null):OptionType{\n zpp_inner.append(zpp_inner.excludes,excludes);\n return this;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n var inc=includes.toString();\n var exc=excludes.toString();\n return \"@{\"+inc+\" excluding \"+exc+\"}\";\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Callback object for Pre-Interaction type events.\n *

\n * This, like all other callback objects are automatically reused\n * and you should not keep any reference to them.\n */\n@:final#if nape_swc@:keep #end\nclass PreCallback extends Callback{\n /**\n * @private\n */\n public function new(){\n super();\n }\n /**\n * Arbiter related to callback event.\n *

\n * In the case that this pre-event occurs between two non-Shape's\n * then this is the first arbiter to be created for the related\n * interactionType\n */\n #if nape_swc@:isVar #end\n public var arbiter(get_arbiter,never):Arbiter;\n inline function get_arbiter():Arbiter{\n return zpp_inner.pre_arbiter.wrapper();\n }\n /**\n * First Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the first\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int1(get_int1,never):Interactor;\n inline function get_int1():Interactor{\n return zpp_inner.int1.outer_i;\n }\n /**\n * Second Interactor involved in callback event.\n *

\n * This interactor will have CbType set matched by the second\n * OptionType in InteractionListener\n */\n #if nape_swc@:isVar #end\n public var int2(get_int2,never):Interactor;\n inline function get_int2():Interactor{\n return zpp_inner.int2.outer_i;\n }\n /**\n * Describes how Arbiter's objects are related to int1/int2 properties\n *

\n * If true, then arbiter.shape1 will belong to callback.int2, and\n * arbiter.shape2 will belong to callback.int1.\n *

\n * If you take the arbiter's normal, then if swapped is true, the normal\n * will point from int2 towards int1 instead of from int1 towards int2.\n */\n #if nape_swc@:isVar #end\n public var swapped(get_swapped,never):Bool;\n inline function get_swapped():Bool{\n return zpp_inner.pre_swapped;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=\"Cb:PRE:\";\n ret+=\":\"+int1.toString()+\"/\"+int2.toString();\n ret+=\" : \"+arbiter.toString();\n ret+=\" : listnener: \"+listener;\n return ret;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of interaction states for arbiters. These values are returned\n * by PreListener callback handlers.\n */\n@:final#if nape_swc@:keep #end\nclass PreFlag{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"PreFlag\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==ACCEPT)return\"ACCEPT\";\n else if(this==IGNORE)return\"IGNORE\";\n else if(this==ACCEPT_ONCE)return\"ACCEPT_ONCE\";\n else if(this==IGNORE_ONCE)return\"IGNORE_ONCE\";\n else return \"\";\n }\n /**\n * Value denotes interaction will occur, and Nape will not ask again.\n */\n #if nape_swc@:isVar #end\n public static var ACCEPT(get_ACCEPT,never):PreFlag;\n inline static function get_ACCEPT(){\n if(ZPP_Flags.PreFlag_ACCEPT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_ACCEPT=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_ACCEPT;\n }\n /**\n * Value denotes interaction will be ignored, and Nape will not ask again.\n */\n #if nape_swc@:isVar #end\n public static var IGNORE(get_IGNORE,never):PreFlag;\n inline static function get_IGNORE(){\n if(ZPP_Flags.PreFlag_IGNORE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_IGNORE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_IGNORE;\n }\n /**\n * Value denotes interaction will occur 'this' step, and Nape will ask what\n * to do again in the following step if interaction is still possible.\n */\n #if nape_swc@:isVar #end\n public static var ACCEPT_ONCE(get_ACCEPT_ONCE,never):PreFlag;\n inline static function get_ACCEPT_ONCE(){\n if(ZPP_Flags.PreFlag_ACCEPT_ONCE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_ACCEPT_ONCE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_ACCEPT_ONCE;\n }\n /**\n * Value denotes interaction will be ignored 'this' step, and Nape will ask what\n * to do again in the following step if interaction is still possible.\n */\n #if nape_swc@:isVar #end\n public static var IGNORE_ONCE(get_IGNORE_ONCE,never):PreFlag;\n inline static function get_IGNORE_ONCE(){\n if(ZPP_Flags.PreFlag_IGNORE_ONCE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.PreFlag_IGNORE_ONCE=new PreFlag();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.PreFlag_IGNORE_ONCE;\n }\n}\n","package nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Event listener for Pre-Interaction type events.\n *

\n * Pre-Interaction type events can occur between any two Interactors (whether they\n * be Shapes, Bodys, Compounds or a mix thereof).\n */\n@:final#if nape_swc@:keep #end\nclass PreListener extends Listener{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_InteractionListener=null;\n /**\n * The OptionType used to match against Interactors for the first object.\n */\n #if nape_swc@:isVar #end\n public var options1(get_options1,set_options1):OptionType;\n inline function get_options1():OptionType{\n return zpp_inner_zn.options1.outer;\n }\n inline function set_options1(options1:OptionType):OptionType{\n {\n zpp_inner_zn.options1.set(options1.zpp_inner);\n }\n return get_options1();\n }\n /**\n * The OptionType used to match against Interactors for the second object.\n */\n #if nape_swc@:isVar #end\n public var options2(get_options2,set_options2):OptionType;\n inline function get_options2():OptionType{\n return zpp_inner_zn.options2.outer;\n }\n inline function set_options2(options2:OptionType):OptionType{\n {\n zpp_inner_zn.options2.set(options2.zpp_inner);\n }\n return get_options2();\n }\n /**\n * Callback handler for this listener.\n *

\n * This callback handler returns a possibly null PreFlag object.\n *
\n * Passing null is equivalent to telling nape 'ignore me' so that whatever existing\n * decision has been made regarding the interaction is not modified.\n * Otherwise returning a non-null PreFlag will change the current decision about what\n * to do with the interaction.\n *

\n * Returning ACCEPT/IGNORE inform nape to take control over all subsequent interaction\n * between the two objects until they seperate. Returning these will mean that the pre\n * listener will not be invoked again until the objects seperate, and then begin to interact\n * afresh.\n *

\n * Returning #_ONCE, the objects will only be effected for a single step, and the following\n * step should they still be candidates for interaction, this handler will be invoked again.\n *
\n * In the case of a #_ONCE, PreFlag; Nape will 'not' permit the two objects to go to sleep\n * as Nape cannot know if this callback handler will suddenly changes its mind.\n *
\n * If this handler is a 'pure' function, then you may mark it as such and Nape will keep you\n * to your word and permit the objects to sleep.\n */\n #if nape_swc@:isVar #end\n public var handler(get_handler,set_handler):PreCallback->Null;\n inline function get_handler():PreCallback->Null{\n return zpp_inner_zn.handlerp;\n }\n inline function set_handler(handler:PreCallback->Null):PreCallback->Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: PreListener must take a non-null handler!\";\n }\n #end\n zpp_inner_zn.handlerp=handler;\n zpp_inner_zn.wake();\n }\n return get_handler();\n }\n /**\n * Mark this listener as having a pure callback handler.\n *

\n * A pure callback handler is one which under no circumstances will change its behaviour.\n * In such a (favourable) instance, marking the callback as pure will allow Nape to permit\n * objects in interaction to go to sleep even if the handler returns an IGNORE_ONCE/ACCEPT_ONCE\n * PreFlag.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var pure(get_pure,set_pure):Bool;\n inline function get_pure():Bool{\n return zpp_inner_zn.pure;\n }\n inline function set_pure(pure:Bool):Bool{\n {\n if(!pure){\n zpp_inner_zn.wake();\n }\n zpp_inner_zn.pure=pure;\n }\n return get_pure();\n }\n /**\n * The specific type of interaction that is to be listened for.\n *

\n * If we specify that we only want to listen for a fluid type interaction, then\n * this listener will operate so that any other interactions for the same pair\n * of objects is ignored.\n */\n #if nape_swc@:isVar #end\n public var interactionType(get_interactionType,set_interactionType):InteractionType;\n inline function get_interactionType():InteractionType{\n var ret=zpp_inner_zn.itype;\n return if(ret==ZPP_Flags.id_InteractionType_COLLISION)InteractionType.COLLISION;\n else if(ret==ZPP_Flags.id_InteractionType_SENSOR)InteractionType.SENSOR;\n else if(ret==ZPP_Flags.id_InteractionType_FLUID)InteractionType.FLUID;\n else if(ret==ZPP_Flags.id_InteractionType_ANY)InteractionType.ANY;\n else null;\n }\n inline function set_interactionType(interactionType:InteractionType):InteractionType{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(interactionType==null){\n throw \"Error: Cannot set listener interaction type to null\";\n }\n #end\n if(this.interactionType!=interactionType){\n var xtype=if(interactionType==InteractionType.COLLISION)ZPP_Flags.id_InteractionType_COLLISION else if(interactionType==InteractionType.SENSOR)ZPP_Flags.id_InteractionType_SENSOR else if(interactionType==InteractionType.FLUID)ZPP_Flags.id_InteractionType_FLUID else ZPP_Flags.id_InteractionType_ANY;\n zpp_inner_zn.setInteractionType(xtype);\n }\n }\n return get_interactionType();\n }\n /**\n * Construct a new PreListener.\n *

\n * The options arguments are typed Dynamic, and are permitted to be either an\n * OptionType or one of:\n * CbType, CbTypeList, Array<CbType>, flash.Vector<CbType>\n * In which case the input CbType's will be used to construct an OptionType\n * whose included types will be the set of CbTypes supplied.\n *\n * @param interactionType The interaction type to listen for.\n * @param options1 The OptionType to match first Interactor against, passing null\n * will equate to an empty OptionType.\n * @param options2 The OptionType to match second Interactor against, passing null\n * will equate to an empty OptionType.\n * @param handler The callback handler for this listener.\n * @param precedence The precedence of this listener used to sort\n * the order of callbacks in the case of more than\n * one suitable BodyListener existing for the same\n * event on the same Body. (default 0)\n * @param pure If true, then the listener will be marked as having a pure handler.\n * (default false)\n * @return The newly constructed InteractionListener\n * @throws # If handler is null.\n * @throws # If either option is not of the expected Type.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(interactionType:InteractionType,options1:Null,options2:Null,handler:PreCallback->Null,precedence=0,pure=false){\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=true;\n #end\n super();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Listener.internal=false;\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(handler==null){\n throw \"Error: PreListener must take a handler!\";\n }\n #end\n zpp_inner_zn=new ZPP_InteractionListener(ZPP_OptionType.argument(options1),ZPP_OptionType.argument(options2),ZPP_Flags.id_CbEvent_PRE,ZPP_Flags.id_ListenerType_PRE);\n zpp_inner=zpp_inner_zn;\n zpp_inner.outer=this;\n zpp_inner_zn.outer_znp=this;\n zpp_inner.precedence=precedence;\n zpp_inner_zn.pure=pure;\n zpp_inner_zn.handlerp=handler;\n this.interactionType=interactionType;\n }\n}\n","package nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for all Nape joints and constraints\n */\n#if nape_swc@:keep #end\nclass Constraint{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Constraint;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set to disable debug drawing/\n *

\n * When true, this Constraint will not be drawn during debug draw operations\n * unless specifically given as argument to Debug draw() method.\n * @default true\n */\n public var debugDraw:Bool=true;\n /**\n * Compound this Constraints belong to.\n *

\n * If this constraint is in a Space or another Compound and you change\n * its compound, then it will be removed from that Space or Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n if(this.compound!=compound){\n if(this.compound!=null){\n this.compound.constraints.remove(this);\n }\n if(compound!=null){\n compound.constraints.add(this);\n }\n }\n }\n return get_compound();\n }\n /**\n * Space this constraint is inside of.\n *

\n * Whether this constraint is directly in a Space, or part of a Compound\n * which is inside of a space, this value will be equal to that Space.\n *

\n * If this constraint is inside of a Compound, then you cannot modify its\n * Space as the constraint belongs to that Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null){\n throw \"Error: Cannot set the space of a Constraint belonging to\"+\" a Compound, only the root Compound space can be set\";\n }\n #end\n if(this.space!=space){\n if(zpp_inner.component!=null)zpp_inner.component.woken=false;\n zpp_inner.clearcache();\n if(zpp_inner.space!=null){\n zpp_inner.space.outer.constraints.remove(this);\n }\n if(space!=null){\n space.constraints.add(this);\n }\n else{\n zpp_inner.space=null;\n }\n }\n }\n return get_space();\n }\n /**\n * Whether this constraint is sleeping or not.\n *

\n * This property is only defined if the constraint is inside of a Space\n * and is active, otherwise an error will be thrown should you access this\n * property.\n *

\n * This value is immutable, In Nape you do not ever need to manually\n * wake up a Constraint. It will always be done automatically without error.\n *

\n * To manually put a Constraint to sleep is against the very nature of Nape\n * API and so is excluded from the core of Nape. If you really want to do this\n * you should make use of the nape-hacks module.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.space==null||!zpp_inner.active){\n throw \"Error: isSleeping only makes sense if constraint is\"+\" active and inside a space\";\n }\n #end\n return zpp_inner.component.sleeping;\n }\n /**\n * Whether this constraint is active or not.\n *

\n * Setting a constraint to be no longer active is a useful way of\n * temporarigly disabling a constraint without having to remove it\n * from a Space.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var active(get_active,set_active):Bool;\n inline function get_active():Bool{\n return zpp_inner.active;\n }\n inline function set_active(active:Bool):Bool{\n {\n if(this.active!=active){\n if(zpp_inner.component!=null)zpp_inner.component.woken=false;\n zpp_inner.clearcache();\n if(active){\n zpp_inner.active=active;\n zpp_inner.activate();\n if(zpp_inner.space!=null){\n if(zpp_inner.component!=null)zpp_inner.component.sleeping=true;\n zpp_inner.space.wake_constraint(zpp_inner,true);\n }\n }\n else{\n if(zpp_inner.space!=null){\n zpp_inner.wake();\n zpp_inner.space.live_constraints.remove(zpp_inner);\n }\n zpp_inner.active=active;\n zpp_inner.deactivate();\n }\n }\n }\n return get_active();\n }\n /**\n * Whether interactions between related Bodys will be ignored.\n *

\n * If true, then the Bodys related to this constraint will not\n * be permitted to interact in anyway, including callbacks.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var ignore(get_ignore,set_ignore):Bool;\n inline function get_ignore():Bool{\n return zpp_inner.ignore;\n }\n inline function set_ignore(ignore:Bool):Bool{\n {\n if(this.ignore!=ignore){\n zpp_inner.ignore=ignore;\n zpp_inner.wake();\n }\n }\n return get_ignore();\n }\n /**\n * Whether constraint is stiff, or elastic.\n *

\n * A stiff constraint has its positional error resolved directly\n * as with contact penetrations. This is generally a more stable\n * way of solving positional errors but has a side-effect that for example\n * changing the pivot point on a constraint used for mouse control will not\n * cause the objects to swing as the positional error is solved without\n * effecting the velocity of the object which may not be wanted.\n *

\n * If false, then the positional error of the constraint will be\n * resolved in an elastic way using changes in velocity.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var stiff(get_stiff,set_stiff):Bool;\n inline function get_stiff():Bool{\n return zpp_inner.stiff;\n }\n inline function set_stiff(stiff:Bool):Bool{\n {\n if(this.stiff!=stiff){\n zpp_inner.stiff=stiff;\n zpp_inner.wake();\n }\n }\n return get_stiff();\n }\n /**\n * Frequency of elastic properties of constraint.\n *

\n * This property only has an effect when constraint is not stiff.\n *

\n * This value corresponds to in an ideal situation, the number of\n * spring like oscillations the constraint will make per second.\n *

\n * This value must be strictly positive (0 not allowed).\n *\n * @default 10\n */\n #if nape_swc@:isVar #end\n public var frequency(get_frequency,set_frequency):Float;\n inline function get_frequency():Float{\n return zpp_inner.frequency;\n }\n inline function set_frequency(frequency:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((frequency!=frequency)){\n throw \"Error: Constraint::Frequency cannot be NaN\";\n }\n if(frequency<=0){\n throw \"Error: Constraint::Frequency must be >0\";\n }\n #end\n if(this.frequency!=frequency){\n zpp_inner.frequency=frequency;\n if(!zpp_inner.stiff){\n zpp_inner.wake();\n }\n }\n }\n return get_frequency();\n }\n /**\n * Damping ratio of elastic properties of constraint.\n *

\n * This property only has an effect when constraint is not stiff.\n *

\n * This value corresponds to in the ideal situation, the damping\n * ratio of the constraints oscillations with 1 corresponding to\n * a total dampening, and values greater than one being over-dampening.\n *

\n * This value must be zero or positive.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var damping(get_damping,set_damping):Float;\n inline function get_damping():Float{\n return zpp_inner.damping;\n }\n inline function set_damping(damping:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((damping!=damping)){\n throw \"Error: Constraint::Damping cannot be Nan\";\n }\n if(damping<0){\n throw \"Error: Constraint::Damping must be >=0\";\n }\n #end\n if(this.damping!=damping){\n zpp_inner.damping=damping;\n if(!zpp_inner.stiff){\n zpp_inner.wake();\n }\n }\n }\n return get_damping();\n }\n /**\n * The maximum amount of force this constraint is allowed to use.\n *

\n * This value, whilst still used in a stiff constraint will not work\n * as you might hope for; since a stiff constraint resolves positional\n * error without using impulses, the maxForce will not have any effect\n * on how positional errors are resolved.\n *

\n * This value must be zero or positive.\n *\n * @default infinity\n */\n #if nape_swc@:isVar #end\n public var maxForce(get_maxForce,set_maxForce):Float;\n inline function get_maxForce():Float{\n return zpp_inner.maxForce;\n }\n inline function set_maxForce(maxForce:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((maxForce!=maxForce)){\n throw \"Error: Constraint::maxForce cannot be NaN\";\n }\n if(maxForce<0){\n throw \"Error: Constraint::maxForce must be >=0\";\n }\n #end\n if(this.maxForce!=maxForce){\n zpp_inner.maxForce=maxForce;\n zpp_inner.wake();\n }\n }\n return get_maxForce();\n }\n /**\n * The maximum amount of error this constraint is allowed to use.\n *

\n * For stiff constraints, this value only serves to work in conjunction\n * with breakUnderError to permit breaking of the constraint.\n *

\n * For non-stiff constraints, this value will also effect how the constraint\n * behaves when breakUnderError is false by restricting the amount of error\n * that will be resolved; this will not work for stiff constraints.\n *\n * @default infinity\n */\n #if nape_swc@:isVar #end\n public var maxError(get_maxError,set_maxError):Float;\n inline function get_maxError():Float{\n return zpp_inner.maxError;\n }\n inline function set_maxError(maxError:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((maxError!=maxError)){\n throw \"Error: Constraint::maxError cannot be NaN\";\n }\n if(maxError<0){\n throw \"Error: Constraint::maxError must be >=0\";\n }\n #end\n if(this.maxError!=maxError){\n zpp_inner.maxError=maxError;\n zpp_inner.wake();\n }\n }\n return get_maxError();\n }\n /**\n * Whether constraint will break once maxForce is reached.\n *

\n * This property effects both stiff and non-stiff constraints, though\n * for the same reasons as those of maxForce, does not make much sense\n * to be used in stiff constraints.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var breakUnderForce(get_breakUnderForce,set_breakUnderForce):Bool;\n inline function get_breakUnderForce():Bool{\n return zpp_inner.breakUnderForce;\n }\n inline function set_breakUnderForce(breakUnderForce:Bool):Bool{\n {\n if(this.breakUnderForce!=breakUnderForce){\n zpp_inner.breakUnderForce=breakUnderForce;\n zpp_inner.wake();\n }\n }\n return get_breakUnderForce();\n }\n /**\n * Whether constraint will break once maxError is reached.\n *

\n * This property effects both stiff and non-stiff constraints.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var breakUnderError(get_breakUnderError,set_breakUnderError):Bool;\n inline function get_breakUnderError():Bool{\n return zpp_inner.breakUnderError;\n }\n inline function set_breakUnderError(breakUnderError:Bool):Bool{\n {\n if(this.breakUnderError!=breakUnderError){\n zpp_inner.breakUnderError=breakUnderError;\n zpp_inner.wake();\n }\n }\n return get_breakUnderError();\n }\n /**\n * Whether constraint will be removed when it breaks.\n *

\n * If true, then when constraint is broken it will be removed from\n * the Space. Otherwise it will simple be made inactive.\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var removeOnBreak(get_removeOnBreak,set_removeOnBreak):Bool;\n inline function get_removeOnBreak():Bool{\n return zpp_inner.removeOnBreak;\n }\n inline function set_removeOnBreak(removeOnBreak:Bool):Bool{\n {\n zpp_inner.removeOnBreak=removeOnBreak;\n }\n return get_removeOnBreak();\n }\n /**\n * Return the constraint-space impulse applied in previous step.\n *\n * @return A new MatMN representing the constraint space impulse.\n */\n public function impulse():MatMN{\n return null;\n }\n /**\n * Compute impulse that was applied to the given Body.\n *

\n * This impulse is the actual (mass weighted) change in velocity\n * that occured due to this constraint.\n *\n * @param body The Body to compute impulse for.\n * @return The impulse that was applied to the body in the previous step.\n * @throws # If Body is not related to the Constraint.\n */\n public function bodyImpulse(body:Body):Vec3{\n return null;\n }\n /**\n * Apply given function to all Bodys linked to the constraint.\n *

\n * If a body is duplicated in a constraint then it will only\n * be visited once.\n *\n * @param lambda The function to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void):Void{}\n /**\n * Set of CbTypes for this constraints for callbacks.\n *

\n * This value cannot at present be set, but can be modified.\n *\n * @default [CbType.ANY_CONSTRAINT]\n */\n #if nape_swc@:isVar #end\n public var cbTypes(get_cbTypes,never):CbTypeList;\n inline function get_cbTypes():CbTypeList{\n if(zpp_inner.wrap_cbTypes==null){\n zpp_inner.setupcbTypes();\n }\n return zpp_inner.wrap_cbTypes;\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n public function new(){\n zpp_inner.insert_cbtype(CbType.ANY_CONSTRAINT.zpp_inner);\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Constraint cannot be instantiated derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"{Constraint}\";\n }\n /**\n * Produce copy of constraint.\n *

\n * All constraint properties except for internal impulse cache\n * and userData field will be copied.\n *\n * @return The copied Constraint.\n */\n public function copy():Constraint{\n return zpp_inner.copy();\n }\n}\n","package nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConstraintIterator{\n /**\n * @private\n */\n public var zpp_inner:ConstraintList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ConstraintIterator=null;\n /**\n * @private\n */\n public var zpp_next:ConstraintIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConstraintList.internal)throw \"Error: Cannot instantiate \"+\"Constraint\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ConstraintList){\n var ret=if(zpp_pool==null){\n ZPP_ConstraintList.internal=true;\n var ret=new ConstraintIterator();\n ZPP_ConstraintList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Constraint = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Constraint = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Constraint = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConstraintList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConstraintList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Constraint\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ConstraintList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Constraint)#else Std.is(i,Constraint)#end)throw \"Error: Array contains non \"+\"Constraint\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ConstraintList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Constraint):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Constraint{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Constraint{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Constraint{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Constraint):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Constraint):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Constraint\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ConstraintIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ConstraintList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Constraint\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ConstraintList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ConstraintList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Constraint->Void):ConstraintList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ConstraintIterator.zpp_pool;\n ConstraintIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Constraint->Bool):ConstraintList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * These objects are automatically reused, and you should not keep your own\n * references to them.\n */\n#if nape_swc@:keep #end\nclass Arbiter{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Arbiter=null;\n /**\n * Flag representing arbiter sleep state.\n *

\n * When true, this arbiter is sleeping.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.sleeping;\n }\n /**\n * The type of this Arbiter.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ArbiterType;\n inline function get_type():ArbiterType{\n return ZPP_Arbiter.types[zpp_inner.type];\n }\n /**\n * Equivalent to: arb.type == ArbiterType.COLLISION\n *

\n *\n * @return True if this Arbiter is a Collision type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isCollisionArbiter(){\n return zpp_inner.type==ZPP_Arbiter.COL;\n }\n /**\n * Equivalent to: arb.type == ArbiterType.FLUID\n *

\n *\n * @return True if this Arbiter is a Fluid type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isFluidArbiter(){\n return zpp_inner.type==ZPP_Arbiter.FLUID;\n }\n /**\n * Equivalent to: arb.type == ArbiterType.SENSOR\n *

\n *\n * @return True if this Arbiter is a Sensor type arbiter.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isSensorArbiter(){\n return zpp_inner.type==ZPP_Arbiter.SENSOR;\n }\n /**\n * Fast equivalent to casting this object to a CollisionArbiter.\n *

\n * This value is null when this arbiter is not a collision type.\n */\n #if nape_swc@:isVar #end\n public var collisionArbiter(get_collisionArbiter,never):Null;\n inline function get_collisionArbiter():Null{\n return if(isCollisionArbiter())zpp_inner.colarb.outer_zn else null;\n }\n /**\n * Fast equivalent to casting this object to a FluidArbiter.\n *

\n * This value is null when this arbiter is not a fluid type.\n */\n #if nape_swc@:isVar #end\n public var fluidArbiter(get_fluidArbiter,never):Null;\n inline function get_fluidArbiter():Null{\n return if(isFluidArbiter())zpp_inner.fluidarb.outer_zn else null;\n }\n /**\n * The first shape in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.id < arb.shape2.id\n */\n #if nape_swc@:isVar #end\n public var shape1(get_shape1,never):Shape;\n inline function get_shape1():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.ws2.outer:zpp_inner.ws1.outer;\n }\n /**\n * The second shape in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.id < arb.shape2.id\n */\n #if nape_swc@:isVar #end\n public var shape2(get_shape2,never):Shape;\n inline function get_shape2():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.ws1.outer:zpp_inner.ws2.outer;\n }\n /**\n * The first body in Arbiter interaction.\n *

\n * It will always be the case that arb.shape1.body == arb.body1\n */\n #if nape_swc@:isVar #end\n public var body1(get_body1,never):Body;\n inline function get_body1():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.b2.outer:zpp_inner.b1.outer;\n }\n /**\n * The second body in Arbiter interaction.\n *

\n * It will always be the case that arb.shape2.body == arb.body2\n */\n #if nape_swc@:isVar #end\n public var body2(get_body2,never):Body;\n inline function get_body2():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return(zpp_inner.ws1.id>zpp_inner.ws2.id)?zpp_inner.b1.outer:zpp_inner.b2.outer;\n }\n /**\n * The interaction state of this Arbiter.\n *

\n * This flag will, except for in a PreListener handler, always be either\n * ImmState.ACCEPT or ImmState.IGNORE\n *
\n * During a PreListener handler, you can query this property to see what\n * the current state of the arbiter has been set to, and returning null from\n * the handler will keep the state unchanged.\n */\n #if nape_swc@:isVar #end\n public var state(get_state,never):PreFlag;\n inline function get_state():PreFlag{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return switch(zpp_inner.immState){\n case x if(x==ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS):PreFlag.ACCEPT;\n case ZPP_Flags.id_ImmState_ACCEPT:PreFlag.ACCEPT_ONCE;\n case x if(x==ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS):PreFlag.IGNORE;\n default:PreFlag.IGNORE_ONCE;\n }\n }\n /**\n * Evaluate the total impulse this arbiter applied to the given body for\n * the previous space step including angular impulse based on things like\n * contact position, or centre of buoyancy etc.\n *

\n * If body is null, then the constraint space impulse will be returned instead\n *\n * @param body The body to query impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be queried for\n * collision type arbiters. This field has no use on fluid type\n * arbiters. (default false)\n * @return The total impulse applied to the given body, or the constraint\n * space impule if the body is null.\n * @throws # If body is non-null, but not related to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null,freshOnly:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n return Vec3.get(0,0,0);\n }\n /**\n * @private\n */\n public function new(){\n if(!ZPP_Arbiter.internal){\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot instantiate Arbiter derp!\";\n #end\n }\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=if(isCollisionArbiter())\"CollisionArbiter\";\n else if(isFluidArbiter())\"FluidArbiter\";\n else \"SensorArbiter\";\n #if NAPE_POOL_STATS ret+=\"#\"+zpp_inner.arbid;\n #end\n if(zpp_inner.cleared)return ret+\"(object-pooled)\";\n else return ret+\"(\"+shape1.toString()+\"|\"+shape2.toString()+\")\"+(isCollisionArbiter()?\"[\"+[\"SD\",\"DD\"][zpp_inner.colarb.stat?0:1]+\"]\":\"\")+\"<-\"+state.toString();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ArbiterIterator{\n /**\n * @private\n */\n public var zpp_inner:ArbiterList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ArbiterIterator=null;\n /**\n * @private\n */\n public var zpp_next:ArbiterIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ArbiterList.internal)throw \"Error: Cannot instantiate \"+\"Arbiter\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ArbiterList){\n var ret=if(zpp_pool==null){\n ZPP_ArbiterList.internal=true;\n var ret=new ArbiterIterator();\n ZPP_ArbiterList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Arbiter = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Arbiter = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Arbiter = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!true@:final #end\n#if nape_swc@:keep #end\nclass ArbiterList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ArbiterList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if false inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Arbiter\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ArbiterList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Arbiter)#else Std.is(i,Arbiter)#end)throw \"Error: Array contains non \"+\"Arbiter\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ArbiterList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Arbiter):Bool{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Arbiter{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!true){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Arbiter{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Arbiter{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function add(obj:Arbiter):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Arbiter):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Arbiter\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public function empty(){\n #if false if(true)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public function iterator(){\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ArbiterIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ArbiterList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Arbiter\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ArbiterList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ArbiterList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function foreach(lambda:Arbiter->Void):ArbiterList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ArbiterIterator.zpp_pool;\n ArbiterIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Arbiter->Bool):ArbiterList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This normal will always point from arbiter's shape1, towards shape2 and\n * corresponds to the direction of the normal before positional integration\n * and erorr resolvement took place (Correct at time of pre-listener).\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n if(zpp_inner.colarb.wrap_normal==null)zpp_inner.colarb.getnormal();\n return zpp_inner.colarb.wrap_normal;\n }\n /**\n * This radius property describes the sum of the circle's radii for the pair of shapes, with\n * a Polygon having 0 radius. This value is used in positional iterations to resolve penetrations\n * between the Shapes.\n */\n #if nape_swc@:isVar #end\n public var radius(get_radius,never):Float;\n inline function get_radius():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.colarb.radius;\n }\n /**\n * The reference edge for the collision on the first Polygon\n * If the first shape in Arbiter is a Circle this value is null.\n */\n #if nape_swc@:isVar #end\n public var referenceEdge1(get_referenceEdge1,never):Null;\n inline function get_referenceEdge1():Null{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var edge=zpp_inner.colarb.__ref_edge1;\n if(edge!=null&&(!shape1.isPolygon()||shape1.zpp_inner!=edge.polygon))edge=zpp_inner.colarb.__ref_edge2;\n return(edge==null)?null:edge.wrapper();\n }\n /**\n * The reference edge for the collision on the second Polygon\n * If the second shape in Arbiter is a Circle this value is null.\n */\n #if nape_swc@:isVar #end\n public var referenceEdge2(get_referenceEdge2,never):Null;\n inline function get_referenceEdge2():Null{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var edge=zpp_inner.colarb.__ref_edge1;\n if(edge!=null&&(!shape2.isPolygon()||shape2.zpp_inner!=edge.polygon))edge=zpp_inner.colarb.__ref_edge2;\n return(edge==null)?null:edge.wrapper();\n }\n /**\n * In the case that we have a Circle-Polygon collision, then this\n * function will return true, if the circle collided with the first\n * vertex of edge.\n *

\n * If both firstVertex() and secondVertex() are false, it indicates\n * the Circle collided with the edge.\n *\n * @returns True if Circle collided with first reference vertex.\n */\n public function firstVertex(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var poly2circle=(zpp_inner.colarb.__ref_edge1!=null)!=(zpp_inner.colarb.__ref_edge2!=null);\n return if(poly2circle)(zpp_inner.colarb.__ref_vertex==-1)else false;\n }\n /**\n * Check if colliding Circle hit second vertex of reference edge.\n *

\n * In the case that we have a Circle-Polygon collision, then this\n * function will return true, if the circle collided with the second\n * vertex of edge.\n *

\n * If both firstVertex() and secondVertex() are false, it indicates\n * the Circle collided with the edge.\n *\n * @returns True if Circle collided with second reference vertex.\n */\n public function secondVertex(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var poly2circle=(zpp_inner.colarb.__ref_edge1!=null)!=(zpp_inner.colarb.__ref_edge2!=null);\n return if(poly2circle)(zpp_inner.colarb.__ref_vertex==1)else false;\n }\n /**\n * Evaluate normal reactive impulses for collision interaction for a given body.\n *

\n * If body argument is null, then the sum of the contact normal impulses will be returned instead\n * with no angular impulse derivable, the direction of this impulse will be the direction of the normal.\n *
\n * If body argument is not null, then this will return the actual impulse applied to that specific body\n * rather than simply the sum of contact normal impulses, this will include angular impulses due to\n * positions of contact points and normal.\n *\n * @param body The Body to query normal impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body, considering normal reactive forces.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().normalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().normalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate tangent impulses for collision interaction.\n *

\n * If body argument is null, then the sum of the contact friction impulses is returned with\n * no angular impulse derivable, the direction of this impulse will be against the relative\n * velocity of the first body against the second.\n *
\n * If the body argument is non-null, then the actual impulse applied to that body due to tangent\n * frictino impulses will be returned, including angular effects due to contact positions and normal.\n *

\n * These tangent impulses correspond to the forces of static and dynamic friction.\n *\n * @param body The Body to query tangent impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body, considering standard frictional forces.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().tangentImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().tangentImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate total contact impulses for collision interaction.\n *

\n * If body argument is null, then this will return the sum of linear contact impulses, and the sum\n * of contact rolling impulses.\n *
\n * When body argument is non-null, this impulse will be the actual change in (mass weighted)\n * velocity that this collision caused to the Body in the previous time step.\n *\n * @param body The Body to query total impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The impulse applied to the given body\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public override function totalImpulse(body:Body=null,freshOnly:Bool=false):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var colarb=zpp_inner.colarb;\n {\n if(!freshOnly||colarb.oc1.fresh){\n var imp=colarb.oc1.wrapper().totalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n if(colarb.hc2){\n if(!freshOnly||colarb.oc2.fresh){\n var imp=colarb.oc2.wrapper().totalImpulse(body);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate rolling friction impulses for collision interaction.\n *

\n * If body argument is null, then the sum of the rolling impulses of each contact will be returned\n * instead of the angular impulse applied to the specific body as a result of the rolling impulses.\n *\n * @param body The Body to query rolling impulse for. (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered in computation.\n * (default false)\n * @return The angular impulse applied to the given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function rollingImpulse(body:Body=null,freshOnly:Bool=false):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var colarb=zpp_inner.colarb;\n if(!freshOnly||colarb.oc1.fresh)return colarb.oc1.wrapper().rollingImpulse(body);\n else return 0.0;\n }\n /**\n * Coeffecient of combined elasticity for collision interaction.\n *

\n * The value is computed as the average of the Shape Material's elasticities\n * clamped to be in the range [0,1]\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must be in the range 0\n * to 1.\n */\n #if nape_swc@:isVar #end\n public var elasticity(get_elasticity,set_elasticity):Float;\n inline function get_elasticity():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.restitution;\n }\n inline function set_elasticity(elasticity:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((elasticity!=elasticity))throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" cannot be NaN\";\n if(elasticity<0)throw \"Error: CollisionArbiter::\"+\"elasticity\"+\" cannot be negative\";\n if(\"elasticity\"==\"restitution\"&&elasticity>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.restitution=elasticity;\n colarb.userdef_restitution=true;\n }\n return get_elasticity();\n }\n /**\n * Coeffecient of combined dynamic friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's dynamicFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var dynamicFriction(get_dynamicFriction,set_dynamicFriction):Float;\n inline function get_dynamicFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.dyn_fric;\n }\n inline function set_dynamicFriction(dynamicFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((dynamicFriction!=dynamicFriction))throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" cannot be NaN\";\n if(dynamicFriction<0)throw \"Error: CollisionArbiter::\"+\"dynamicFriction\"+\" cannot be negative\";\n if(\"dynamicFriction\"==\"restitution\"&&dynamicFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.dyn_fric=dynamicFriction;\n colarb.userdef_dyn_fric=true;\n }\n return get_dynamicFriction();\n }\n /**\n * Coeffecient of combined static friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's staticFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var staticFriction(get_staticFriction,set_staticFriction):Float;\n inline function get_staticFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.stat_fric;\n }\n inline function set_staticFriction(staticFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((staticFriction!=staticFriction))throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" cannot be NaN\";\n if(staticFriction<0)throw \"Error: CollisionArbiter::\"+\"staticFriction\"+\" cannot be negative\";\n if(\"staticFriction\"==\"restitution\"&&staticFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.stat_fric=staticFriction;\n colarb.userdef_stat_fric=true;\n }\n return get_staticFriction();\n }\n /**\n * Coeffecient of combined rolling friction for collision interaction.\n *

\n * The value is computed as the square root of the product of the Shape\n * Material's rollingFriction coeffecients.\n *

\n * This value may be modified only during a PreListener, and once modified\n * will no longer be under Nape's control. Values must not be negative.\n */\n #if nape_swc@:isVar #end\n public var rollingFriction(get_rollingFriction,set_rollingFriction):Float;\n inline function get_rollingFriction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.validate_props();\n return colarb.rfric;\n }\n inline function set_rollingFriction(rollingFriction:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.colarb.mutable)throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" is only mutable during a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((rollingFriction!=rollingFriction))throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" cannot be NaN\";\n if(rollingFriction<0)throw \"Error: CollisionArbiter::\"+\"rollingFriction\"+\" cannot be negative\";\n if(\"rollingFriction\"==\"restitution\"&&rollingFriction>1)throw \"Error: CollisionArbiter::restitution cannot be greater than 1\";\n #end\n var colarb=zpp_inner.colarb;\n colarb.rfric=rollingFriction;\n colarb.userdef_rfric=true;\n }\n return get_rollingFriction();\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Arbiter.internal)throw \"Error: Cannot instantiate CollisionArbiter derp!\";\n #end\n super();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Contact point for collision interactions\n *

\n * These objects are automatically reused and you should not keep references to them.\n */\n@:final#if nape_swc@:keep #end\nclass Contact{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Contact=null;\n /**\n * Reference to the CollisionArbiter this contact belongs to\n */\n #if nape_swc@:isVar #end\n public var arbiter(get_arbiter,never):CollisionArbiter;\n inline function get_arbiter():CollisionArbiter{\n return if(zpp_inner.arbiter==null)null else zpp_inner.arbiter.outer.collisionArbiter;\n }\n /**\n * Penetration of bodies along normal for this contact.\n *

\n * This value may be negative and corresponds to the penetration (if at all)\n * of the contact point before positional integration and error resolvement\n * took place (correct at time of pre-listeners).\n */\n #if nape_swc@:isVar #end\n public var penetration(get_penetration,never):Float;\n inline function get_penetration():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return(-zpp_inner.dist);\n }\n /**\n * The world-space position of contact.\n *

\n * This value corresponds to the position\n * of the contact point before positional integration and error resolvement\n * took place (correct at time of pre-listeners).\n */\n #if nape_swc@:isVar #end\n public var position(get_position,never):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n if(zpp_inner.wrap_position==null)zpp_inner.getposition();\n return zpp_inner.wrap_position;\n }\n /**\n * Whether this contact is newly generated, or persistant from previous step.\n */\n #if nape_swc@:isVar #end\n public var fresh(get_fresh,never):Bool;\n inline function get_fresh():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return zpp_inner.fresh;\n }\n /**\n * Evaluate normal reactive impulses for this contact for a given body.\n *

\n * If body argument is null, then the contact normal impulses will be returned instead\n * with no angular impulse derivable, the direction of this impulse will be the direction of the normal.\n *
\n * If body argument is not null, then this will return the actual impulse applied to that specific body\n * for this contact this will include angular impulses due to position of contact point and normal.\n *\n * @param body The Body to query normal impulse for. (default null)\n * @return The impulse applied to the given body, considering normal reactive forces.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jnAcc=cin.jnAcc;\n if(body==null)return Vec3.get(colarb.nx*jnAcc,colarb.ny*jnAcc);\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return Vec3.get(colarb.nx*-jnAcc,colarb.ny*-jnAcc,-(colarb.ny*cin.r1x-colarb.nx*cin.r1y)*jnAcc);\n else return Vec3.get(colarb.nx*jnAcc,colarb.ny*jnAcc,(colarb.ny*cin.r2x-colarb.nx*cin.r2y)*jnAcc);\n }\n }\n /**\n * Evaluate tangent impulses for this contact for a given body.\n *

\n * If body argument is null, then the contact friction impulses is returned with\n * no angular impulse derivable, the direction of this impulse will be against the relative\n * velocity of the first body against the second.\n *
\n * If the body argument is non-null, then the actual impulse applied to that body due to tangent\n * frictino impulses will be returned, including angular effects due to contact position and normal.\n *

\n * These tangent impulses correspond to the forces of static and dynamic friction for this contact.\n *\n * @param body The Body to query tangent impulse for. (default null)\n * @return The impulse applied to the given body, considering standard frictional forces.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jtAcc=cin.jtAcc;\n if(body==null)return Vec3.get(-colarb.ny*jtAcc,colarb.nx*jtAcc);\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return Vec3.get(colarb.ny*jtAcc,-colarb.nx*jtAcc,-(cin.r1x*colarb.nx+cin.r1y*colarb.ny)*jtAcc);\n else return Vec3.get(-colarb.ny*jtAcc,colarb.nx*jtAcc,(cin.r2x*colarb.nx+cin.r2y*colarb.ny)*jtAcc);\n }\n }\n /**\n * Evaluate rolling friction impulses for this contact for a given body.\n *

\n * If body argument is null, then the rolling impulse of this contact will be returned\n * instead of the angular impulse applied to the specific body as a result of the rolling impulse.\n *\n * @param body The Body to query rolling impulse for. (default null)\n * @return The angular impulse applied to the given body.\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function rollingImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var jrAcc=zpp_inner.arbiter.colarb.jrAcc;\n if(body==null)return jrAcc;\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n if(body==colarb.b1.outer)return-jrAcc;\n else return jrAcc;\n }\n }\n /**\n * Evaluate total contact impulse for a given body.\n *

\n * If body argument is null, then this will return the sum of normal and tangent contact impulse, and the contact\n * rolling impulse.\n *
\n * When body argument is non-null, this impulse will be the actual change in (mass weighted)\n * velocity that this contact caused to the Body in the previous time step.\n *\n * @param body The Body to query total impulse for. (default null)\n * @return The impulse applied to the given body\n * @throws # If body is non-null, and unrelated to this Contact.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n var colarb=zpp_inner.arbiter.colarb;\n var cin=zpp_inner.inner;\n var jnAcc=cin.jnAcc;\n var jtAcc=cin.jtAcc;\n var jrAcc=colarb.jrAcc;\n if(body==null){\n return Vec3.get(colarb.nx*jnAcc-colarb.ny*jtAcc,colarb.ny*jnAcc+colarb.nx*jtAcc,jrAcc);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n if(body!=colarb.b1.outer&&body!=colarb.b2.outer)throw \"Error: Contact does not relate to the given body\";\n #end\n var jx:Float=colarb.nx*jnAcc-colarb.ny*jtAcc;\n var jy:Float=colarb.ny*jnAcc+colarb.nx*jtAcc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jx!=jx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jx)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"colarb.nx*jnAcc-colarb.ny*jtAcc\"+\",in y: \"+\"colarb.ny*jnAcc+colarb.nx*jtAcc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jy!=jy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jy)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"colarb.nx*jnAcc-colarb.ny*jtAcc\"+\",in y: \"+\"colarb.ny*jnAcc+colarb.nx*jtAcc\"+\")\");\n #end\n };\n if(body==colarb.b1.outer)return Vec3.get(-jx,-jy,-(jy*cin.r1x-jx*cin.r1y)-jrAcc);\n else return Vec3.get(jx,jy,(jy*cin.r2x-jx*cin.r2y)+jrAcc);\n }\n }\n /**\n * The specific coeffecient of friction for this contact.\n *

\n * This value is equal either to the static or dynamic friction coeffecient of the arbiter\n * based on the relative velocity at contact point.\n *

\n * This value cannot be set, though you may implicitly set it exactly by modifying\n * the arbiter to have the same static and dynamic friction in the PreListener.\n */\n #if nape_swc@:isVar #end\n public var friction(get_friction,never):Float;\n inline function get_friction():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Contact not currently in use\";\n #end\n return zpp_inner.inner.friction;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Contact.internal)throw \"Error: Cannot instantiate Contact derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(zpp_inner.arbiter==null||zpp_inner.arbiter.cleared)return \"{object-pooled}\";\n else return \"{Contact}\";\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ContactIterator{\n /**\n * @private\n */\n public var zpp_inner:ContactList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ContactIterator=null;\n /**\n * @private\n */\n public var zpp_next:ContactIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ContactList.internal)throw \"Error: Cannot instantiate \"+\"Contact\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ContactList){\n var ret=if(zpp_pool==null){\n ZPP_ContactList.internal=true;\n var ret=new ContactIterator();\n ZPP_ContactList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Contact = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Contact = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Contact = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ContactList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ContactList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active&&i.arbiter.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(true){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(i.active&&i.arbiter.active)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Contact\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ContactList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Contact)#else Std.is(i,Contact)#end)throw \"Error: Array contains non \"+\"Contact\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ContactList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Contact):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Contact{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!true){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Contact{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Contact{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Contact):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Contact):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Contact\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(true)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ContactIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ContactList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Contact\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ContactList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ContactList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Contact->Void):ContactList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ContactIterator.zpp_pool;\n ContactIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Contact->Bool):ContactList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This value can be modified during a related PreListener handler.\n */\n #if nape_swc@:isVar #end\n public var position(get_position,set_position):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n if(zpp_inner.fluidarb.wrap_position==null)zpp_inner.fluidarb.getposition();\n return zpp_inner.fluidarb.wrap_position;\n }\n inline function set_position(position:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.fluidarb.mutable)throw \"Error: Arbiter is mutable only within a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: FluidArbiter::position cannot be null\";\n #end\n this.position.set(position);\n }\n return get_position();\n }\n /**\n * Overlap area of Shapes in fluid interaction.\n *

\n * This value is strictly positive, and represents the amount of overlap between the Shapes\n * used in buoyancy computations.\n *

\n * This value can be modified during a related PreListener handler.\n */\n #if nape_swc@:isVar #end\n public var overlap(get_overlap,set_overlap):Float;\n inline function get_overlap():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n return zpp_inner.fluidarb.overlap;\n }\n inline function set_overlap(overlap:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_inner.fluidarb.mutable)throw \"Error: Arbiter is mutable only within a pre-handler\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((overlap!=overlap))throw \"Error: FluidArbiter::overlap cannot be NaN\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(overlap<=0||overlap==Math.POSITIVE_INFINITY)throw \"Error: FluidArbiter::overlap must be strictly positive and non infinite\";\n #end\n zpp_inner.fluidarb.overlap=overlap;\n }\n return get_overlap();\n }\n /**\n * Determine impulse on a given body due to buoyancy.\n *

\n * If the body is null, then the buoyancy impulse will be returned without consideration to any specific\n * body involved, and no angular impulses can be derived.\n *\n * @param body The body to query impulse for. (default null)\n * @return The buoyancy impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function buoyancyImpulse(body:Body=null):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var farb=zpp_inner.fluidarb;\n if(body==null){\n return Vec3.get(farb.buoyx,farb.buoyy,0);\n }\n else if(body.zpp_inner==zpp_inner.b2){\n return Vec3.get(farb.buoyx,farb.buoyy,(farb.buoyy*farb.r2x-farb.buoyx*farb.r2y));\n }\n else{\n return Vec3.get(-farb.buoyx,-farb.buoyy,-(farb.buoyy*farb.r1x-farb.buoyx*farb.r1y));\n }\n }\n /**\n * Determine impulse on a given body due to fluid drag.\n *

\n * If the body is null, then the drag impulse will be returned without consideration to any specific\n * body involved.\n *\n * @param body The body to query impulse for. (default null)\n * @return The drag impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public function dragImpulse(body:Body=null):Vec3{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var farb=zpp_inner.fluidarb;\n var scale=(body==null||body.zpp_inner==zpp_inner.b2?1:-1);\n return Vec3.get(farb.dampx*scale,farb.dampy*scale,farb.adamp*scale);\n }\n /**\n * Determine total impulse on a given body due to fluid interaction.\n *

\n * If the body is null, then the total impulse will be computed without consideration to any specific\n * body involved, and no angular impulses can be derived for the linear portion of the impulses.\n *\n * @param body The body to query impulse for. (default null)\n * @param freshOnly This parameter is unused for FluidArbiters. (default false)\n * @return The total impulse for given body.\n * @throws # If body is non-null, and unrelated to this Arbiter.\n */\n #if nape_swc@:keep #end\n public override function totalImpulse(body:Body=null,freshOnly:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body!=body1&&body!=body2)throw \"Error: Arbiter does not relate to body\";\n #end\n var tmp=this.buoyancyImpulse(body);\n var ret=this.dragImpulse(body);\n ret.x+=tmp.x;\n ret.y+=tmp.y;\n ret.z+=tmp.z;\n tmp.dispose();\n return ret;\n }\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Arbiter.internal)throw \"Error: Cannot instantiate FluidArbiter derp!\";\n #end\n super();\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * InteractionFilter provides bit flags for low-level filtering of interactions.\n *

\n * For a given interaction type, two Shapes will be permitted to interact only if\n * (shape1.group & shape2.mask) != 0 && (shape2.group & shape1.mask) != 0\n *

\n * There are 32 real groups corresponding to a set bit in the group/mask fields. For instance\n * a group value of 0x120 corresponds to the 'real' groups 5 and 8 as 0x120 = (1<<5) | (1<<8)\n *

\n * Nape provides group/mask for each interaction type. The actual precedence of interactions\n * is further defined simply as: Sensor > Fluid > Collision.\n *
\n * Two static bodies can never interact, and with the exception of sensor interaction, at least one\n * of the two bodies must be dynamic.\n *
\n * Sensor interactions have the highest precedence, followed by fluid and then collisions.\n * Sensor interaction is permitted only if one of the shapes is sensorEnabled, whilst fluid\n * is permitted only if one of the shapes is fluidEnabled.\n *
\n * if ((shapeA.sensorEnabled || shapeB.sensorEnabled) && shapeA.filter.shouldSense(shapeB.filter)) {\n *     SENSOR INTERACTION!!\n * }\n * else if (bodyA.isDynamic() || bodyB.isDynamic()) {\n *     if ((shapeA.fluidEnabled || shapeB.fluidEnabled) && shapeA.filter.shouldFlow(shapeB.filter)) {\n *         FLUID INTERACTION!!\n *     }\n *     else if (shapeA.filter.shouldCollide(shapeB.filter)) {\n *         COLLISION INTERACTION!!\n *     }\n * }\n * 
\n */\n@:final#if nape_swc@:keep #end\nclass InteractionFilter{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionFilter=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Group bitfield for Collision type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var collisionGroup(get_collisionGroup,set_collisionGroup):Int;\n inline function get_collisionGroup():Int{\n return zpp_inner.collisionGroup;\n }\n inline function set_collisionGroup(collisionGroup:Int):Int{\n {\n if(this.collisionGroup!=collisionGroup){\n zpp_inner.collisionGroup=collisionGroup;\n zpp_inner.invalidate();\n }\n }\n return get_collisionGroup();\n }\n /**\n * Mask bitfield for Collision type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var collisionMask(get_collisionMask,set_collisionMask):Int;\n inline function get_collisionMask():Int{\n return zpp_inner.collisionMask;\n }\n inline function set_collisionMask(collisionMask:Int):Int{\n {\n if(this.collisionMask!=collisionMask){\n zpp_inner.collisionMask=collisionMask;\n zpp_inner.invalidate();\n }\n }\n return get_collisionMask();\n }\n /**\n * Group bitfield for Sensor type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var sensorGroup(get_sensorGroup,set_sensorGroup):Int;\n inline function get_sensorGroup():Int{\n return zpp_inner.sensorGroup;\n }\n inline function set_sensorGroup(sensorGroup:Int):Int{\n {\n if(this.sensorGroup!=sensorGroup){\n zpp_inner.sensorGroup=sensorGroup;\n zpp_inner.invalidate();\n }\n }\n return get_sensorGroup();\n }\n /**\n * Mask bitfield for Sensor type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var sensorMask(get_sensorMask,set_sensorMask):Int;\n inline function get_sensorMask():Int{\n return zpp_inner.sensorMask;\n }\n inline function set_sensorMask(sensorMask:Int):Int{\n {\n if(this.sensorMask!=sensorMask){\n zpp_inner.sensorMask=sensorMask;\n zpp_inner.invalidate();\n }\n }\n return get_sensorMask();\n }\n /**\n * Group bitfield for Fluid type interactions.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var fluidGroup(get_fluidGroup,set_fluidGroup):Int;\n inline function get_fluidGroup():Int{\n return zpp_inner.fluidGroup;\n }\n inline function set_fluidGroup(fluidGroup:Int):Int{\n {\n if(this.fluidGroup!=fluidGroup){\n zpp_inner.fluidGroup=fluidGroup;\n zpp_inner.invalidate();\n }\n }\n return get_fluidGroup();\n }\n /**\n * Mask bitfield for Fluid type interactions.\n * @default -1 (all bits set)\n */\n #if nape_swc@:isVar #end\n public var fluidMask(get_fluidMask,set_fluidMask):Int;\n inline function get_fluidMask():Int{\n return zpp_inner.fluidMask;\n }\n inline function set_fluidMask(fluidMask:Int):Int{\n {\n if(this.fluidMask!=fluidMask){\n zpp_inner.fluidMask=fluidMask;\n zpp_inner.invalidate();\n }\n }\n return get_fluidMask();\n }\n /**\n * Construct a new InteractionFilter.\n *\n * @param collisionGroup The Group bitfield for Collision interactions. (default 1)\n * @param collisionMask The Mask bitfield for Collision interactions. (default -1)\n * @param sensorGroup The Group bitfield for Sensor interactions. (default 1)\n * @param sensorMask The Mask bitfield for Sensor interactions. (default -1)\n * @param fluidGroup The Group bitfield for Fluid interactions. (default 1)\n * @param fluidMask The Mask bitfield for Fluid interactions. (default -1)\n * @return The newly constructed InteractionFilter.\n */\n #if flib@:keep function flibopts_6(){}\n #end\n public function new(collisionGroup=1,collisionMask=-1,sensorGroup=1,sensorMask=-1,fluidGroup=1,fluidMask=-1){\n {\n if(ZPP_InteractionFilter.zpp_pool==null){\n zpp_inner=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.collisionGroup=collisionGroup;\n this.collisionMask=collisionMask;\n this.sensorGroup=sensorGroup;\n this.sensorMask=sensorMask;\n this.fluidGroup=fluidGroup;\n this.fluidMask=fluidMask;\n }\n /**\n * Determine if objects are permitted to collide based on InteractionFilters\n *

\n * A collision type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of collision with.\n * @return True, if based on interaction filters only the two objects would be able to collide.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldCollide(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldCollide\";\n #end\n return zpp_inner.shouldCollide(filter.zpp_inner);\n }\n /**\n * Determine if objects are permitted to sense based on InteractionFilters\n *

\n * A sensor type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of sensor with.\n * @return True, if based on interaction filters only the two objects would be able to sense.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldSense(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldSense\";\n #end\n return zpp_inner.shouldSense(filter.zpp_inner);\n }\n /**\n * Determine if objects are permitted to interact as fluids based on InteractionFilters\n *

\n * A fluid type interaction can occur only if this returns True.\n *\n * @param filter The filter to evaluate possibility of fluid with.\n * @return True, if based on interaction filters only the two objects would be able to interact as fluids.\n * @throws # If filter is null.\n */\n #if nape_swc@:keep #end\n public function shouldFlow(filter:InteractionFilter){\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: filter argument cannot be null for shouldFlow\";\n #end\n return zpp_inner.shouldFlow(filter.zpp_inner);\n }\n /**\n * Produce a copy of this InteractionFilter\n *\n * @return The copy of this filter.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return new InteractionFilter(collisionGroup,collisionMask,sensorGroup,sensorMask,fluidGroup,fluidMask);\n }\n /**\n * @private\n */\n #if nape_swc@:keep #end\n public function toString(){\n return \"{ collision: \"+StringTools.hex(collisionGroup,8)+\"~\"+StringTools.hex(collisionMask,8)+\" sensor: \"+StringTools.hex(sensorGroup,8)+\"~\"+StringTools.hex(sensorMask,8)+\" fluid: \"+StringTools.hex(fluidGroup,8)+\"~\"+StringTools.hex(fluidMask,8)+\" }\";\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * InteractionGroups are another way of filtering interactions.\n *

\n * InteractionGroups form tree structures which are checked along side InteractionFilters\n * when deciding if two Shapes should interact.\n *

\n * InteractionGroups are assigned to any Interactor (not just Shapes), and two Shapes will\n * interact only if the most recent common ancestor in the InteractionGroup tree permits it.\n *

\n * For the purposes of the search, if any Interactor has no InteractionGroup assigned, we\n * search up the Compound tree first.\n *
\n *            _Group1\n *           /   |\n *          /  Group2      Group3\n *         /    |    \\       |                 Group1\n *     Body1   /      Cmp1   |                 /   \\           Group3\n *    /    \\  /      /    \\  |      ==>    Shp1    Group2        |\n * Shp1   Shp2   Body2     Cmp2                    /    \\      Shp4\n *                 |         |                  Shp2    Shp3\n *                Shp3     Body3\n *                           |\n *                         Shp4\n * 
\n * If we look at which InteractionGroup is used for which Shape following this rule, then\n * the left graph can be transformed into an InteractionGroup tree on the right and we get\n * that the MRCA (Most recent common ancestors) are such that:\n *
\n * MRCA(Shp1, Shp3) == Group1;\n * MRCA(Shp2, Shp3) == Group2;\n * MRCA(Shp4,   # ) == null;\n * 
\n * If we were to set up the groups such that Group1.ignore = false and\n * Group2.ignore = true; then shapes 1 and 3 would not be permitted to\n * interact, whilst shapes 2 and 3 would be permitted.\n *
\n * As the MRCA for shape 4 with any other is null, then the value of Group3's ignore field\n * is irrelevant, but the existance of Group3 is not as it serves to otherwise prevent Shape 4\n * from being permitted to interact with shapes 2 and 3.\n *

\n * InteractionGroup's can be fairly expressive, but they are strictly less powerful than\n * InteractionFilters. InteractionGroup's have their place however as there is no limit\n * to the number of Groups you can use.\n */\n@:final#if nape_swc@:keep #end\nclass InteractionGroup{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionGroup=null;\n /**\n * Parent group in InteractionGroup tree.\n * @default null\n */\n #if nape_swc@:isVar #end\n public var group(get_group,set_group):Null;\n inline function get_group():Null{\n return if(zpp_inner.group==null)null else zpp_inner.group.outer;\n }\n inline function set_group(group:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(group==this)throw \"Error: Cannot assign InteractionGroup to itself\";\n #end\n zpp_inner.setGroup(group==null?null:group.zpp_inner);\n }\n return get_group();\n }\n /**\n * Ignore property, set to true so that objects will not interact.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var ignore(get_ignore,set_ignore):Bool;\n inline function get_ignore():Bool{\n return zpp_inner.ignore;\n }\n inline function set_ignore(ignore:Bool):Bool{\n {\n if(this.ignore!=ignore){\n zpp_inner.invalidate(true);\n zpp_inner.ignore=ignore;\n }\n }\n return get_ignore();\n }\n /**\n * Set of active interactors using this group.\n *

\n * Active interactors meaning those that are part of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var interactors(get_interactors,never):InteractorList;\n inline function get_interactors():InteractorList{\n if(zpp_inner.wrap_interactors==null)zpp_inner.wrap_interactors=ZPP_InteractorList.get(zpp_inner.interactors,true);\n return zpp_inner.wrap_interactors;\n }\n /**\n * Immutable set of children of Interaction groups.\n *

\n * You cannot assign or remove children in this manner, you must do it via setting\n * the childs parent group to this/null.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var groups(get_groups,never):InteractionGroupList;\n inline function get_groups():InteractionGroupList{\n if(zpp_inner.wrap_groups==null)zpp_inner.wrap_groups=ZPP_InteractionGroupList.get(zpp_inner.groups,true);\n return zpp_inner.wrap_groups;\n }\n /**\n * Construct a new InteractionGroup.\n *\n * @param ignore Whether interactors should be ignored. (default false)\n */\n public function new(ignore=false){\n zpp_inner=new ZPP_InteractionGroup();\n zpp_inner.outer=this;\n this.ignore=ignore;\n }\n /**\n * @private\n */\n public function toString(){\n var ret=\"InteractionGroup\";\n if(ignore)ret+=\":ignore\";\n return ret;\n }\n}\n","package nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractionGroupIterator{\n /**\n * @private\n */\n public var zpp_inner:InteractionGroupList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:InteractionGroupIterator=null;\n /**\n * @private\n */\n public var zpp_next:InteractionGroupIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_InteractionGroupList.internal)throw \"Error: Cannot instantiate \"+\"InteractionGroup\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:InteractionGroupList){\n var ret=if(zpp_pool==null){\n ZPP_InteractionGroupList.internal=true;\n var ret=new InteractionGroupIterator();\n ZPP_InteractionGroupList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:InteractionGroup = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:InteractionGroup = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:InteractionGroup = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractionGroupList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractionGroupList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than InteractionGroup\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new InteractionGroupList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,InteractionGroup)#else Std.is(i,InteractionGroup)#end)throw \"Error: Array contains non \"+\"InteractionGroup\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new InteractionGroupList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:InteractionGroup):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):InteractionGroup{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():InteractionGroup{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():InteractionGroup{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:InteractionGroup):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:InteractionGroup):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"InteractionGroup\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return InteractionGroupIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new InteractionGroupList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"InteractionGroup\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:InteractionGroupList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_InteractionGroupList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:InteractionGroup->Void):InteractionGroupList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=InteractionGroupIterator.zpp_pool;\n InteractionGroupIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:InteractionGroup->Bool):InteractionGroupList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Note that in many cases of an AABB object being returned by a Nape function\n * the AABB object will be marked internally as an 'immutable' AABB. This will\n * always be documented and trying to mutate such an AABB will result in an\n * error being thrown.\n */\n@:final#if nape_swc@:keep #end\nclass AABB{\n /**\n * @private\n */\n public var zpp_inner:ZPP_AABB=null;\n /**\n * Construct a new AABB.\n *

\n * As input width/height are permitted to be negative it is not guaranteed\n * that the resultant AABB will have the same parameters as those\n * specified as the AABB parameters are guaranteed to always have positive\n * width/height, and for x/y to always be the top-left corner.\n *\n * @param x The x coordinate of the top-left corner of the AABB.\n * (default 0)\n * @param y The y coordinate of the top-left corner of the AABB\n * (default 0)\n * @param width The width of the AABB. This value may be negative.\n * (default 0)\n * @param height The height of the AABB. This value may be negative.\n * (default 0)\n * @return The newly constructed AABB object.\n */\n public function new(x:Float=0,y:Float=0,width:Float=0,height:Float=0){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: AABB position cannot be NaN\";\n }\n if((width!=width)||(height!=height)){\n throw \"Error: AABB dimensions cannot be NaN\";\n }\n #end\n zpp_inner=ZPP_AABB.get(x,y,x+width,y+height);\n zpp_inner.outer=this;\n }\n /**\n * Produce a copy of this AABB.\n *

\n * As would be expected, if you produce a copy of an 'immutable' AABB then\n * the copy will be 'mutable'.\n *\n * @return The copy of this AABB.\n */\n #if nape_swc@:keep #end\n public function copy(){\n zpp_inner.validate();\n return zpp_inner.copy().wrapper();\n }\n #if(flash9||openfl||nme)\n /**\n * Construct an AABB from an AS3 Rectangle object.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param rect The AS3 Rectangle to construct AABB from, this value\n * must not be null.\n * @return The constructed AABB matching the input Rectangle.\n * @throws # If the input rectangle is null.\n */\n #if nape_swc@:keep #end\n public static function fromRect(rect:flash.geom.Rectangle):AABB{\n #if(!NAPE_RELEASE_BUILD)\n if(rect==null){\n throw \"Error: Cannot create AABB from null Rectangle\";\n }\n #end\n return new AABB(rect.x,rect.y,rect.width,rect.height);\n }\n /**\n * Create an AS3 Rectangle object from AABB.\n *

\n * This method is available only on flash and\n * openfl||nme targets.\n *\n * @return The AS3 Rectangle object representing AABB.\n */\n #if nape_swc@:keep #end\n public function toRect():flash.geom.Rectangle{\n return new flash.geom.Rectangle(x,y,width,height);\n }\n #end\n /**\n * The minimum bounds for the AABB.\n *

\n * Euivalent to the top-left corner.\n *
\n * This Vec2 is intrinsically linked to the AABB so that modifications\n * to this object are reflected in changes to the AABB and vice-versa.\n *

\n * If the AABB is immutable, then this Vec2 will also be immutable.\n *

\n * This value can be set with the = operator, equivalent to performing\n * aabb.min.set(value).\n * @default (0, 0)\n */\n #if nape_swc@:isVar #end\n public var min(get_min,set_min):Vec2;\n inline function get_min():Vec2{\n return zpp_inner.getmin();\n }\n inline function set_min(min:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(min!=null&&min.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n if(min==null){\n throw \"Error: Cannot assign null to AABB::\"+\"min\";\n }\n if((x!=x)||(y!=y)){\n throw \"Error: AABB::\"+\"min\"+\" components cannot be NaN\";\n }\n if(\"min\"==\"min\"){\n if(min.x>max.x)throw \"Error: Assignment would cause negative width\";\n if(min.y>max.y)throw \"Error: Assignment would cause negative height\";\n }\n else{\n if(min.x
\n * Euivalent to the bottom-right corner.\n *
\n * This Vec2 is intrinsically linked to the AABB so that modifications\n * to this object are reflected in changes to the AABB and vice-versa.\n *

\n * If the AABB is immutable, then this Vec2 will also be immutable.\n *

\n * This value can be set with the = operator, equivalent to performing\n * aabb.max.set(value).\n * @default (0, 0)\n */\n #if nape_swc@:isVar #end\n public var max(get_max,set_max):Vec2;\n inline function get_max():Vec2{\n return zpp_inner.getmax();\n }\n inline function set_max(max:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(max!=null&&max.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n if(max==null){\n throw \"Error: Cannot assign null to AABB::\"+\"max\";\n }\n if((x!=x)||(y!=y)){\n throw \"Error: AABB::\"+\"max\"+\" components cannot be NaN\";\n }\n if(\"max\"==\"min\"){\n if(max.x>max.x)throw \"Error: Assignment would cause negative width\";\n if(max.y>max.y)throw \"Error: Assignment would cause negative height\";\n }\n else{\n if(max.x
\n * Equivalent to accessing/mutating min.x.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n zpp_inner.validate();\n return zpp_inner.minx;\n }\n inline function set_x(x:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.x!=x){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x))throw \"Error: AABB::\"+\"x\"+\" cannot be NaN\";\n #end\n zpp_inner.maxx+=x-zpp_inner.minx;\n zpp_inner.minx=x;\n zpp_inner.invalidate();\n }\n }\n return get_x();\n }\n /**\n * The y coordinate of the AABB's top-left corner.\n *

\n * Equivalent to accessing/mutating min.y.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n zpp_inner.validate();\n return zpp_inner.miny;\n }\n inline function set_y(y:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.y!=y){\n #if(!NAPE_RELEASE_BUILD)\n if((y!=y))throw \"Error: AABB::\"+\"y\"+\" cannot be NaN\";\n #end\n zpp_inner.maxy+=y-zpp_inner.miny;\n zpp_inner.miny=y;\n zpp_inner.invalidate();\n }\n }\n return get_y();\n }\n /**\n * width of AABB.\n *

\n * This value is and must always be positive.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var width(get_width,set_width):Float;\n inline function get_width():Float{\n zpp_inner.validate();\n return zpp_inner.width();\n }\n inline function set_width(width:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.width!=width){\n #if(!NAPE_RELEASE_BUILD)\n if((width!=width)){\n throw \"Error: AABB::\"+\"width\"+\" cannot be NaN\";\n }\n if(width<0){\n throw \"Error: AABB::\"+\"width\"+\" (\"+width+\") must be >= 0\";\n }\n #end\n zpp_inner.maxx=this.x+width;\n zpp_inner.invalidate();\n }\n }\n return get_width();\n }\n /**\n * height of AABB.\n *

\n * This value is and must always be positive.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var height(get_height,set_height):Float;\n inline function get_height():Float{\n zpp_inner.validate();\n return zpp_inner.height();\n }\n inline function set_height(height:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._immutable){\n throw \"Error: AABB is immutable\";\n }\n #end\n if(this.height!=height){\n #if(!NAPE_RELEASE_BUILD)\n if((height!=height)){\n throw \"Error: AABB::\"+\"height\"+\" cannot be NaN\";\n }\n if(height<0){\n throw \"Error: AABB::\"+\"height\"+\" (\"+height+\") must be >= 0\";\n }\n #end\n zpp_inner.maxy=this.y+height;\n zpp_inner.invalidate();\n }\n }\n return get_height();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n zpp_inner.validate();\n return zpp_inner.toString();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing the results of a convex cast operation.\n *

\n * These objects are allocated from an object pool and can\n * be released back to that pool by calling its dispose method.\n */\n@:final#if nape_swc@:keep #end\nclass ConvexResult{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexRayResult=null;\n /**\n * The normal of the surface at collision.\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.normal;\n }\n /**\n * The position of the collision.\n */\n #if nape_swc@:isVar #end\n public var position(get_position,never):Vec2;\n inline function get_position():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.position;\n }\n /**\n * The time of impact to the collision\n */\n #if nape_swc@:isVar #end\n public var toi(get_toi,never):Float;\n inline function get_toi():Float{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.toiDistance;\n }\n /**\n * The shape which was collided against.\n */\n #if nape_swc@:isVar #end\n public var shape(get_shape,never):Shape;\n inline function get_shape():Shape{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.shape;\n }\n /**\n * @private\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexRayResult.internal)throw \"Error: ConvexResult cannot be instantiated derp!\";\n #end\n }\n /**\n * Release ConvexResult object to pool.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n zpp_inner.free();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return \"{ shape: \"+shape+\" toi: \"+toi+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConvexResultIterator{\n /**\n * @private\n */\n public var zpp_inner:ConvexResultList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ConvexResultIterator=null;\n /**\n * @private\n */\n public var zpp_next:ConvexResultIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexResultList.internal)throw \"Error: Cannot instantiate \"+\"ConvexResult\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ConvexResultList){\n var ret=if(zpp_pool==null){\n ZPP_ConvexResultList.internal=true;\n var ret=new ConvexResultIterator();\n ZPP_ConvexResultList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:ConvexResult = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:ConvexResult = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:ConvexResult = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ConvexResultList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexResultList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than ConvexResult\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ConvexResultList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,ConvexResult)#else Std.is(i,ConvexResult)#end)throw \"Error: Array contains non \"+\"ConvexResult\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ConvexResultList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:ConvexResult):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):ConvexResult{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n else zpp_inner.inner.add(obj);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():ConvexResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():ConvexResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:ConvexResult):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:ConvexResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"ConvexResult\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ConvexResultIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ConvexResultList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"ConvexResult\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ConvexResultList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ConvexResultList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:ConvexResult->Void):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ConvexResultIterator.zpp_pool;\n ConvexResultIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:ConvexResult->Bool):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This class represents a general Polygon, rather than the Polygon class\n * which is physics shape.\n *

\n * Internally this polygon is stored as a circularly linked list of special\n * vertex types that are exposed via a Vec2 that is lazily constructed whenever\n * necessary to the API.\n */\n@:final#if nape_swc@:keep #end\nclass GeomPoly{\n /**\n * @private\n */\n public var zpp_pool:GeomPoly=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * @private\n */\n public var zpp_inner:ZPP_GeomPoly=null;\n /**\n * Determine if polygon is empty.\n *\n * @return True if polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return(zpp_inner.vertices==null);\n }\n /**\n * Determine number of vertices in polygon\n *\n * @return The number of vertices.\n * @throws # If this GeomPoly has been disposed.\n */\n public function size():Int{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n });\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function iterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,true);\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * Iterating in a forward direction.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function forwardIterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,true);\n }\n /**\n * Haxe iterator over vertices of polygon.\n *\n * @return A Haxe iterator over the vertices of the polygon.\n * Iterating in a backwards direction.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function backwardsIterator():GeomVertexIterator{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return ZPP_GeomVertexIterator.get(zpp_inner.vertices,false);\n }\n /**\n * Current vertex at head of polygon.\n *

\n * The current vertex will not be changed by this access.\n *

\n * This function returns a Vec2 which will be intrinsically tied\n * to the values of the internal vertex so that modifications to\n * this Vec2 will be reflected in the vertex of the polygon.\n *

\n * If invoked again with the head of the polygon pointing to the\n * same vertex, then the same Vec2 will be returned; this Vec2 is\n * not able to be disposed of.\n *\n * @return A Vec2 representing the current vertex of polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function current():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: GeomPoly is empty\";\n }\n #end\n return zpp_inner.vertices.wrapper();\n }\n /**\n * Push vertex to polygon.\n *

\n * A vertex will be allocated from a global object pool, and initialised\n * with the values of the given Vec2.\n *

\n * This vertex will be inserted after the current head, and the head\n * advanced to the newly inserted vertex, in this way successive pushes\n * will insert elements in order.\n *

\n * Note that the Vec2 supplied as argument is only used to initialise the\n * inner Vertex.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.push(X);\n     *\n     * poly := -> A <-> B <-> X <-> C <-> D <-> E <-\n     *                      (head)\n     * 
\n *\n * @param vertex The Vec2 to be used in initialising the inner vertex.\n * @return A reference to this polygon.\n * @throws # If Vec2 is null, or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function push(vertex:Vec2):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vertex!=null&&vertex.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vertex==null){\n throw \"Error: Cannot push null vertex\";\n }\n #end\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(vertex.x,vertex.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n ({\n if(({\n vertex.zpp_inner.weak;\n })){\n vertex.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Pop vertex from polygon.\n *

\n * Pop the current vertex at head of polygon, retreating the 'current'\n * vertex to point to the previous vertex in polygon. This inner vertex\n * will be released to the global object pool.\n *

\n * In this way a pop which follows a push will act to reset the push.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.pop();\n     *\n     * poly := -> A <-> C <-> D <-> E <-\n     *          (head)\n     * 
\n *\n * @return A reference to this polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function pop():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((zpp_inner.vertices==null)){\n throw \"Error: Cannot pop from empty polygon\";\n }\n #end\n var retv=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list derpiderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n null;\n }\n else{\n var retnodes=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n return this;\n }\n /**\n * Unshift vertex to polygon.\n *

\n * A vertex will be allocated from a global object pool, and initialised\n * with the values of the given Vec2.\n *

\n * This vertex will be inserted before the current head, and the head\n * retreated to the newly inserted vertex, in this way successive unshifts\n * will insert elements in the expected reverse order.\n *

\n * Note that the Vec2 supplied as argument is only used to initialise the\n * inner Vertex.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.unshift(X);\n     *\n     * poly := -> A <-> X <-> B <-> C <-> D <-> E <-\n     *                (head)\n     * 
\n *\n * @param vertex The Vec2 to be used in initialising the inner vertex.\n * @return A reference to this polygon.\n * @throws # If Vec2 is null, or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function unshift(vertex:Vec2):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vertex!=null&&vertex.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vertex==null){\n throw \"Error: Cannot unshift null vertex\";\n }\n #end\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(vertex.x,vertex.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.next=zpp_inner.vertices;\n obj.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=obj;\n zpp_inner.vertices.prev=obj;\n }\n obj;\n };\n ({\n if(({\n vertex.zpp_inner.weak;\n })){\n vertex.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Shift vertex from polygon.\n *

\n * Shift the current vertex at head of polygon, advancing the 'current'\n * vertex to point to the next vertex in polygon. This inner vertex\n * will be released to the global object pool.\n *

\n * In this way a shift which follows an unshift will act to reset the\n * unshift operation.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.shift();\n     *\n     * poly := -> A <-> C <-> D <-> E <-\n     *                (head)\n     * 
\n *\n * @return A reference to this polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function shift():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((zpp_inner.vertices==null)){\n throw \"Error: Cannot shift from empty polygon\";\n }\n #end\n var retv=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n return this;\n }\n /**\n * Advance head of polygon forward.\n *

\n * The current head of polygon will be moved forwards\n * the given number of times, with a negative value\n * being equivalent to performing a backwards advance.\n *

\n * poly.skip_forwards(times) is equivalent to\n * poly.skip_backwards(-times)\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.skipForwards(2);\n     *\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                            (head)\n     * 
\n *\n * @params times The number of times to advance head forward.\n * This value can be negative indicating a backwards\n * advance.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function skipForward(times:Int):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(!(zpp_inner.vertices==null)){\n if(times>0){\n while(times-->0)zpp_inner.vertices=zpp_inner.vertices.next;\n }\n else if(times<0){\n while(times++<0)zpp_inner.vertices=zpp_inner.vertices.prev;\n }\n }\n return this;\n }\n /**\n * Advance head of polygon backwards.\n *

\n * The current head of polygon will be moved backwards\n * the given number of times, with a negative value\n * being equivalent to performing a forwards advance.\n *

\n * poly.skip_backwards(times) is equivalent to\n * poly.skip_forwards(-times)\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly.skipBackwards(2);\n     *\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                                  (head)\n     * 
\n *\n * @params times The number of times to advance head backwards.\n * This value can be negative indicating a forwards\n * advance.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function skipBackwards(times:Int){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return skipForward(-times);\n }\n /**\n * Erase count number of elements\n *

\n * For positive values of count, this is equivalent to successive\n * unshift operations.\n *

\n * For negative values of count, this is equivalent to successive\n * pop operations.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-> F <-> G <-\n     *                (head)\n     *\n     * poly.erase(2);\n     *\n     * poly := -> A <-> D <-> E <-> F <-> G <-\n     *                (head)\n     *\n     * poly.erase(-3);\n     *\n     * poly := -> E <-> F <-\n     *                (head)\n     * 
\n * In this case that the specified number of elements to erase is\n * greater than the size of the polygon, the method will simply\n * terminate with the polygon being empty.\n *\n * @param count The number of vertices to erase, with sign indicating\n * the direction for erasing.\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function erase(count:Int):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n while(count!=0&&!(zpp_inner.vertices==null)){\n var retv=zpp_inner.vertices;\n if(count>0){\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n count--;\n }\n else if(count<0){\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list derpiderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n null;\n }\n else{\n var retnodes=zpp_inner.vertices.prev;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n count++;\n }\n {\n var o=retv;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"retv\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n }\n return this;\n }\n /**\n * Clear all vertices from polygon.\n *

\n * All of the vertices will be released to the global object pool.\n *\n * @return A reference to this polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function clear():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n while(!(zpp_inner.vertices==null)){\n var tmp=zpp_inner.vertices;\n zpp_inner.vertices={\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(zpp_inner.vertices==null);\n };\n if(!res)throw \"assert(\"+\"!(zpp_inner.vertices==null)\"+\") :: \"+(\"can't pop from empty list herpaderp\");\n #end\n };\n if((zpp_inner.vertices!=null&&zpp_inner.vertices.prev==zpp_inner.vertices)){\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n }\n else{\n var retnodes=zpp_inner.vertices.next;\n zpp_inner.vertices.prev.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=zpp_inner.vertices.prev;\n zpp_inner.vertices.next=zpp_inner.vertices.prev=null;\n {};\n zpp_inner.vertices=null;\n retnodes;\n }\n };\n {\n var o=tmp;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_GeomVert\"+\", in obj: \"+\"tmp\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT++;\n ZPP_GeomVert.POOL_SUB++;\n #end\n };\n }\n };\n return this;\n }\n /**\n * Copy this polygon.\n *

\n * The copy will have its vertices in the same order as 'this' polygon.\n * It will also have its current vertex at head, as the same vertex\n * this polygon has.\n *

\n * This polygon will not be modified in any way.\n *
\n     * poly := -> A <-> B <-> C <-> D <-> E <-\n     *                (head)\n     *\n     * poly2 = poly.copy();\n     *\n     * poly2 := -> A' <-> B' <-> C' <-> D' <-> E' <-\n     *                  (head)\n     * 
\n *\n * @return The new GeomPoly representing the copy.\n * @throws # If this GeomPoly has been disposed.\n */\n public function copy():GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=GeomPoly.get();\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return ret.skipForward(1);\n }\n /**\n * Create a new GeomPoly polygon.\n *

\n * The vertices argument is typed Dynamic (* in AS3), and is permitted\n * to be one of: Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *

\n * The input will be used to initialise the vertices of the polygon with\n * the head of the polygon pointing to the first vertex in input with vertices\n * inserted in forward order.\n *

\n * You should use the static 'get' method in preference to make use of object pool.\n *\n * @param vertices Vertex data to initialise polygon, or null for empty polygon.\n * @return New GeomPoly representing input vertex data.\n * @throws # If input data is not of an expected Type.\n */\n public function new(vertices:Dynamic=null){\n zpp_inner=new ZPP_GeomPoly(this);\n if(vertices!=null){\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash10 untyped __is__(vertices,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n #end\n }\n else if(#if flash untyped __is__(vertices,Vec2List)#else Std.is(vertices,Vec2List)#end){\n var lv:Vec2List=vertices;\n for(v in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(v==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash untyped __is__(vertices,GeomPoly)#else Std.is(vertices,GeomPoly)#end){\n var lv:GeomPoly=vertices;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var v=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n {\n zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(zpp_inner.vertices==null)zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=zpp_inner.vertices;\n obj.next=zpp_inner.vertices.next;\n zpp_inner.vertices.next.prev=obj;\n zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n v.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n skipForward(1);\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n var i=0;\n while(i=vertices;\n if(!lv.fixed){\n var i:Int=0;\n while(i
\n * The vertices argument is typed Dynamic (* in AS3), and is permitted\n * to be one of: Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *

\n * The input will be used to initialise the vertices of the polygon with\n * the head of the polygon pointing to the first vertex in input with vertices\n * inserted in forward order.\n *\n * @param vertices Vertex data to initialise polygon, or null for empty polygon.\n * @return New GeomPoly representing input vertex data, allocated from object pool.\n * @throws # If input data is not of an expected Type.\n */\n public static function get(vertices:Dynamic=null){\n var ret;\n {\n if(ZPP_PubPool.poolGeomPoly==null){\n ret=new GeomPoly();\n #if NAPE_POOL_STATS GeomPoly.POOL_TOT++;\n GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolGeomPoly;\n ZPP_PubPool.poolGeomPoly=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextGeomPoly)ZPP_PubPool.nextGeomPoly=null;\n #end\n #if NAPE_POOL_STATS GeomPoly.POOL_CNT--;\n GeomPoly.POOL_ADD++;\n #end\n }\n };\n if(vertices!=null){\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash10 untyped __is__(vertices,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=vertices;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var v:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n #end\n }\n else if(#if flash untyped __is__(vertices,Vec2List)#else Std.is(vertices,Vec2List)#end){\n var lv:Vec2List=vertices;\n for(v in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(v==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(v!=null&&v.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n }\n }\n else if(#if flash untyped __is__(vertices,GeomPoly)#else Std.is(vertices,GeomPoly)#end){\n var lv:GeomPoly=vertices;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var v=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n {\n ret.zpp_inner.vertices={\n var obj=ZPP_GeomVert.get(v.x,v.y);\n if(ret.zpp_inner.vertices==null)ret.zpp_inner.vertices=obj.prev=obj.next=obj;\n else{\n obj.prev=ret.zpp_inner.vertices;\n obj.next=ret.zpp_inner.vertices.next;\n ret.zpp_inner.vertices.next.prev=obj;\n ret.zpp_inner.vertices.next=obj;\n }\n obj;\n };\n };\n v.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n ret.skipForward(1);\n {\n if(#if flash untyped __is__(vertices,Array)#else Std.is(vertices,Array)#end){\n var lv:Array=vertices;\n var i=0;\n while(i=vertices;\n if(!lv.fixed){\n var i:Int=0;\n while(i
\n * Once disposed this GeomPoly will be accessible to Nape internals for re-allocation\n * and should not be touched (Good practice would be to set any references to this\n * GeomPoly to null to help ensure this).\n *

\n * In debug mode, should you attempt to access this GeomPoly after disposal\n * and the GeomPoly is still in the object pool, you will be given an Error.\n * The object pool operates on a First-In-Last-Out principal in debug mode to help\n * catch these sort of errors.\n * @throws # If this GeomPoly has already been disposed.\n */\n public function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n clear();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"GeomPoly\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextGeomPoly!=null)ZPP_PubPool.nextGeomPoly.zpp_pool=o;\n else ZPP_PubPool.poolGeomPoly=o;\n ZPP_PubPool.nextGeomPoly=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolGeomPoly;\n ZPP_PubPool.poolGeomPoly=o;\n #end\n #if NAPE_POOL_STATS GeomPoly.POOL_CNT++;\n GeomPoly.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n var ret=\"GeomPoly[\";\n {\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n if(v!=zpp_inner.vertices)ret+=\",\";\n ret+=\"{\"+v.x+\",\"+v.y+\"}\";\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n }\n return ret+\"]\";\n }\n /**\n * Compute area of weakly-simple polygon.\n *

\n * For complex polygons, this function will return an underestimate\n * to the true area.\n *\n * @return The area of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function area():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))0.0 else({\n var ret=({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var area=0.0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n area+=v.x*(v.next.y-v.prev.y);\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n area*0.5;\n });\n if(ret<0)(-ret)else ret;\n });\n }\n /**\n * Compute the winding order for this polygon.\n *

\n * The winding order can be conceptualised by thinking of an analog\n * clock face, if your polygon is the numbers on the clock then a\n * clockwise winding would have your polygon's vertices in numerical\n * order.\n *

\n * In the case of a non-simple polygon with self intersections then the\n * winding order is decided by how 'much' of the polygon is locally\n * clockwise wound, and how much is locally anti-clockwise wound.\n *
\n * (Think of a figure 8 style polygon where one loop is larger than the\n * other. This larger loop will dictate the winding of the polygon.)\n *

\n * If no winding can be computed, then Winding.UNDEFINED\n * will be returned.\n *\n * @return The winding of the polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function winding():Winding{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n return Winding.UNDEFINED;\n }\n else{\n var area=({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var area=0.0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n area+=v.x*(v.next.y-v.prev.y);\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n area*0.5;\n });\n return if(area>0)Winding.CLOCKWISE else if(area==0)Winding.UNDEFINED else Winding.ANTICLOCKWISE;\n }\n }\n /**\n * Determine if point is contained in polygon.\n *

\n * Polygon containment is performed with a ray cast through polygon\n * from the vertex and counting the number of intersections. In this\n * way containment will be defined for self-intersecting polygons based\n * on how such a polygon would be rendered with areas of self-intersection\n * treat as being 'outside' the polygon.\n *

\n * This algorithm operates in O(n) time.\n *\n * @param point The point to test for containment.\n * @return True if point is contained in the polygon.\n * @throws # If point is null or has been disposed.\n * @throws # If this GeomPoly has been disposed.\n */\n public function contains(point:Vec2):Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: GeomPoly::contains point cannot be null\";\n }\n #end\n var ret=({\n var x=point.x;\n var y=point.y;\n var ret=false;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var p=nite;\n {\n {\n var q=p.prev;\n if((p.y=y||q.y=y)&&(p.x<=x||q.x<=x)){\n if((p.x+(y-p.y)/(q.y-p.y)*(q.x-p.x))
\n * This is equivalent to poly.winding() == Winding.CLOCKWISE.\n *\n * @return True if polygon is clockwise wound.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isClockwise():Bool{\n return winding()==Winding.CLOCKWISE;\n }\n /**\n * Determine if weakly-simple polygon is convex.\n *

\n * This algorithm assumes that the polygon is weakly-simple. Otherwise it may\n * fail (It is very easy to construct a self intersecting polygon which\n * will return True for isConvex()).\n *

\n * You may wish to instead use isSimple() && isConvex() if\n * you cannot be sure of the polygon being simple, noting that this will\n * of course return false in the case of a weakly-simple polygon.\n *
\n     *  _____\n     * |     |\n     * |     |  <-- convex\n     * |____/\n     *  __\n     * |  \___\n     * |     /  <-- concave\n     * |____/\n     * 
\n * This algorithm operates in O(n) time.\n *\n * @return True if polygon is found to be convex.\n * @throws # If this GeomPoly has been disposed.\n */\n public function isConvex():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else({\n {\n #if NAPE_ASSERT if(({\n var ret=0;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var i=nite;\n {\n ret++;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n })<3){\n throw \"Error: Method requires that polygon has atleast 3 vertices\";\n }\n #end\n };\n var neg=false;\n var pos=false;\n var ret=true;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n var u=v.prev;\n var w=v.next;\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>0.0){\n pos=true;\n }\n else if(dot<0.0){\n neg=true;\n }\n if(pos&&neg){\n ret=false;\n break;\n }\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n ret;\n });\n }\n /**\n * Determine if polygon is strictly simple.\n *

\n * By strict simplicity, we refer to not permitting 'glancing'\n * self intersections (where boundary of polygon 'touches' but does not\n * pass through another area of the polygon's boundary). This property\n * is instead referred to as being 'weakly simple' for which there is no\n * easy test!\n *
\n     *  _______\n     * |   __  |  <-- strictly simple polygon.\n     * |   \ \_|\n     *  \__/\n     *  _______\n     * |   |   |\n     * |  /_\  | <-- weakly simple polygon.\n     *  \_____/\n     *  ____\n     * | __/\n     *  X_  __   <-- complex polygon.\n     * |  \/  \\n     * \__/\__|\n     * 
\n * This algorithm operates in O(n.log(n)) time.\n *\n * @return True if polygon is strictly simple.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isSimple():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else ZPP_Simple.isSimple(zpp_inner.vertices);\n }\n /**\n * Determine if polygon is y-monotone.\n *

\n * To be classed as y-monotone, the polygon must be such that any horizontal\n * line intersects the polygon in at most 2 intersections.\n *
\n     *  ___\n     * |   |\n     * |   |  <-- y-monotone\n     * |___|\n     *\n     * |\\n     * | \/|  <-- not y-monotone, offending vertex at bottom of the V.\n     * |___|\n     * 
\n * This algorithm operates in O(n) time.\n *\n * @return True if polygon is y-monotone.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isMonotone():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else ZPP_Monotone.isMonotone(zpp_inner.vertices);\n }\n /**\n * Determine if weakly-simple polygon is degenerate.\n *

\n * Degeneracy is determined by having a zero area, if polygon is complex,\n * then this function may report degeneracy erroneously.\n *\n * @return True if polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isDegenerate():Bool{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n return if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n }))true else area()
\n * Simplification is performed with an implementation of the Ramer-Douglas-Peucker\n * algorithm. The output polygon is formed via subset of the vertices in\n * the input polygon such that any discarded vertex is at most 'epsilon' pixels\n * away from the local output polygon.\n *

\n * This algorithm works on both simple and complex polygons, but please note\n * that this algorithm makes no guarantees on a simple polygon remaining simple\n * after simplification. This should not generally be a problem unless the epsilon\n * value is large with respect to the size of the features on the polygon.\n *

\n * Many of the geometric algorithms will mark vertices as important, such that\n * they will be guaranteed to exist after simplification (Such as preventing\n * gaps from opening up in marching squares when simplifying output polygons).\n *

\n * The average runtime of this algorithm is O(n.log(n)). This algorithm is\n * not stable in the sense that adding a new vertex to the polygon may drastically\n * change the result of simplifying the polygon.\n *\n * @param epsilon The distance from polygon at which vertices are ignored.\n * @return A new GeomPoly representing the result of the simplification.\n * @throws # If epsilon is <= 0.\n * @throws # If this GeomPoly has been disposed.\n */\n public function simplify(epsilon:Float):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(epsilon<=0.0){\n throw \"Error: Epsilon should be > 0 for simplifying a GeomPoly\";\n }\n #end\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n return copy();\n }\n else{\n var x=ZPP_Simplify.simplify(zpp_inner.vertices,epsilon);\n var ret=GeomPoly.get();\n ret.zpp_inner.vertices=x;\n return ret;\n }\n }\n /**\n * Produce a decomposition of complex polygon into simple components.\n *

\n * WARNING: This method is 'not' 100% robust. It may fail!\n *

\n * Produce a decomposition of a self intersecting, complex polygon into\n * a set of weakly-simple components.\n *

\n * This algorithm operates in O(n.log(n)) time and is based on the\n * Bentley-Ottmann algorithm.\n *\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's representing the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # Any other error may be thrown if algorithm has failed, even\n * in release builds!\n * @throws # If this GeomPoly has been disposed.\n */\n public function simpleDecomposition(output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var MPs=ZPP_Simple.decompose(zpp_inner.vertices,ZPP_PartitionedPoly.getShared());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MP;\n ret.add(x);\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into monotone components.\n *

\n * This algorithm 'should' be 100% robust and has been well tested on for\n * example, the output of the Marching Squares utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time and may strip vertices from\n * the polygon in degenerate cases where vertex is not needed to define the\n * polygon.\n *

\n * This algorithm is an improved version of the one presented in: Mark de\n * Berg, Marc van Kreveld, Mark Overmars, and Otfried Schwarzkopf.\n * Computational Geometry: Algorithms and Applications. Springer-Verlag,\n * Berlin, 1997.\n \n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function monotoneDecomposition(output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract(ZPP_PartitionedPoly.getShared());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MP;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.isMonotone();\n };\n if(!res)throw \"assert(\"+\"x.isMonotone()\"+\") :: \"+(\"monotone decomposition gave non-monotone output?\");\n #end\n };\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into convex components.\n *

\n * This algorithm 'should' be 100% robust and has been well test on for\n * example, the output of the Marching Squars utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time and will produce no more than\n * 4 times the number of convex poylgons in a minimal decomposition in the\n * worst case scenario.\n *

\n * Vertices may be stripped from the polygon that are found to not be\n * necessary as part of making this algorithm robust.\n *\n * @param delaunay This algorithm first performs a triangulation, if this field\n * is true, then this triangulation will be made delaunay and may\n * produce better convex polygons resultanly (default false).\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function convexDecomposition(delaunay:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract_partitions(ZPP_PartitionedPoly.getSharedPP());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n ZPP_Triangular.triangulate(MP);\n if(delaunay){\n ZPP_Triangular.optimise(MP);\n }\n ZPP_Convex.optimise(MP);\n var MQs=MP.extract(ZPP_PartitionedPoly.getShared());\n {\n var o=MP;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_PartitionedPoly\"+\", in obj: \"+\"MP\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_PartitionedPoly.zpp_pool;\n ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_PartitionedPoly.POOL_CNT++;\n ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n while(!MQs.empty()){\n var MQ=MQs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MQ;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.isConvex();\n };\n if(!res)throw \"assert(\"+\"x.isConvex()\"+\") :: \"+(\"convex decomposition gave non-convex output?\");\n #end\n };\n }\n }\n return ret;\n }\n /**\n * Produce a decomposition of weakly-simple polygon into triangles.\n *

\n * This algorithm 'should' be 100% robust and has been well test on for\n * example, the output of the Marching Squars utility which produces many\n * degenerate cases of weakly-simple polygons that have not yet broken this\n * algorithm!.\n *

\n * This algorithm operates in O(n.log(n)) time.\n *

\n * Vertices may be stripped from the polygon that are found to not be\n * necessary as part of making this algorithm robust.\n *\n * @param delaunay If true, then an O(n^2) pass will be made to mutate the original\n * triangulation to push it into a delanuay triangulation. (default false)\n * @param output If supplied, polygons will be appended to this list via 'add'\n * instead of a new list being constructed.\n * @return A Nape list of GeomPoly's defining the decomposition.\n * @throws # If polygon is degenerate.\n * @throws # If this GeomPoly has been disposed.\n */\n public function triangularDecomposition(delaunay:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(({\n zpp_inner.vertices==null||zpp_inner.vertices.next==null||zpp_inner.vertices.prev==zpp_inner.vertices.next;\n })){\n throw \"Error: Cannot decompose a degenerate polygon\";\n }\n #end\n var poly=ZPP_Monotone.decompose(zpp_inner.vertices,ZPP_Monotone.getShared());\n var MPs=poly.extract_partitions(ZPP_PartitionedPoly.getSharedPP());\n var ret=(output==null?new GeomPolyList():output);\n while(!MPs.empty()){\n var MP=MPs.pop_unsafe();\n ZPP_Triangular.triangulate(MP);\n if(delaunay){\n ZPP_Triangular.optimise(MP);\n }\n var MQs=MP.extract(ZPP_PartitionedPoly.getShared());\n {\n var o=MP;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_PartitionedPoly\"+\", in obj: \"+\"MP\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_PartitionedPoly.zpp_pool;\n ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_PartitionedPoly.POOL_CNT++;\n ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n while(!MQs.empty()){\n var MQ=MQs.pop_unsafe();\n var x=GeomPoly.get();\n x.zpp_inner.vertices=MQ;\n ret.add(x);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.size()==3;\n };\n if(!res)throw \"assert(\"+\"x.size()==3\"+\") :: \"+(\"triangular decomosition gave non-triangle output?\");\n #end\n };\n }\n }\n return ret;\n }\n /**\n * Inflate/Deflate polygon.\n *

\n * This algorithm does not attempt to deal with any self-intersections which may\n * result from the process. Gaps are joined with a miter joint.\n *

\n * This algorithm will work for self-intersecting polygons, though the results\n * may not be what you expect; some parts will be inflated, and some deflated\n * depending on the local winding. You should probably avoid using this on\n * self-intersecting polygons.\n *\n * @param inflation The number of pixels to inflate polygon by. To deflate\n * use a negative value.\n * @return The inflated polygon.\n * @throws # If this GeomPoly has been disposed.\n */\n public function inflate(inflation:Float):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=GeomPoly.get();\n if(isClockwise())inflation=-inflation;\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var p=nite;\n {\n {\n var prev=p.prev;\n var next=p.next;\n var ax:Float=0.0;\n var ay:Float=0.0;\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n ax=p.x-prev.x;\n ay=p.y-prev.y;\n };\n {\n bx=next.x-p.x;\n by=next.y-p.y;\n };\n var apx:Float=0.0;\n var apy:Float=0.0;\n var bpx:Float=0.0;\n var bpy:Float=0.0;\n {\n apx=ax;\n apy=ay;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((apx!=apx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(apx)\"+\") :: \"+(\"vec_set(in n: \"+\"ap\"+\",in x: \"+\"ax\"+\",in y: \"+\"ay\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((apy!=apy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(apy)\"+\") :: \"+(\"vec_set(in n: \"+\"ap\"+\",in x: \"+\"ax\"+\",in y: \"+\"ay\"+\")\");\n #end\n };\n };\n {\n {\n var d=(apx*apx+apy*apy);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"ap\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"ap\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n apx*=t;\n apy*=t;\n };\n };\n {\n var t=apx;\n apx=-apy;\n apy=t;\n };\n };\n {\n var t=(inflation);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"ap\"+\",in s: \"+\"inflation\"+\")\");\n #end\n };\n apx*=t;\n apy*=t;\n };\n {\n bpx=bx;\n bpy=by;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((bpx!=bpx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(bpx)\"+\") :: \"+(\"vec_set(in n: \"+\"bp\"+\",in x: \"+\"bx\"+\",in y: \"+\"by\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((bpy!=bpy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(bpy)\"+\") :: \"+(\"vec_set(in n: \"+\"bp\"+\",in x: \"+\"bx\"+\",in y: \"+\"by\"+\")\");\n #end\n };\n };\n {\n {\n var d=(bpx*bpx+bpy*bpy);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"bp\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"bp\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n bpx*=t;\n bpy*=t;\n };\n };\n {\n var t=bpx;\n bpx=-bpy;\n bpy=t;\n };\n };\n {\n var t=(inflation);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"bp\"+\",in s: \"+\"inflation\"+\")\");\n #end\n };\n bpx*=t;\n bpy*=t;\n };\n var bapx:Float=0.0;\n var bapy:Float=0.0;\n {\n bapx=bpx-apx;\n bapy=bpy-apy;\n };\n var num=(by*bapx-bx*bapy);\n var t=if(num==0)0 else(num/(by*ax-bx*ay));\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=p.x+apx;\n py=p.y+apy;\n };\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p\"+\",in b: \"+\"a\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n px+=ax*t;\n py+=ay*t;\n };\n ret.push(Vec2.get(px,py));\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return ret.skipForward(1);\n }\n /**\n * Cut simple polygon with line.\n *

\n * The result of this operation will be a list of new GeomPoly representing\n * the connected regions of the polygon after an imaginary cut is made.\n *
\n     * (Result of cut assuming\n     *  boundedStart = true)       _\n     *   /\    _             /\   / \\n     *  /  \  / \           /  \ '---'\n     * / o--\/---\-->  =>  /    \,---,\n     * \_________/         \_________/\n     * 
\n * This algorithm runs in average case O(n.log(n)) time and worst case O(n^2).\n * For convex polygons, this algorithm runs in guaranteed O(n) time.\n *\n * @param start The start point for line segment\n * @param end The end point for line segment.\n * @param boundedStart If true, then the cut will not extend\n * beyond the start of the line segment.\n * (default false)\n * @param boundedEnd If true, then the cut will not extend\n * beyond the end of the line segment.\n * (default false)\n * @param output A GeomPolyList to append results to if supplied,\n * otherwise a new list is created (default null)\n * @return A list of GeomPoly representing the result of the cut.\n * @throws # If polygon is not simple.\n * @throws # If start or end Vec2 are null or disposed of.\n * @throws # If this GeomPoly has been disposed.\n */\n public function cut(start:Vec2,end:Vec2,boundedStart:Bool=false,boundedEnd:Bool=false,output:GeomPolyList=null):GeomPolyList{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(!isSimple()){\n throw \"Error: Cut requires a truly simple polygon\";\n }\n if(start==null||end==null){\n throw \"Error: Cannot cut with null start/end's\";\n }\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(start!=null&&start.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(end!=null&&end.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n var ret=ZPP_Cutter.run(zpp_inner.vertices,start,end,boundedStart,boundedEnd,output);\n ({\n if(({\n start.zpp_inner.weak;\n })){\n start.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n end.zpp_inner.weak;\n })){\n end.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Transform polygon by given matrix.\n *

\n * Any transformation (not just equiorthogonal ones) are permitted, though\n * a transformation that causes polygon to be come degenerate is a bit\n * pointless.\n *\n * @param matrix The matrix to transform polygon by.\n * @return A reference to this polygon.\n * @throws # If matrix is null.\n * @throws # If this GeomPoly has been disposed.\n */\n public function transform(matrix:Mat23):GeomPoly{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(matrix==null){\n throw \"Error: Cannot transform by null matrix\";\n }\n #end\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n {\n var t=matrix.a*v.x+matrix.b*v.y+matrix.tx;\n v.y=matrix.c*v.x+matrix.d*v.y+matrix.ty;\n v.x=t;\n };\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return this;\n }\n /**\n * Determine bounds of polygon.\n *\n * @return A new AABB representing bounds of polygon.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function bounds():AABB{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable bounds\";\n }\n #end\n var minx:Float=ZPP_Const.FMAX;\n var miny:Float=ZPP_Const.FMAX;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minx!=minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minx)\"+\") :: \"+(\"vec_new(in n: \"+\"min\"+\",in x: \"+\"ZPP_Const.FMAX\"+\",in y: \"+\"ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((miny!=miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(miny)\"+\") :: \"+(\"vec_new(in n: \"+\"min\"+\",in x: \"+\"ZPP_Const.FMAX\"+\",in y: \"+\"ZPP_Const.FMAX\"+\")\");\n #end\n };\n var maxx:Float=-ZPP_Const.FMAX;\n var maxy:Float=-ZPP_Const.FMAX;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxx!=maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxx)\"+\") :: \"+(\"vec_new(in n: \"+\"max\"+\",in x: \"+\"-ZPP_Const.FMAX\"+\",in y: \"+\"-ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxy!=maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxy)\"+\") :: \"+(\"vec_new(in n: \"+\"max\"+\",in x: \"+\"-ZPP_Const.FMAX\"+\",in y: \"+\"-ZPP_Const.FMAX\"+\")\");\n #end\n };\n {\n var F=zpp_inner.vertices;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n {\n if(v.xmaxx)maxx=v.x;\n if(v.y>maxy)maxy=v.y;\n };\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return new AABB(minx,miny,maxx-minx,maxy-miny);\n }\n /**\n * Find top most vertex of polygon.\n *

\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the top most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function top():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable topmost vertex\";\n }\n #end\n var min=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.y
\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the bottom most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function bottom():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable bottommost vertex\";\n }\n #end\n var max=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.y>max.y)max=v;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return max.wrapper();\n }\n /**\n * Find left most vertex of polygon.\n *

\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the left most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function left():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable leftmost vertex\";\n }\n #end\n var min=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.x
\n * If there is more than one such vertex then the result is indeterminate.\n *

\n * The Vec2 returned is intrinsically tied to the inner vertex like that\n * returned by current(). This method will not alter the current vertex.\n * This Vec2 is not able to be disposed of.\n *\n * @return A Vec2 representing the right most vertex.\n * @throws # If polygon is empty.\n * @throws # If this GeomPoly has been disposed.\n */\n public function right():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(empty()){\n throw \"Error: empty GeomPoly has no defineable rightmmost vertex\";\n }\n #end\n var max=zpp_inner.vertices;\n {\n var F=zpp_inner.vertices.next;\n var L=zpp_inner.vertices;\n if(F!=null){\n var nite=F;\n do{\n var v=nite;\n {\n if(v.x>max.x)max=v;\n }\n nite=nite.next;\n }\n while(nite!=L);\n }\n };\n return max.wrapper();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass GeomPolyIterator{\n /**\n * @private\n */\n public var zpp_inner:GeomPolyList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:GeomPolyIterator=null;\n /**\n * @private\n */\n public var zpp_next:GeomPolyIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_GeomPolyList.internal)throw \"Error: Cannot instantiate \"+\"GeomPoly\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:GeomPolyList){\n var ret=if(zpp_pool==null){\n ZPP_GeomPolyList.internal=true;\n var ret=new GeomPolyIterator();\n ZPP_GeomPolyList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:GeomPoly = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:GeomPoly = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:GeomPoly = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass GeomPolyList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_GeomPolyList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than GeomPoly\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new GeomPolyList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,GeomPoly)#else Std.is(i,GeomPoly)#end)throw \"Error: Array contains non \"+\"GeomPoly\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new GeomPolyList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:GeomPoly):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):GeomPoly{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():GeomPoly{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():GeomPoly{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:GeomPoly):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:GeomPoly):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"GeomPoly\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return GeomPolyIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new GeomPolyList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"GeomPoly\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:GeomPolyList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_GeomPolyList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:GeomPoly->Void):GeomPolyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=GeomPolyIterator.zpp_pool;\n GeomPolyIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:GeomPoly->Bool):GeomPolyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i\n * [ a b tx ]\n * [ c d ty ]\n * [ 0 0 1 ]\n * \n *\n * Note that in AS3, flash.geom.Matrix has 'b' and 'c' swapped! so if you are\n * converting between flash.geom.Matrix and nape.geom.Mat23 you should use the\n * methods provided to avoid any mistakes with this.\n *\n */\n@:final#if nape_swc@:keep #end\nclass Mat23{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Mat23=null;\n /**\n * The (1,1) entry in Mat23:\n *

\n *
\n     * [ a  .  . ]\n     * [ .  .  . ]\n     * 
\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var a(get_a,set_a):Float;\n inline function get_a():Float{\n return zpp_inner.a;\n }\n inline function set_a(a:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((a!=a)){\n throw \"Error: Mat23::\"+\"a\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.a=a;\n zpp_inner.invalidate();\n }\n return get_a();\n }\n /**\n * The (1,2) entry in Mat23:\n *

\n *
\n     * [ .  b  . ]\n     * [ .  .  . ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var b(get_b,set_b):Float;\n inline function get_b():Float{\n return zpp_inner.b;\n }\n inline function set_b(b:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((b!=b)){\n throw \"Error: Mat23::\"+\"b\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.b=b;\n zpp_inner.invalidate();\n }\n return get_b();\n }\n /**\n * The (2,1) entry in Mat23:\n *

\n *
\n     * [ .  .  . ]\n     * [ c  .  . ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var c(get_c,set_c):Float;\n inline function get_c():Float{\n return zpp_inner.c;\n }\n inline function set_c(c:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((c!=c)){\n throw \"Error: Mat23::\"+\"c\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.c=c;\n zpp_inner.invalidate();\n }\n return get_c();\n }\n /**\n * The (2,2) entry in Mat23:\n *

\n *
\n     * [ .  .  . ]\n     * [ .  d  . ]\n     * 
\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var d(get_d,set_d):Float;\n inline function get_d():Float{\n return zpp_inner.d;\n }\n inline function set_d(d:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d)){\n throw \"Error: Mat23::\"+\"d\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.d=d;\n zpp_inner.invalidate();\n }\n return get_d();\n }\n /**\n * The (1,3) entry in Mat23 which represents x translation\n *

\n *
\n     * [ .  .  tx ]\n     * [ .  .  .  ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var tx(get_tx,set_tx):Float;\n inline function get_tx():Float{\n return zpp_inner.tx;\n }\n inline function set_tx(tx:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((tx!=tx)){\n throw \"Error: Mat23::\"+\"tx\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.tx=tx;\n zpp_inner.invalidate();\n }\n return get_tx();\n }\n /**\n * The (2,3) entry in Mat23 which represents y translation\n *

\n *
\n     * [ .  .  .  ]\n     * [ .  .  ty ]\n     * 
\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var ty(get_ty,set_ty):Float;\n inline function get_ty():Float{\n return zpp_inner.ty;\n }\n inline function set_ty(ty:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if((ty!=ty)){\n throw \"Error: Mat23::\"+\"ty\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.ty=ty;\n zpp_inner.invalidate();\n }\n return get_ty();\n }\n /**\n * Construct new Mat23.\n *

\n *
\n     * [ a  b  tx ]\n     * [ c  d  ty ]\n     * 
\n *\n * @param a The (1,1) entry in matrix (default 1)\n * @param b The (1,2) entry in matrix (default 0)\n * @param c The (2,1) entry in matrix (default 0)\n * @param d The (2,2) entry in matrix (default 1)\n * @param tx The (1,3) entry in matrix (default 0)\n * @param ty The (2,3) entry in matrix (default 0)\n * @return The newly constructed Mat23.\n */\n public function new(a:Float=1.0,b:Float=0.0,c:Float=0.0,d:Float=1.0,tx:Float=0.0,ty:Float=0.0){\n zpp_inner=ZPP_Mat23.get();\n zpp_inner.outer=this;\n this.a=a;\n this.b=b;\n this.tx=tx;\n this.c=c;\n this.d=d;\n this.ty=ty;\n }\n /**\n * Produce copy of this Mat23\n *\n * @return The new Mat23 representing copy of this.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return new Mat23(a,b,c,d,tx,ty);\n }\n /**\n * Set values of matrix from another.\n *\n * @param matrix The matrix to copy values from.\n * @return A reference to this Mat23.\n * @throws # if matrix argument is null.\n */\n public function set(matrix:Mat23):Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if(matrix==null){\n throw \"Error: Cannot set form null matrix\";\n }\n #end\n zpp_inner.set(matrix.zpp_inner);\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Set values of matrix from numbers.\n *

\n * So that: mat.setAs(...) is\n * semantically equivalent to: mat.set(new Mat23(...))\n *

\n * @param a The value to which the (1,1) entry will be set (default 1)\n * @param b The value to which the (1,2) entry will be set (default 0)\n * @param c The value to which the (2,1) entry will be set (default 0)\n * @param d The value to which the (2,2) entry will be set (default 1)\n * @param tx The value to which the (1,3) entry will be set (default 0)\n * @param ty The value to which the (2,3) entry will be set (default 0)\n * @return A reference to this Mat23.\n */\n public function setAs(a:Float=1.0,b:Float=0.0,c:Float=0.0,d:Float=1.0,tx:Float=0.0,ty:Float=0.0):Mat23{\n zpp_inner.setas(a,b,c,d,tx,ty);\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Reset matrix to identity.\n *

\n * Equivalent to calling setAs with default argument values.\n *

\n * @return A reference to this Mat23.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function reset():Mat23{\n return setAs();\n }\n #if(flash9||openfl||nme)/**\n * Create a Mat23 matrix from a given AS3 flash.geom.Matrix.\n *

\n * This method should be used in preference to doing so manually\n * as the allocation of matrix entries to name is different and\n * it is easy to make this mistake!\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param matrix The AS3 Matrix to create Mat23 from. This value must\n * not be null.\n * @return The constructed Mat23 matching AS3 Matrix.\n */\n #if nape_swc@:keep #end\n public static function fromMatrix(matrix:flash.geom.Matrix):Mat23{\n var m=matrix;\n return new Mat23(m.a,m.c,m.b,m.d,m.tx,m.ty);\n }\n /**\n * Create an AS3 flash.geom.Matrix from this Mat23.\n *

\n * This method should be used in preference to doing so manually\n * as the allocation of matrix entries to name is different and\n * it is easy to make this mistake!\n *\n * @param output If supplied, this Matrix will have its properties\n * populated insteaad of creating a new Matrix.\n * @preturn The constructed AS3 Matrix.\n */\n #if nape_swc@:keep #end\n public function toMatrix(output:flash.geom.Matrix=null):flash.geom.Matrix{\n if(output==null)output=new flash.geom.Matrix();\n output.a=a;\n output.b=c;\n output.c=b;\n output.d=d;\n output.tx=tx;\n output.ty=ty;\n return output;\n }\n #end\n /**\n * Construct a Mat23 representing a clockwise rotation.\n *\n *
\n     * [ cos angle  -sin angle  0 ]\n     * [ sin angle   cos angle  0 ]\n     * 
\n *\n * @param angle The clockwise rotation in radians\n * @return The rotation matrix.\n */\n #if nape_swc@:keep #end\n public static function rotation(angle:Float):Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Cannot create rotation matrix with NaN angle\";\n }\n #end\n var cos=Math.cos(angle);\n var sin=Math.sin(angle);\n return new Mat23(cos,-sin,sin,cos,0,0);\n }\n /**\n * Construct a Mat23 representing a translation\n *\n *
\n     * [ 1  0  tx ]\n     * [ 0  1  ty ]\n     * 
\n *\n * @param tx The x translation.\n * @param ty The y translation.\n * @return The translation matrix.\n */\n #if nape_swc@:keep #end\n public static function translation(tx:Float,ty:Float):Mat23{\n return new Mat23(1,0,0,1,tx,ty);\n }\n /**\n * Construct a Mat23 representing a scaling\n *\n *
\n     * [ sx  0  0 ]\n     * [ 0  sy  0 ]\n     * 
\n *\n * @param sx The x factor of scaling.\n * @param sy The y factor of scaling.\n * @return The scaling matrix.\n */\n #if nape_swc@:keep #end\n public static function scale(sx:Float,sy:Float):Mat23{\n return new Mat23(sx,0,0,sy,0,0);\n }\n /**\n * (readonly) The determinant of this matrix.\n *

\n * This represents the factor of change in area\n * for a region of the plane after transformation by matrix.\n *

\n * A determinant of 0 signifies that the matrix is not invertible.\n *

\n * A negative determinant signifies that for example, a clockwise wound\n * polygon would be transformed into a counter-clockwise polygon.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var determinant(get_determinant,never):Float;\n inline function get_determinant():Float{\n return(a*d)-(b*c);\n }\n /**\n * Determine if the matrix is singular.\n * This check is based on computing the condition number of the matrix\n * by the Frobenius norm, and comparing against 2 / epsilon.\n *

\n * If matrix is singular, then inversion of the matrix cannot be performed\n *\n * @return True, if matrix is singular.\n */\n #if nape_swc@:keep #end\n public function singular():Bool{\n var norm=(a*a)+(b*b)+(c*c)+(d*d);\n var limit=determinant;\n if(limit<0)limit=-limit;\n return(norm>(Config.illConditionedThreshold*limit));\n }\n /**\n * Compute the inverse of this matrix, returning the inverse in a new\n * Mat23 object.\n *

\n * The inverse is such that mat.concat(mat.inverse()) is the identity\n * matrix, as well as mat.inverse().concat(mat)\n *\n * @return The inverse matrix.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function inverse():Mat23{\n #if(!NAPE_RELEASE_BUILD)\n if(singular()){\n throw \"Error: Matrix is singular and cannot be inverted\";\n }\n #end\n var idet=1.0/determinant;\n return new Mat23((d*idet),(-b*idet),(-c*idet),(a*idet),((b*ty)-(d*tx))*idet,((c*tx)-(a*ty))*idet);\n }\n /**\n * Compute the transpose of this matrix, returning the transpose in a new\n * Mat23 object.\n *

\n * Technically speaking, we cannot transpose a matrix if the tx/ty values\n * are non-zero as the implicit bottom row of matrix must be (0, 0, 1)\n * so the tx/ty values of output matrix are set so that should the main\n * 2x2 block of the matrix be orthogonal (Representing a rotation), then\n * the transpose will be able to act as the matrix inverse.\n *
\n     * var mat = Mat23.rotation(..).concat(Mat23.translation(...));\n     * trace(mat.concat(mat.transpose())); // Identity matrix\n     * trace(mat.concat(mat.inverse())); // Identity matrix\n     * 
\n * If the main 2x2 block of matrix is 'not' orthogonal, then the transpose\n * will not be equal to the inverse.\n *\n * @return The transposed matrix.\n */\n #if nape_swc@:keep #end\n public function transpose():Mat23{\n return new Mat23(a,c,b,d,-a*tx-c*ty,-b*tx-d*ty);\n }\n /**\n * Concatenate matrices (left-multiplication), returning new Mat23.\n *

\n * mat1.concat(mat2) is the transformation that first\n * performs transformation represented by mat1, followed by transformation\n * represented by mat2.\n *
\n *\n * @param matrix Matrix to concatenate with.\n * @return The result of the concatenation.\n * @throws # If matrix argument is null.\n */\n #if nape_swc@:keep #end\n public function concat(matrix:Mat23):Mat23{\n var m=matrix;\n #if(!NAPE_RELEASE_BUILD)\n if(m==null){\n throw \"Error: Cannot concatenate with null Mat23\";\n }\n #end\n return new Mat23(((m.a*a)+(m.b*c)),((m.a*b)+(m.b*d)),((m.c*a)+(m.d*c)),((m.c*b)+(m.d*d)),(m.a*tx)+(m.b*ty)+m.tx,(m.c*tx)+(m.d*ty)+m.ty);\n }\n /**\n * Transform a Vec2 by this matrix in new Vec2.\n *

\n * The Vec2 object will be allocated form the global object pool.\n *\n * @param point The Vec2 to transform by this matrix.\n * @param noTranslation If true, then the input Vec2 will be treat as a\n * vector, rather than a point with the tx/ty values\n * treat as 0. (default false)\n * @param weak If true, then the allocated Vec2 will be\n * automatically released to global object pool when\n * used as an argument to a Nape function.\n * @return The result of the transformation as a newly\n * allocated (possibly weak) Vec2. (default false)\n * @throws # If point argument is null.\n */\n #if nape_swc@:keep #end\n public function transform(point:Vec2,noTranslation:Bool=false,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot transform null Vec2\";\n }\n #end\n var ret:Vec2;\n if(noTranslation){\n ret=Vec2.get((point.x*a)+(point.y*b),(point.x*c)+(point.y*d),weak);\n }\n else{\n ret=Vec2.get((point.x*a)+(point.y*b)+tx,(point.x*c)+(point.y*d)+ty,weak);\n }\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Perform inverse transformation with Vec2, returning new Vec2.\n *

\n * The matrix inverse will be performed implicitly and should this\n * method be called many times for the same Mat23, it would be better\n * to instead compute the matrix inverse only once.\n *

\n * The new Vec2 will be allocated from the global object pool.\n *\n * @param point The Vec2 to transform.\n * @param noTranslation If true then the input Vec2 will be treat as a\n * vector instead of a point, treating the tx/ty\n * values of this Mat23 as though they were 0.\n * (default false)\n * @param weak If true, then the allocated Vec2 will be\n * automatically released to global object pool when\n * used as an argument to a Nape function.\n * @return The result of the transformation as a newly\n * allocated (possibly weak) Vec2. (default false)\n * @throws # If matrix is singular.\n * @throws # If point argument is null.\n */\n #if nape_swc@:keep #end\n public function inverseTransform(point:Vec2,noTranslation:Bool=false,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot transform null Vec2\";\n }\n if(singular()){\n throw \"Error: Matrix is singular and inverse transformation cannot be performed\";\n }\n #end\n var idet=1.0/determinant;\n var ret:Vec2;\n if(noTranslation){\n ret=Vec2.get(((point.x*d)-(point.y*b))*idet,((point.y*a)-(point.x*c))*idet,weak);\n }\n else{\n var dx=point.x-tx;\n var dy=point.y-ty;\n ret=Vec2.get(((dx*d)-(dy*b))*idet,((dy*a)-(dx*c))*idet,weak);\n }\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n return \"{ a: \"+a+\" b: \"+b+\" c: \"+c+\" d: \"+d+\" tx: \"+tx+\" ty: \"+ty+\" }\";\n }\n /**\n * Determine if matrix is equiorthogonal\n *

\n * This is a term I invented after\n * failing to find an existing name. It describes that this matrix maps\n * circles into other circles (of not necessarigly the same radius). In\n * otherwords the matrix can be decomposed into a rotation, translation\n * and scaling of equal x/y factors.\n *

\n * This property is required for any Mat23 that is used to transform a\n * Circle, or any Body containing a Circle, or to transform a Debug view.\n *

\n * This is a weaker property than orthogonality which describes a mapping\n * to a circle of equal radius.\n *

\n * Mathematically speaking a matrix is equiorthogonal iff.\n * transpose(M) * M = kI for some non-zero scalar k.\n *\n * @return True if matrix is equiorthogonal.\n */\n #if nape_swc@:keep #end\n public function equiorthogonal():Bool{\n if(singular()){\n return false;\n }\n else{\n var x=(a*b)+(c*d);\n if((x*x)
\n * This property describes a matrix\n * which maps circles into other circles of equal radius. In otherwords\n * the matrix can be decomposed into a rotation and a translation.\n *

\n * Mathematically speaking a matrix is orthogonal iff.\n * transpose(M) * M = I.\n *\n * @return True if matrix is orthogonal.\n */\n #if nape_swc@:keep #end\n public function orthogonal():Bool{\n var x=(a*b)+(c*d);\n if((x*x)
\n * We do this by finding the 'nearest' orthogonal matrix;\n * scaling the basis vectors of matrix to their mean length\n * and applying an equal and opposite rotation to each basis vector to\n * make them perpendicular.\n *\n * @return A reference to this Mat23.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function equiorthogonalise():Mat23{\n if(!equiorthogonal()){\n var k1=Math.sqrt((a*a)+(c*c));\n var k2=Math.sqrt((b*b)+(d*d));\n #if(!NAPE_RELEASE_BUILD)\n if((k1*k1)0){\n ang=-ang;\n }\n var sin=Math.sin(ang);\n var cos=Math.cos(ang);\n var a2=(a*cos)-(c*sin);\n var b2=(b*cos)+(d*sin);\n c=(c*cos)+(a*sin);\n a=a2;\n d=(d*cos)-(b*sin);\n b=b2;\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Orthogonalise matrix.\n *

\n * We do this by finding the 'nearest' orthogonal matrix;\n * normalising the basis vectors of matrix\n * and applying an equal and opposite rotation to each basis vector to\n * make them perpendicular.\n *\n * @return A reference to this Mat23.\n * @throws # If matrix is singular.\n */\n #if nape_swc@:keep #end\n public function orthogonalise():Mat23{\n if(!orthogonal()){\n var k1=Math.sqrt((a*a)+(c*c));\n var k2=Math.sqrt((b*b)+(d*d));\n #if(!NAPE_RELEASE_BUILD)\n if((k1*k1)0){\n ang=-ang;\n }\n var sin=Math.sin(ang);\n var cos=Math.cos(ang);\n var a2=(a*cos)-(c*sin);\n var b2=(b*cos)+(d*sin);\n c=(c*cos)+(a*sin);\n a=a2;\n d=(d*cos)-(b*sin);\n b=b2;\n zpp_inner.invalidate();\n }\n return this;\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n /**\n * A general MxN dimensional matrix.\n *

\n * This object is not often used in Nape :)\n */\n@:final#if nape_swc@:keep #end\nclass MatMN{\n /**\n * @private\n */\n public var zpp_inner:ZPP_MatMN=null;\n /**\n * The number of rows in the matrix.\n */\n #if nape_swc@:isVar #end\n public var rows(get_rows,never):Int;\n inline function get_rows():Int{\n return zpp_inner.m;\n }\n /**\n * The number of columns in the matrix.\n */\n #if nape_swc@:isVar #end\n public var cols(get_cols,never):Int;\n inline function get_cols():Int{\n return zpp_inner.n;\n }\n /**\n * Access element at index.\n *\n * @param row The row of the matrix to access.\n * @param col the column of the matrix to access.\n * @return The element at given (row,col) index.\n * @throws # If access is out of range.\n */\n #if NAPE_NO_INLINE#else inline #end\n public function x(row:Int,col:Int):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(row<0||col<0||row>=rows||col>=cols){\n throw \"Error: MatMN indices out of range\";\n }\n #end\n return zpp_inner.x[(row*cols)+col];\n }\n /**\n * Set element at index.\n *\n * @param row The row of the matrix to set.\n * @param col The column of the matrix to set.\n * @param x The value to set at given (row,col) index.\n * @return The value of matrix at given index after set. (Always\n * equal to the x parameter)\n * @throws # If index is out of range.\n */\n #if NAPE_NO_INLINE#else inline #end\n public function setx(row:Int,col:Int,x:Float):Float{\n #if(!NAPE_RELEASE_BUILD)\n if(row<0||col<0||row>=rows||col>=cols){\n throw \"Error: MatMN indices out of range\";\n }\n #end\n return zpp_inner.x[(row*cols)+col]=x;\n }\n /**\n * Construct a new Matrix.\n *\n * @param rows The number of rows in matrix.\n * @param cols The number of columns in matrix.\n * @return The constructed Matrix.\n * @throws # If rows or columns is negative or 0.\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(rows:Int,cols:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(rows<=0||cols<=0){\n throw \"Error: MatMN::dimensions cannot be < 1\";\n }\n #end\n zpp_inner=new ZPP_MatMN(rows,cols);\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"{ \";\n var fst=true;\n for(i in 0...rows){\n if(!fst)ret+=\"; \";\n fst=false;\n for(j in 0...cols)ret+=x(i,j)+\" \";\n }\n ret+=\"}\";\n return ret;\n }\n /**\n * Transpose matrix, returning a new Matrix.\n *\n * @return The transposed matrix.\n */\n public function transpose():MatMN{\n var ret=new MatMN(cols,rows);\n for(i in 0...rows){\n for(j in 0...cols)ret.setx(j,i,x(i,j));\n }\n return ret;\n }\n /**\n * Multiple this matrix with another.\n *

\n * This operation is only valid if the number of columns\n * in this matrix, is equal to the number of rows in the input\n * matrix.\n *
\n * The result of the multiplication is returned as a new matrix.\n *\n * @param matrix The matrix to multiple with.\n * @return The result of the multiplication\n * @throws If matrix dimensions are not compatible.\n */\n public function mul(matrix:MatMN):MatMN{\n var y=matrix;\n #if(!NAPE_RELEASE_BUILD)\n if(cols!=y.rows){\n throw \"Error: Matrix dimensions aren't compatible\";\n }\n #end\n var ret=new MatMN(rows,y.cols);\n for(i in 0...rows){\n for(j in 0...y.cols){\n var v=0.0;\n for(k in 0...cols)v+=x(i,k)*y.x(k,j);\n ret.setx(i,j,v);\n }\n }\n return ret;\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing the results of a ray cast operation.\n *

\n * These objects are allocated from an object pool and can\n * be released back to that pool by calling its dispose method.\n */\n@:final#if nape_swc@:keep #end\nclass RayResult{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ConvexRayResult=null;\n /**\n * The normal of the surface at intersection.\n */\n #if nape_swc@:isVar #end\n public var normal(get_normal,never):Vec2;\n inline function get_normal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.normal;\n }\n /**\n * The distance to the intersection.\n */\n #if nape_swc@:isVar #end\n public var distance(get_distance,never):Float;\n inline function get_distance():Float{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.toiDistance;\n }\n /**\n * Whether this intersection is with the inner surface of an object.\n */\n #if nape_swc@:isVar #end\n public var inner(get_inner,never):Bool;\n inline function get_inner():Bool{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.inner;\n }\n /**\n * The shape which was intersected.\n */\n #if nape_swc@:isVar #end\n public var shape(get_shape,never):Shape;\n inline function get_shape():Shape{\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return zpp_inner.shape;\n }\n /**\n * @private\n */\n #if flib@:keep function flibopts_0(){}\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ConvexRayResult.internal)throw \"Error: RayResult cannot be instantiated derp!\";\n #end\n }\n /**\n * Release RayResult object to pool.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n zpp_inner.free();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n #if(!NAPE_RELEASE_BUILD)\n zpp_inner.disposed();\n #end\n return \"{ shape: \"+shape+\" distance: \"+distance+\" ?inner: \"+inner+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass RayResultIterator{\n /**\n * @private\n */\n public var zpp_inner:RayResultList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:RayResultIterator=null;\n /**\n * @private\n */\n public var zpp_next:RayResultIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_RayResultList.internal)throw \"Error: Cannot instantiate \"+\"RayResult\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:RayResultList){\n var ret=if(zpp_pool==null){\n ZPP_RayResultList.internal=true;\n var ret=new RayResultIterator();\n ZPP_RayResultList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:RayResult = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:RayResult = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:RayResult = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass RayResultList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_RayResultList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than RayResult\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new RayResultList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,RayResult)#else Std.is(i,RayResult)#end)throw \"Error: Array contains non \"+\"RayResult\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new RayResultList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:RayResult):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):RayResult{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj);\n }\n else zpp_inner.inner.add(obj);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():RayResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():RayResult{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:RayResult):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:RayResult):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"RayResult\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return RayResultIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new RayResultList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"RayResult\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:RayResultList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_RayResultList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:RayResult->Void):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=RayResultIterator.zpp_pool;\n RayResultIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:RayResult->Bool):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Note that in many cases of a Vec2 object being returned by a Nape function\n * the Vec2 object will be marked internally as an 'immutable' Vec2. This will\n * always be documented and trying to mutate such a Vec2 will result in an\n * error being thrown.\n *

\n * Vec2 objects can make use of a global object pool, attempting to make use\n * of a disposed Vec2 will also result in an error with the object pool\n * working in a FILO order to increase the likelihood of such misuse being\n * caught.\n *

\n * Additionally Vec2 objects can be created as 'weak'. Passing a weak Vec2 to\n * any Nape function as an argument will result in the automatic disposal of\n * the Vec2 once the method has finished with it. There may be exceptions to\n * this rule which will also be documented; a notable case being the appending\n * of a weak Vec2 to a Nape Vec2List in which case the disposal of the weak\n * Vec2 is performed when that Vec2List is handed to a Nape function instead.\n *

\n * Example:\n *
\n * var vertices = Polygon.box(20, 20, true);\n * var polygon = new Polygon(vertices);\n * 
\n * In this example, passing true to the Polygon.box method means\n * that we will be returned a Vec2List containing only 'weak' Vec2s. Upon\n * passing this Vec2List to the Polygon constructor, all of the Vec2s from\n * that list will be automatically disposed.\n */\n@:final#if nape_swc@:keep #end\nclass Vec2{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec2=null;\n /**\n * @private\n */\n public var zpp_pool:Vec2=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * Allocate a weak Vec2 from global object pool.\n *

\n * This object which will be automaticaly released back to the object pool\n * when supplied as an argument to a Nape function.\n *

\n * Note that Vec2.weak(x, y) is exactly equivalent to \n * Vec2.get(x, y, true).\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordiante for the vector. (default 0)\n * @return The allocated weak Vec2 with given x/y values.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function weak(x:Float=0,y:Float=0):Vec2{\n return get(x,y,true);\n }\n /**\n * Allocates a Vec2 from the global object pool.\n *

\n * Note that Vec2.get(x, y, true) is exactly equivalent to\n * Vec2.weak(x, y) and should be preferred.\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordinate for the vector. (default 0)\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to object pool when passed as an\n * argument to a Nape function. (default false)\n * @return The allocated, possibly weak Vec2 with given x/y values.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float=0,y:Float=0,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n var ret;\n {\n if(ZPP_PubPool.poolVec2==null){\n ret=new Vec2();\n #if NAPE_POOL_STATS Vec2.POOL_TOT++;\n Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolVec2;\n ZPP_PubPool.poolVec2=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextVec2)ZPP_PubPool.nextVec2=null;\n #end\n #if NAPE_POOL_STATS Vec2.POOL_CNT--;\n Vec2.POOL_ADD++;\n #end\n }\n };\n if(ret.zpp_inner==null){\n ret.zpp_inner=ZPP_Vec2.get(x,y);\n ret.zpp_inner.outer=ret;\n }\n else{\n ret.setxy(x,y);\n }\n ret.zpp_inner.weak=weak;\n return ret;\n }\n /**\n * Release this Vec2 to global object pool.\n *

\n * Once diposed this Vec2\n * will be accessible to Nape internals for re-allocation and should\n * not be touched (Good practice would be to set any references to this\n * Vec2 to null to help ensure this).\n *

\n * In debug mode, should you attempt to access this Vec2 after disposal\n * and the Vec2 is still in the object pool, you will be given an Error.\n * The object pool operates on a First-In-Last-Out principal in debug\n * mode to help catch these sort of errors.\n * @throws # If this vector has already been disposed.\n * @throws # If this vector is immutable.\n * @throws # If this vector is in use in some other manner, such as being\n * an element of a Polygon's vertex list.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner._inuse){\n throw \"Error: This Vec2 is not disposable\";\n }\n #end\n var inner=zpp_inner;\n zpp_inner.outer=null;\n zpp_inner=null;\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"Vec2\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextVec2!=null)ZPP_PubPool.nextVec2.zpp_pool=o;\n else ZPP_PubPool.poolVec2=o;\n ZPP_PubPool.nextVec2=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolVec2;\n ZPP_PubPool.poolVec2=o;\n #end\n #if NAPE_POOL_STATS Vec2.POOL_CNT++;\n Vec2.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n {\n var o=inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n /**\n * Construct a new Vec2.\n *

\n * This constructor will obviously not make use of\n * the global object pool: Vec2.get should be used in\n * preference noting that new Vec2(x, y) is semantically\n * equivalent to Vec2.get(x, y).\n *\n * @param x The x coordinate for the vector. (default 0)\n * @param y The y coordinate for the vector. (default 0)\n * @return The newly constructed Vec2 object with given x/y values.\n */\n public function new(x:Float=0,y:Float=0){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n zpp_inner=ZPP_Vec2.get(x,y);\n zpp_inner.outer=this;\n }\n /**\n * Produce a copy of this Vec2.\n *

\n * The Vec2 will be allocated from the global object pool.\n *

\n * As would be expected, if you produce a copy of an 'immutable' Vec2, then\n * the copy will be 'mutable'.\n *\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to the object pool when passed as an\n * argument to any Nape function. (default false)\n * @return The possibly weak copy of this Vec2.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function copy(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(x,y,weak);\n }\n #if(flash9||openfl||nme)\n /**\n * Allocate a Vec2 from AS3 Point object.\n *

\n * This Vec2 will be allocated from the global object pool.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param point The AS3 Point to initialise Vec2 with\n * @param weak If true, then a weak Vec2 will be allocated which will\n * be automatically released to the object pool when\n * pass as an argument to any Nape function.\n * (default false)\n * @return The possibly weak Vec2 allocated with same values as\n * input Point object.\n * @throws # If the point argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromPoint(point:flash.geom.Point,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(point==null){\n throw \"Error: Cannot create Vec2 from null Point object\";\n }\n if((point.x!=point.x)||(point.y!=point.y)){\n throw \"Error: Error: Vec2 components cannot be NaN\";\n }\n #end\n return Vec2.get(point.x,point.y,weak);\n }\n /**\n * Create an AS3 Point object from Vec2.\n *

\n * This method is only available on flash and\n * openfl||nme targets.\n *\n * @param output If supplied, this Point will have its x/y\n * set instead of creating a new Point.\n * @return The AS3 Point object representing Vec2.\n * @throws # If this vector has been disposed of.\n */\n #if nape_swc@:keep #end\n public function toPoint(output:flash.geom.Point=null):flash.geom.Point{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(output==null)output=new flash.geom.Point();\n output.x=x;\n output.y=y;\n return output;\n }\n #end\n /**\n * Allocate a Vec2 given polar coordinates.\n *

\n * This Vec2 will be allocated from the global object pool.\n *

\n * This method will assign x/y values equal respectively to:\n * length*Math.cos(angle),\n * length*Math.sin(angle)\n *\n * @param length The length of the Vec2. This value may be negative.\n * @param angle The angle of the Vec2 as measured in radians clockwise\n * from the positive x axis.\n * @param weak If true, then a weak Vec2 will be allocated which will be\n * automatically released to the object pool when passed as\n * an argument to any Nape function. (default false)\n * @return The possibly weak Vec2 allocated with given polar values.\n */\n #if nape_swc@:keep #end\n public static function fromPolar(length:Float,angle:Float,weak:Bool=false):Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec2::length cannot be NaN\";\n }\n if((angle!=angle)){\n throw \"Error: Vec2::angle cannot be NaN\";\n }\n #end\n return Vec2.get(length*Math.cos(angle),length*Math.sin(angle),weak);\n }\n /**\n * x coordinate of vector.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.x;\n }\n inline function set_x(x:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n if(this.x!=x){\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)){\n throw \"Error: Vec2::\"+\"x\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.x=x;\n zpp_inner.invalidate();\n }\n }\n return get_x();\n }\n /**\n * y coordinate of vector.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.y;\n }\n inline function set_y(y:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n if(this.y!=y){\n #if(!NAPE_RELEASE_BUILD)\n if((y!=y)){\n throw \"Error: Vec2::\"+\"y\"+\" cannot be NaN\";\n }\n #end\n zpp_inner.y=y;\n zpp_inner.invalidate();\n }\n }\n return get_y();\n }\n /**\n * Length of this Vec2.\n *

\n * This value can be set and may be set to negative values so that\n * vec.length *= -1 is a valid - if sub-optimal - way of\n * negating a Vec2.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var length(get_length,set_length):Float;\n inline function get_length():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Math.sqrt((this.x*this.x+this.y*this.y));\n }\n inline function set_length(length:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec2::length cannot be NaN\";\n }\n if((this.x*this.x+this.y*this.y)==0){\n throw \"Error: Cannot set length of a zero vector\";\n }\n #end\n {\n var t=(length/Math.sqrt((this.x*this.x+this.y*this.y)));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"length/Math.sqrt((this.x*this.x+this.y*this.y))\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n zpp_inner.invalidate();\n }\n return get_length();\n }\n /**\n * Compute squared length of this Vec2.\n *

\n * This is exactly the same as performing vec.length *\n * vec.length except for being more effecient.\n *\n * @return The squared length of this Vec2.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function lsq():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return(this.x*this.x+this.y*this.y);\n }\n /**\n * Set values of this Vec2 to those of the argument.\n *

\n * Note that vec.set(p) is semantically equivalent to\n * vec.setxy(p.x, p.y).\n *\n * @param vector The Vec2 to set the values of this Vec2 with.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector, or vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function set(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot assign null Vec2\";\n }\n #end\n var ret=setxy(vector.x,vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Compute square distance between two points.\n *\n * @param a The first point Vec2.\n * @param b The second point Vec2.\n * @return Squared distance between points.\n * @throws # If a, b are disposed of or null.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function dsq(a:Vec2,b:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(a!=null&&a.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(b!=null&&b.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(a==null||b==null)throw \"Error: Cannot compute squared distance between null Vec2\";\n #end\n var ret=ZPP_VecMath.vec_dsq(a.x,a.y,b.x,b.y);\n ({\n if(({\n a.zpp_inner.weak;\n })){\n a.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n b.zpp_inner.weak;\n })){\n b.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Compute distance between two points.\n *\n * @param a The first point Vec2.\n * @param b The second point Vec2.\n * @return Distance between points.\n * @throws # If a, b are disposed of or null.\n */\n public static#if NAPE_NO_INLINE#else inline #end\n function distance(a:Vec2,b:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(a!=null&&a.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(b!=null&&b.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(a==null||b==null)throw \"Error: Cannot compute squared distance between null Vec2\";\n #end\n var ret=Math.sqrt(ZPP_VecMath.vec_dsq(a.x,a.y,b.x,b.y));\n ({\n if(({\n a.zpp_inner.weak;\n })){\n a.dispose();\n true;\n }\n else{\n false;\n }\n });\n ({\n if(({\n b.zpp_inner.weak;\n })){\n b.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Set values of this Vec2 given pair of x/y values.\n *\n * @param x The x value to set this Vec2's x value to.\n * @param y The y value to set this Vec2's y value to.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function setxy(x:Float,y:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)){\n throw \"Error: Vec2 components cannot be NaN\";\n }\n #end\n if(!(this.x==x&&this.y==y)){\n {\n zpp_inner.x=x;\n zpp_inner.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.x!=zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.y!=zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Angle of this Vec2.\n *\n * Measured in radians as measured clockwise from the positive x axis.\n * The value will be given in the range -pi to pi.\n *

\n * If the x/y values of this Vec2 are both 0, then the angle value will\n * default to 0.\n *

\n * This value can also be set (to any value) so that vec.angle +=\n * Math.PI is a valid - if sub-optimial - way of negating a Vec2.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var angle(get_angle,set_angle):Float;\n inline function get_angle():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(x==y&&x==0){\n return 0.0;\n }\n else{\n return Math.atan2(y,x);\n }\n }\n inline function set_angle(angle:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Vec2::angle cannot be NaN\";\n }\n #end\n var l=length;\n setxy(l*Math.cos(angle),l*Math.sin(angle));\n }\n return get_angle();\n }\n /**\n * Rotate Vec2 in-place by given number of radians..\n *

\n * Rotation performed in the clockwise direction.\n *

\n * The Vec2 will be mutated, with it's new x/y values being the result\n * of the rotation.\n *\n * @param angle The number of radians to rotate Vec2 by in the clockwise\n * direction.\n * @return A reference to 'this' Vec2.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n #if nape_swc@:keep #end\n public function rotate(angle:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle)){\n throw \"Error: Cannot rotate Vec2 by NaN\";\n }\n #end\n if((angle%(Math.PI*2))!=0){\n var ax=Math.sin(angle);\n var ay=Math.cos(angle);\n {\n var t=(ay*zpp_inner.x-ax*zpp_inner.y);\n zpp_inner.y=(zpp_inner.x*ax+zpp_inner.y*ay);\n zpp_inner.x=t;\n };\n zpp_inner.invalidate();\n }\n return this;\n }\n /**\n * Reflect given Vec2 in plane whose normal is this Vec2.\n *

\n * @param vec The vector to be reflected.\n * @param weak If true, the returned Vec2 will be automatically released\n * to object pool when used in another Nape function (default false)\n * @return The reflected Vec2.\n * @throws # If this vector or argument has been disposed.\n * @throws # If this vector has zero length.\n */\n #if nape_swc@:keep #end\n public function reflect(vec:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vec!=null&&vec.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot reflect in zero vector\";\n }\n #end\n var normal=this.copy(true).normalise();\n var ret=vec.sub(normal.muleq(2*normal.dot(vec)),weak);\n ({\n if(({\n vec.zpp_inner.weak;\n })){\n vec.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Normalise this vector.\n *

\n * Equivalent to setting the length of the vector to 1, and also to the\n * (less-optimal) this.set(this.unit()).\n *\n * @return A reference to 'this' vector.\n * @throws # If this vector has been disposed of or is immutable.\n * @throws # If length of this vector is 0.\n */\n #if nape_swc@:keep #end\n public function normalise():Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot normalise vector of length 0\";\n }\n #end\n {\n var d=(this.x*this.x+this.y*this.y);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"this.\"+\")\");\n #end\n };\n var imag=1.0/Math.sqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n };\n zpp_inner.invalidate();\n return this;\n }\n /**\n * Return normalisation of this vector.\n *\n * @param weak If true then the allocated Vec2 will be automatically\n * released to the global object pool when used as an argument\n * to a Nape function. (default false)\n * @return A copy of this vector, normalised.\n * @throws # If this vector has been disposed of.\n * @throws # If length of this vector is 0.\n */\n #if nape_swc@:keep #end\n public function unit(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(this.length==0){\n throw \"Error: Cannot normalise vector of length 0\";\n }\n #end\n var scale=1/ZPP_Math.sqrt((this.x*this.x+this.y*this.y));\n return Vec2.get(x*scale,y*scale,weak);\n }\n /**\n * Add another vector to this vector.\n *

\n * Returns a newly allocated vector so that\n * this vector is not modified.\n *

\n * @param vector The vector to add to this vector. This value can not be\n * null\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the sum of this\n * and the input vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function add(vector:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n var ret=Vec2.get(x+vector.x,y+vector.y,weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Add a multiple of a vector to this vector.\n *

\n * This operation is equivalent to:\n *
\n     * this.add(vector.mul(scalar, true));\n     * 
\n *

\n * Returns a newly allocated vector so that\n * this vector is not modified.\n *

\n * @param vector The vector to add to this vector. This value can not be\n * null\n * @param scalar The scalar multiplier for the vector being added.\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the sum of this\n * and the input vector by scalar multiplier.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function addMul(vector:Vec2,scalar:Float,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n var ret=Vec2.get(x+(vector.x*scalar),y+(vector.y*scalar),weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Subtract another vector from this vector.\n *

\n * Returns a newly allocated vector so that this vector is not mutated.\n *\n * @param vector The vector to subtract from this vector. This value can\n * not be null\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the subtraction of\n * the input vector from this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function sub(vector:Vec2,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot subtract null vectors\";\n }\n #end\n var ret=Vec2.get(x-vector.x,y-vector.y,weak);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Multiply this vector with a number.\n *

\n * Returns a newly allocated vector so that this vector is not mutated.\n *\n * @param scalar The number to multiply this vector with.\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an\n * argument to another Nape function. (default false)\n * @return The possibly weak vector representing the multiplication\n * of this vector and the input number.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function mul(scalar:Float,weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((scalar!=scalar)){\n throw \"Error: Cannot multiply with NaN\";\n }\n #end\n return Vec2.get(x*scalar,y*scalar,weak);\n }\n /**\n * Add another vector into this vector.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec1.set(vec1.add(vec2))\n *\n * @param vector The vector to add into this vector.\n * @return A reference to this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function addeq(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot add null vectors\";\n }\n #end\n setxy(x+vector.x,y+vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Subtract another vector from this vector.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec1.set(vec1.sub(vec2))\n *\n * @param vector The vector to subtract from this vector.\n * @return A reference to this vector.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If this vector is immutable.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function subeq(vector:Vec2):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot subtract null vectors\";\n }\n #end\n setxy(x-vector.x,y-vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Multiply this vector with a number.\n *

\n * This vector is mutated to be the result of the operation.\n *

\n * Semantically equivalent to (the less optimal)\n * vec.set(vec.mul(scalar))\n *\n * @param scalar The number to multiply this vector with.\n * @return A reference to this vector.\n * @throws # If this vector has been disposed.\n * @throws # If this vector is immutable.\n */\n #if nape_swc@:keep #end\n public function muleq(scalar:Float):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.immutable();\n #if(!NAPE_RELEASE_BUILD)\n if((scalar!=scalar)){\n throw \"Error: Cannot multiply with NaN\";\n }\n #end\n return setxy(x*scalar,y*scalar);\n }\n /**\n * Dot product with another vector.\n *

\n * The dot product is equal to the product of the length of each\n * vector, multiplied by the cosine of the smallest angle between them.\n *

\n * If one of the vectors is of length 1. Then the dot product is the\n * length of the projection of the other vector onto it which may be\n * computed (assuming 'this' is of length 1) like:\n * vec1.mul(vec1.dot(vec2))\n *\n * @param vector The vector to compute dot product with.\n * @return The dot product of this vector and the other.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function dot(vector:Vec2):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot take dot product with null vector\";\n }\n #end\n var ret=(x*vector.x+y*vector.y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Cross product with another vector.\n *

\n * Also known as the perp-dot product, this operation represents\n * the determinant of the matrix formed by having the 2 columns\n * as the two vectors. This is also the z-value of a 3D cross product\n * if you extend the input vectors with a z-value of 0.\n *

\n * Though not technically a cross-product in the way a 3D cross product\n * is, it shares many mathematical similarities.\n *

\n * If one of the vectors is of length 1. Then the cross product is the\n * length of the projection of the other vector onto the\n * right-perpendicular of the unit vector.\n *

\n * The cross and dot product are related like:\n * vec1.cross(vec2) == vec1.perp().dot(vec2)\n * Hence the name 'perp-dot'\n *

\n * Another useful property is that if the cross-product of two vectors\n * is 0, then the vectors are collinear, if positive then the second\n * vector is 'to the right' of the first vector, and if negative then\n * the second vector is 'to the left' of the first vector.\n *\n * @param vector The vector to compute cross product with.\n * @return The cross product of this vector and the other.\n * @throws # If this vector, or the vector argument has been disposed.\n * @throws # If the vector passed as argument is null.\n */\n #if nape_swc@:keep #end\n public function cross(vector:Vec2):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot take cross product with null vector\";\n }\n #end\n var ret=(vector.y*x-vector.x*y);\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * The right-perpendicular to this vector.\n *

\n * Computes the result of rotating this vector by 90 degrees clockwise\n * returning a newly allocated vector.\n *

\n * This is semantically equivalent to (the less optimal)\n * vec.copy().rotate(Math.PI/2)\n *

\n * The cross and dot product are related like:\n * vec1.cross(vec2) == vec1.perp().dot(vec2)\n * Hence the name 'perp-dot'\n *\n * @param weak If true then the returned vector will be automatically\n * released to the global object pool when used as an argument\n * to another Nape function. (default false)\n * @return The possibly weakly allocated, right-perpendicular to this\n * vector.\n * @throws # If this vector has been disposed.\n */\n #if nape_swc@:keep #end\n public function perp(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(-y,x,weak);\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.toString();\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass Vec2Iterator{\n /**\n * @private\n */\n public var zpp_inner:Vec2List=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:Vec2Iterator=null;\n /**\n * @private\n */\n public var zpp_next:Vec2Iterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Vec2List.internal)throw \"Error: Cannot instantiate \"+\"Vec2\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:Vec2List){\n var ret=if(zpp_pool==null){\n ZPP_Vec2List.internal=true;\n var ret=new Vec2Iterator();\n ZPP_Vec2List.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Vec2 = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Vec2 = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Vec2 = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!true@:final #end\n#if nape_swc@:keep #end\nclass Vec2List{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec2List=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if false inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Vec2\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new Vec2List();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Vec2)#else Std.is(i,Vec2)#end)throw \"Error: Array contains non \"+\"Vec2\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new Vec2List();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Vec2):Bool{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Vec2{\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function add(obj:Vec2):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Vec2):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Vec2\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public function empty(){\n #if false if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public function iterator(){\n #if false zpp_inner.valmod();\n #else zpp_vm();\n #end\n return Vec2Iterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new Vec2List();\n for(i in this)ret.push(deep?i.copy():i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:Vec2List):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_Vec2List();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function foreach(lambda:Vec2->Void):Vec2List{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=Vec2Iterator.zpp_pool;\n Vec2Iterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Vec2->Bool):Vec2List{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * In many instances a Vec3 will be accessible from Nape which is marked\n * as immutable, these cases will be documented and modifying such a Vec3\n * will result in an error.\n */\n@:final#if nape_swc@:keep #end\nclass Vec3{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Vec3=null;\n /**\n * @private\n */\n public var zpp_pool:Vec3=null;\n #if(!NAPE_RELEASE_BUILD)\n /**\n * @private\n */\n public var zpp_disp:Bool;\n #end\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n /**\n * The x component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var x(get_x,set_x):Float;\n inline function get_x():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.x;\n }\n inline function set_x(x:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.x=x;\n }\n return get_x();\n }\n /**\n * The y component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var y(get_y,set_y):Float;\n inline function get_y():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.y;\n }\n inline function set_y(y:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.y=y;\n }\n return get_y();\n }\n /**\n * The z component of Vec3.\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var z(get_z,set_z):Float;\n inline function get_z():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner.validate();\n return zpp_inner.z;\n }\n inline function set_z(z:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: Vec3 is immutable\";\n }\n #end\n zpp_inner.z=z;\n }\n return get_z();\n }\n /**\n * Allocate a Vec3 from the global object pool.\n *

\n * Use of this method should always be preferred to the constructor.\n *\n * @param x The x component of Vec3. (default 0)\n * @param y The y component of Vec3. (default 0)\n * @param z The z component of Vec3. (default 0)\n * @return A Vec3 allocated from global object pool with given components.\n */\n public static function get(x:Float=0,y:Float=0,z:Float=0):Vec3{\n var ret;\n {\n if(ZPP_PubPool.poolVec3==null){\n ret=new Vec3();\n #if NAPE_POOL_STATS Vec3.POOL_TOT++;\n Vec3.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_PubPool.poolVec3;\n ZPP_PubPool.poolVec3=ret.zpp_pool;\n ret.zpp_pool=null;\n #if(!NAPE_RELEASE_BUILD)\n ret.zpp_disp=false;\n if(ret==ZPP_PubPool.nextVec3)ZPP_PubPool.nextVec3=null;\n #end\n #if NAPE_POOL_STATS Vec3.POOL_CNT--;\n Vec3.POOL_ADD++;\n #end\n }\n };\n ret.setxyz(x,y,z);\n ret.zpp_inner.immutable=false;\n ret.zpp_inner._validate=null;\n return ret;\n }\n /**\n * Construct a new Vec3.\n *

\n * This method should not generally be used with preference for the\n * static get method which will make use of the global object pool.\n *\n * @param x The x component of Vec3. (default 0)\n * @param y The y component of Vec3. (default 0)\n * @param z The z component of Vec3. (default 0)\n * @return A newly constructed Vec3 with given components.\n */\n public function new(x:Float=0,y:Float=0,z:Float=0){\n zpp_inner=new ZPP_Vec3();\n zpp_inner.outer=this;\n {\n {\n this.x=x;\n this.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n this.z=z;\n };\n }\n /**\n * Produce a copy of this Vec3.\n *\n * @return The copy of this Vec3.\n * @throws # If this Vec3 has been disposed of.\n public function copy():Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec3.get(x,y,z);\n }\n /**\n * Release Vec3 object to global object pool.\n *\n * @throws # If this Vec3 has already been disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function dispose():Void{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable){\n throw \"Error: This Vec3 is not disposable\";\n }\n #end\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"PublicFree(in T: \"+\"Vec3\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_pool=null;\n if(ZPP_PubPool.nextVec3!=null)ZPP_PubPool.nextVec3.zpp_pool=o;\n else ZPP_PubPool.poolVec3=o;\n ZPP_PubPool.nextVec3=o;\n #end\n #if NAPE_RELEASE_BUILD \n o.zpp_pool=ZPP_PubPool.poolVec3;\n ZPP_PubPool.poolVec3=o;\n #end\n #if NAPE_POOL_STATS Vec3.POOL_CNT++;\n Vec3.POOL_SUB++;\n #end\n #if(!NAPE_RELEASE_BUILD)\n o.zpp_disp=true;\n #end\n };\n }\n /**\n * Length of Vec3.\n *

\n * This value may also be set to any value including negatives, though\n * an error will be thrown if length of the Vec3 is already 0 as such\n * a scaling would be undefined. As well as if this Vec3 has been disposed\n * of, or is immutable.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var length(get_length,set_length):Float;\n inline function get_length():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Math.sqrt(((this.x*this.x+this.y*this.y)+this.z*this.z));\n }\n inline function set_length(length:Float):Float{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if((length!=length)){\n throw \"Error: Vec3::length cannot be NaN\";\n }\n if(((this.x*this.x+this.y*this.y)+this.z*this.z)==0){\n throw \"Error: Cannot set length of a zero vector\";\n }\n #end\n {\n var t=((length/this.length));\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"this.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n this.x*=t;\n this.y*=t;\n };\n this.z*=t;\n };\n }\n return get_length();\n }\n /**\n * Compute squared length of Vec3.\n *\n * @return The squared length of this Vec3.\n * @throws # If the Vec3 has been disposed of.\n */\n #if nape_swc@:keep #end\n public function lsq():Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return((this.x*this.x+this.y*this.y)+this.z*this.z);\n }\n /**\n * Set values of this Vec3 from another.\n *\n * @param vector The vector to set values from.\n * @return A reference to this Vec3.\n * @throws # If the vector argument is null.\n * @throws # If this, or the vector argument are disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function set(vector:Vec3):Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot assign null Vec3\";\n }\n #end\n return setxyz(vector.x,vector.y,vector.z);\n }\n /**\n * Set values of this Vec3 from numbers.\n *\n * @param x The new x component value for this vector.\n * @param y The new y component value for this vector.\n * @param z The new z component value for this vector.\n * @return A reference to this Vec3.\n * @throws # If this Vec3 has been disposed of.\n * @throws # If this Vec3 is immutable.\n */\n public function setxyz(x:Float,y:Float,z:Float):Vec3{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n {\n this.x=x;\n this.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n this.z=z;\n };\n return this;\n }\n /**\n * Produce copy of the xy components of Vec3.\n *

\n * This function will return a new Vec2 completely seperate\n * from this Vec3 with values equal to the xy components of\n * this Vec3.\n *\n * @param weak If true, then the allocated Vec2 will be weak\n * so that when used as an argument to a Nape\n * function it will be automatically released back\n * to the global object pool. (default false)\n * @return An allocated Vec2 representing the xy components of\n * this vector.\n */\n public function xy(weak:Bool=false):Vec2{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return Vec2.get(x,y,weak);\n }\n /**\n * @private\n */\n @:keep public function toString():String{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(this!=null&&this.zpp_disp)throw \"Error: \"+\"Vec3\"+\" has been disposed and cannot be used!\";\n #end\n };\n return \"{ x: \"+x+\" y: \"+y+\" z: \"+z+\" }\";\n }\n}\n","package nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration represents the winding of a Polygon.\n *

\n * To appreciate what the winding of a polygon means, think of a polygon who's\n * vertices are the numbers on a clock face.\n *\n * If the vertices are ordered 12 -> 1 -> 2 ... -> 12\n * then this polygon is clockwise wound. The reverse order would mean the\n * polygon is wound anticlockwise.\n */\n@:final#if nape_swc@:keep #end\nclass Winding{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"Winding\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==UNDEFINED)return\"UNDEFINED\";\n else if(this==CLOCKWISE)return\"CLOCKWISE\";\n else if(this==ANTICLOCKWISE)return\"ANTICLOCKWISE\";\n else return \"\";\n }\n /**\n * Value represents that the polygon has no discernible, or ambiguous winding\n *

\n * This may be because the polygon is degenerate, or because it is self\n * intersecting. In either case it is not well defined to say that the winding\n * is either clockwise or anticlockwise.\n */\n #if nape_swc@:isVar #end\n public static var UNDEFINED(get_UNDEFINED,never):Winding;\n inline static function get_UNDEFINED(){\n if(ZPP_Flags.Winding_UNDEFINED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_UNDEFINED=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_UNDEFINED;\n }\n /**\n * Value represents that the polygon is wound clockwise.\n */\n #if nape_swc@:isVar #end\n public static var CLOCKWISE(get_CLOCKWISE,never):Winding;\n inline static function get_CLOCKWISE(){\n if(ZPP_Flags.Winding_CLOCKWISE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_CLOCKWISE=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_CLOCKWISE;\n }\n /**\n * Value represents that the polygon is wound anticlockwise.\n */\n #if nape_swc@:isVar #end\n public static var ANTICLOCKWISE(get_ANTICLOCKWISE,never):Winding;\n inline static function get_ANTICLOCKWISE(){\n if(ZPP_Flags.Winding_ANTICLOCKWISE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Winding_ANTICLOCKWISE=new Winding();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Winding_ANTICLOCKWISE;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass Interactor{\n /**\n * @private\n */\n public var zpp_inner_i:ZPP_Interactor=null;\n /**\n * Unique id of this Interactor.\n */\n #if nape_swc@:isVar #end\n public var id(get_id,never):Int;\n inline function get_id():Int{\n return zpp_inner_i.id;\n }\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner_i.userData==null){\n zpp_inner_i.userData=cast{};\n }\n return zpp_inner_i.userData;\n }\n /**\n * Fast equivalent to Std.is(interactor, Shape)\n * @return true if this Interactor is a Shape.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isShape(){\n return zpp_inner_i.ishape!=null;\n }\n /**\n * Fast equivalent to Std.is(interactor, Body)\n * @return true if this Interactor is a Body.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isBody(){\n return zpp_inner_i.ibody!=null;\n }\n /**\n * Fast equivalent to Std.is(interactor, Compound)\n * @return true if this Interactor is a Compound.\n */\n public#if NAPE_NO_INLINE#else inline #end\n function isCompound(){\n return zpp_inner_i.icompound!=null;\n }\n /**\n * Fast equivalent to cast(interactor, Shape)\n */\n #if nape_swc@:isVar #end\n public var castShape(get_castShape,never):Null;\n inline function get_castShape():Null{\n return if(isShape())zpp_inner_i.ishape.outer else null;\n }\n /**\n * Fast equivalent to cast(interactor, Body)\n */\n #if nape_swc@:isVar #end\n public var castBody(get_castBody,never):Null;\n inline function get_castBody():Null{\n return if(isBody())zpp_inner_i.ibody.outer else null;\n }\n /**\n * Fast equivalent to cast(interactor, Compound)\n */\n #if nape_swc@:isVar #end\n public var castCompound(get_castCompound,never):Null;\n inline function get_castCompound():Null{\n return if(isCompound())zpp_inner_i.icompound.outer else null;\n }\n /**\n * InteractionGroup assigned to this Interactor.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var group(get_group,set_group):Null;\n inline function get_group():Null{\n return if(zpp_inner_i.group==null)null else zpp_inner_i.group.outer;\n }\n inline function set_group(group:Null):Null{\n {\n zpp_inner_i.immutable_midstep(\"Interactor::group\");\n zpp_inner_i.setGroup(group==null?null:group.zpp_inner);\n }\n return get_group();\n }\n /**\n * Set of CbType's assigned to this Interactor.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var cbTypes(get_cbTypes,never):CbTypeList;\n inline function get_cbTypes():CbTypeList{\n if(zpp_inner_i.wrap_cbTypes==null)zpp_inner_i.setupcbTypes();\n return zpp_inner_i.wrap_cbTypes;\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Cannot instantiate an Interactor, only Shape/Body/Compound\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"\";\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Class representing a physics Rigid Body.\n */\n@:final#if nape_swc@:keep #end\nclass Body extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Body=null;\n /**\n * Set to disable debug drawing/\n *

\n * When true, this Body will not be drawn during debug draw operations\n * unless specifically given as argument to Debug draw() method.\n * @default true\n */\n public var debugDraw:Bool=true;\n /**\n * Type of body.\n *

\n * This value can be changed even if Body is inside of a Space.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,set_type):BodyType;\n inline function get_type():BodyType{\n return ZPP_Body.types[zpp_inner.type];\n }\n inline function set_type(type:BodyType):BodyType{\n {\n zpp_inner.immutable_midstep(\"Body::type\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.type!=type){\n #if(!NAPE_RELEASE_BUILD)\n if(type==null)throw \"Error: Cannot use null BodyType\";\n #end\n var ntype=type==BodyType.DYNAMIC?ZPP_Flags.id_BodyType_DYNAMIC:type==BodyType.KINEMATIC?ZPP_Flags.id_BodyType_KINEMATIC:ZPP_Flags.id_BodyType_STATIC;\n if(ntype==ZPP_Flags.id_BodyType_STATIC&&zpp_inner.space!=null){\n {\n zpp_inner.velx=0;\n zpp_inner.vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.velx!=zpp_inner.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.vely!=zpp_inner.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n zpp_inner.angvel=0;\n }\n zpp_inner.invalidate_type();\n if(zpp_inner.space!=null)zpp_inner.space.transmitType(zpp_inner,ntype);\n else zpp_inner.type=ntype;\n }\n }\n return get_type();\n }\n /**\n * Mark object for continuous collisions against other dynamic Bodies\n *

\n * If true, then this Body will undergo continuous collisions with other\n * dynamic Bodies. This flag has no effect for non-dynamic Bodies.\n *

\n * This flag should only be set for very fast, small moving dynamic bodies,\n * and due to the way continuous collisions are resolved it is not wise to\n * enable this for a large group of bodies that interact together as it\n * will lead to visual stalling.\n *
\n * Bullets also do not play well when existing in a group with respect to\n * continuous collisions against kinematic objects and may cause\n * tunnelling against the kinematic.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var isBullet(get_isBullet,set_isBullet):Bool;\n inline function get_isBullet():Bool{\n return zpp_inner.bulletEnabled;\n }\n inline function set_isBullet(isBullet:Bool):Bool{\n {\n zpp_inner.bulletEnabled=isBullet;\n }\n return get_isBullet();\n }\n /**\n * Declare object should never be collided continuously\n *

\n * When performing continuous collisions, Nape will check both Bodies to see\n * if either has opted-out of CCD. If either Body has this flag true, then\n * no CCD will be performed for that pair.\n * @default false\n */\n #if nape_swc@:isVar #end\n public var disableCCD(get_disableCCD,set_disableCCD):Bool;\n inline function get_disableCCD():Bool{\n return zpp_inner.disableCCD;\n }\n inline function set_disableCCD(disableCCD:Bool):Bool{\n {\n zpp_inner.disableCCD=disableCCD;\n }\n return get_disableCCD();\n }\n /**\n * Integrate body forward in time, taking only velocities into account.\n *\n * @param deltaTime The time to integrate body by. This value may be negative to\n * integrate back in time.\n * @return A refernce to 'this' Body\n */\n #if nape_swc@:keep #end\n public function integrate(deltaTime:Float){\n #if(!NAPE_RELEASE_BUILD)\n if((deltaTime!=deltaTime))throw \"Cannot integrate by NaN time\";\n #end\n zpp_inner.immutable_midstep(\"Body::space\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(deltaTime==0)return this;\n var cur=this.zpp_inner;\n cur.sweepTime=0;\n cur.sweep_angvel=cur.angvel;\n cur.sweepIntegrate(deltaTime);\n cur.invalidate_pos();\n cur.invalidate_rot();\n cur.sweepTime=0;\n return this;\n }\n /**\n * Fast equivalent to body.type == BodyType.STATIC\n * @return True if body is Static.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isStatic(){\n return zpp_inner.isStatic();\n }\n /**\n * Fast equivalent to body.type == BodyType.DYNAMIC\n * @return True if body is Dynamic.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isDynamic(){\n return zpp_inner.isDynamic();\n }\n /**\n * Fast equivalent to body.type == BodyType.KINEMATIC\n * @return True if body is Kinematic.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isKinematic(){\n return zpp_inner.isKinematic();\n }\n /**\n * List of shapes owned by Body.\n *

\n * Appending a Shape to this list is equivalent to shape.body = this\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n return zpp_inner.wrap_shapes;\n }\n /**\n * Compound this Body belongs to.\n *

\n * If this Body belongs to a Compound, then the Compound 'owns' this Body and\n * it is the Compound which would be added/removed from a Space rather than\n * this Body.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n if(this.compound!=compound){\n if(this.compound!=null)this.compound.bodies.remove(this);\n if(compound!=null)compound.bodies.add(this);\n }\n }\n return get_compound();\n }\n /**\n * Space this Body is assigned to.\n *

\n * When this Body is part of a Compound, this value is immutable.\n *
\n * When a Body is part of a Compound it is owned by that Compound and it\n * is the Compound that is added/removed from a Space.\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set\";\n #end\n zpp_inner.immutable_midstep(\"Body::space\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.space!=space){\n if(this.space!=null)zpp_inner.component.woken=false;\n if(this.space!=null)this.space.bodies.remove(this);\n if(space!=null)space.bodies.add(this);\n }\n }\n return get_space();\n }\n /**\n * Set of active arbiters related to this Body.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n if(zpp_inner.wrap_arbiters==null)zpp_inner.wrap_arbiters=ZPP_ArbiterList.get(zpp_inner.arbiters,true);\n return zpp_inner.wrap_arbiters;\n }\n /**\n * Whether this body is sleeping.\n *

\n * This value is immutable, In Nape you do not ever need to manually wake up a Body.\n * It will always be done automatically without error.\n *

\n * To manually put a Body to sleep is against the very nature of Nape API\n * and so is excluded from the core of Nape. If you really want to do this\n * then you should make use of the nape-hacks module.\n */\n #if nape_swc@:isVar #end\n public var isSleeping(get_isSleeping,never):Bool;\n inline function get_isSleeping():Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.space==null)throw \"Error: isSleeping makes no sense if the object is not contained within a Space\";\n #end\n return zpp_inner.component.sleeping;\n }\n /**\n * Set of constraints using this Body.\n *

\n * This list contains those constraints that are inside of a Space only.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n if(zpp_inner.wrap_constraints==null)zpp_inner.wrap_constraints=ZPP_ConstraintList.get(zpp_inner.constraints,true);\n return zpp_inner.wrap_constraints;\n }\n /**\n * Construct a new Body.\n *

\n * @param type The type of Body to create. (default DYNAMIC)\n * @param position The initial position for object. (default (0,0))\n * @return The newly constructed Body.\n * @throws # If position is non-null, and has been disposed of.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(type:BodyType=null,position:Vec2=null){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner=new ZPP_Body();\n zpp_inner.outer=this;\n zpp_inner.outer_i=this;\n zpp_inner_i=zpp_inner;\n if(position!=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.posx=position.x;\n zpp_inner.posy=position.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posx!=zpp_inner.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"position.x\"+\",in y: \"+\"position.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posy!=zpp_inner.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"position.x\"+\",in y: \"+\"position.y\"+\")\");\n #end\n };\n };\n }\n else{\n zpp_inner.posx=0;\n zpp_inner.posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posx!=zpp_inner.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.posy!=zpp_inner.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n this.type=type==null?BodyType.DYNAMIC:type;\n if(position!=null)({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n zpp_inner_i.insert_cbtype(CbType.ANY_BODY.zpp_inner);\n }\n /**\n * Construct an exact copy of this Body.\n *

\n * All properties will be exactly copied, with Shapes also\n * being copied with the copied Body's and Shape's userData\n * objects being assigned the same fields as the existing ones with\n * values copied over by reference for object types.\n *\n * @return A copy of this Body.\n */\n #if nape_swc@:keep #end\n public function copy(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world cannot be copied\";\n #end\n return zpp_inner.copy();\n }\n /**\n * Position of Body's origin in px.\n *

\n * This value can be set and is equivalent to: this.position.set(value)\n *

\n * Attempting to set this value on a static Body that is in a Space will result\n * in a debug build error.\n *

\n * Please note that for kinematic objects, setting this value is equiavalent\n * to 'teleporting' the object, and for normal movement you should be using\n * the kinematic body's velocity.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var position(get_position,set_position):Vec2;\n inline function get_position():Vec2{\n if(zpp_inner.wrap_pos==null)zpp_inner.setupPosition();\n return zpp_inner.wrap_pos;\n }\n inline function set_position(position:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Body::\"+\"position\"+\" cannot be null\";\n #end\n this.position.set(position);\n }\n return get_position();\n }\n /**\n * Linear velocity of Body's origin in px/s.\n *

\n * This value can be set and is equivalent to: this.velocity.set(value)\n *

\n * A static body cannot have its velocity set.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var velocity(get_velocity,set_velocity):Vec2;\n inline function get_velocity():Vec2{\n if(zpp_inner.wrap_vel==null)zpp_inner.setupVelocity();\n return zpp_inner.wrap_vel;\n }\n inline function set_velocity(velocity:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(velocity!=null&&velocity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(velocity==null)throw \"Error: Body::\"+\"velocity\"+\" cannot be null\";\n #end\n this.velocity.set(velocity);\n }\n return get_velocity();\n }\n /**\n * Set velocities to achieve desired position at end of time step.\n *

\n * This function is a utility to help with animating kinematic bodies.\n * Kinematic bodies should be moved through velocity, but it is often\n * easier to think in terms of position.\n *

\n * This method will set linear and angular velocities so that the target\n * position/rotation is achieved at end of time step.\n *\n * @param targetPosition The target position for Body.\n * @param targetRotation The target rotation for Body.\n * @param deltaTime The time step for next call to space.step().\n * @throws # If targetPosition is null or disposed of.\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function setVelocityFromTarget(targetPosition:Vec2,targetRotation:Float,deltaTime:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(targetPosition!=null&&targetPosition.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(targetPosition==null)throw \"Cannot set velocity for null target position\";\n if(deltaTime==0)throw \"deltaTime cannot be 0 for setVelocityFromTarget\";\n #end\n var idt=(1/deltaTime);\n this.velocity.set(targetPosition.sub(this.position,true).muleq(idt));\n this.angularVel=(targetRotation-this.rotation)*idt;\n ({\n if(({\n targetPosition.zpp_inner.weak;\n })){\n targetPosition.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Additional kinematic velocity of Body in px/s.\n *

\n * A bodies 'kinematic' velocity is an added velocity bias used in all physics\n * computations but that will not effect how the Body moves directly.\n *

\n * Even a static body can be given a kinematic velocity, and can be used for\n * such things as giving a body of water a fluid-velocity for fluid drag\n * computations.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var kinematicVel(get_kinematicVel,set_kinematicVel):Vec2;\n inline function get_kinematicVel():Vec2{\n if(zpp_inner.wrap_kinvel==null)zpp_inner.setupkinvel();\n return zpp_inner.wrap_kinvel;\n }\n inline function set_kinematicVel(kinematicVel:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(kinematicVel!=null&&kinematicVel.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(kinematicVel==null)throw \"Error: Body::\"+\"kinematicVel\"+\" cannot be null\";\n #end\n this.kinematicVel.set(kinematicVel);\n }\n return get_kinematicVel();\n }\n /**\n * Additional surface velocity for Body in px/s.\n *

\n * A bodies 'surface' velocity is an added velocity bias that is rotated to match\n * the angle of the contact surface used in contact physics and will not\n * effect how the Body moves directly.\n *

\n * Even a static body can be given a surface velocity, and can be used for\n * such things as conveyor belts (By setting the x-component of surfaceVel).\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var surfaceVel(get_surfaceVel,set_surfaceVel):Vec2;\n inline function get_surfaceVel():Vec2{\n if(zpp_inner.wrap_svel==null)zpp_inner.setupsvel();\n return zpp_inner.wrap_svel;\n }\n inline function set_surfaceVel(surfaceVel:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(surfaceVel!=null&&surfaceVel.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(surfaceVel==null)throw \"Error: Body::\"+\"surfaceVel\"+\" cannot be null\";\n #end\n this.surfaceVel.set(surfaceVel);\n }\n return get_surfaceVel();\n }\n /**\n * Accumulated force acting on body in px.kg/s/s\n *

\n * This value is not used internally for any physics computations.\n *

\n * You may set this property only on dynamic bodies.\n *\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var force(get_force,set_force):Vec2;\n inline function get_force():Vec2{\n if(zpp_inner.wrap_force==null)zpp_inner.setupForce();\n return zpp_inner.wrap_force;\n }\n inline function set_force(force:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(force!=null&&force.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(force==null)throw \"Error: Body::\"+\"force\"+\" cannot be null\";\n #end\n this.force.set(force);\n }\n return get_force();\n }\n /**\n * This property represents the velocity seen by constraint physics.\n *

\n * You should not need to use this property unless writing your own\n * constraints using the UserConstraint API.\n */\n #if nape_swc@:isVar #end\n public var constraintVelocity(get_constraintVelocity,never):Vec3;\n inline function get_constraintVelocity():Vec3{\n if(zpp_inner.wrapcvel==null)zpp_inner.setup_cvel();\n return zpp_inner.wrapcvel;\n }\n /**\n * Rotation of Body in clockwise rad.\n *

\n * Attempting to set this value on a static Body that is in a Space will result\n * in a debug build error.\n *

\n * Please note that for kinematic objects, setting this value is equiavalent\n * to 'teleporting' the object, and for normal movement you should be using\n * the kinematic body's angularVel.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var rotation(get_rotation,set_rotation):Float;\n inline function get_rotation():Float{\n return zpp_inner.rot;\n }\n inline function set_rotation(rotation:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::rotation\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(isStatic()&&zpp_inner.space!=null)throw \"Error: Static objects cannot be rotated once inside a Space\";\n #end\n if(this.rotation!=rotation){\n #if(!NAPE_RELEASE_BUILD)\n if((rotation!=rotation))throw \"Error: Body::rotation cannot be NaN\";\n #end\n zpp_inner.rot=rotation;\n zpp_inner.invalidate_rot();\n zpp_inner.wake();\n }\n }\n return get_rotation();\n }\n /**\n * Angular velocity of Body in clockwise rad/s\n *

\n * A static body cannot have its angular velocity set.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var angularVel(get_angularVel,set_angularVel):Float;\n inline function get_angularVel():Float{\n return zpp_inner.angvel;\n }\n inline function set_angularVel(angularVel:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.angularVel!=angularVel){\n #if(!NAPE_RELEASE_BUILD)\n if((angularVel!=angularVel))throw \"Error: Body::angularVel cannot be NaN\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.isStatic())throw \"Error: A static object cannot be given a velocity\";\n #end\n zpp_inner.angvel=angularVel;\n zpp_inner.invalidate_wake();\n }\n }\n return get_angularVel();\n }\n /**\n * Additional kinematic angular velocity of Body in rad/s.\n *

\n * A bodies 'kinematic' velocity is an added velocity bias used in all physics\n * computations but that will not effect how the Body moves directly.\n *

\n * Even a static body can be given a kinematic velocity, and can be used for\n * such things as giving a body of water a fluid-velocity for fluid drag\n * computations.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var kinAngVel(get_kinAngVel,set_kinAngVel):Float;\n inline function get_kinAngVel():Float{\n return zpp_inner.kinangvel;\n }\n inline function set_kinAngVel(kinAngVel:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(this.kinAngVel!=kinAngVel){\n #if(!NAPE_RELEASE_BUILD)\n if((kinAngVel!=kinAngVel))throw \"Error: Body::kinAngVel cannot be NaN\";\n #end\n zpp_inner.kinangvel=kinAngVel;\n zpp_inner.invalidate_wake();\n }\n }\n return get_kinAngVel();\n }\n /**\n * Accumulated torque acting on body in px.px.kg/s/s\n *

\n * This value is not used internally for any physics computations.\n *

\n * You may set this property only on dynamic bodies.\n *\n * @default 0\n */\n #if nape_swc@:isVar #end\n public var torque(get_torque,set_torque):Float;\n inline function get_torque():Float{\n return zpp_inner.torque;\n }\n inline function set_torque(torque:Float):Float{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!isDynamic())throw \"Error: Non-dynamic body cannot have torque applied.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((torque!=torque))throw \"Error: Body::torque cannot be NaN\";\n #end\n if(this.torque!=torque){\n zpp_inner.torque=torque;\n zpp_inner.invalidate_wake();\n }\n }\n return get_torque();\n }\n /**\n * Bounding box of Body in world space.\n *

\n * This value can be accessed even if there are no Shapes in the Body, but\n * attempting to query its values whilst there are no Shapes will result\n * in a debug build error.\n *

\n * This AABB is immutable.\n */\n #if nape_swc@:isVar #end\n public var bounds(get_bounds,never):AABB;\n inline function get_bounds():AABB{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no bounds\";\n #end\n return zpp_inner.aabb.wrapper();\n }\n /**\n * Whether dynamic Body is permitted to be moved by physics linearly.\n *

\n * When this field is false, no physics will be able to cause a change in the\n * bodies linear velocity (It can still move, but only if you tell it to like\n * a kinematic body).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var allowMovement(get_allowMovement,set_allowMovement):Bool;\n inline function get_allowMovement():Bool{\n return!zpp_inner.nomove;\n }\n inline function set_allowMovement(allowMovement:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Body::\"+allowMovement);\n if(this.allowMovement!=allowMovement){\n zpp_inner.nomove=!allowMovement;\n zpp_inner.invalidate_mass();\n }\n }\n return get_allowMovement();\n }\n /**\n * Whether dynamic Body is permitted to be rotated by physics.\n *

\n * When this field is false, no physics will be able to cause a change in the\n * bodies angular velocity (It can still rotate, but only if you tell it to like\n * a kinematic body).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var allowRotation(get_allowRotation,set_allowRotation):Bool;\n inline function get_allowRotation():Bool{\n return!zpp_inner.norotate;\n }\n inline function set_allowRotation(allowRotation:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Body::\"+allowRotation);\n if(this.allowRotation!=allowRotation){\n zpp_inner.norotate=!allowRotation;\n zpp_inner.invalidate_inertia();\n }\n }\n return get_allowRotation();\n }\n /**\n * Method of mass computation for Body.\n *

\n * This value will be set implicitly to FIXED when mass property is set.\n *
Setting back to DEFAULT will then set mass implicitly back to the default\n * computed mass.\n *\n * @default MassMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var massMode(get_massMode,set_massMode):MassMode;\n inline function get_massMode():MassMode{\n return[MassMode.DEFAULT,MassMode.FIXED][zpp_inner.massMode];\n }\n inline function set_massMode(massMode:MassMode):MassMode{\n {\n zpp_inner.immutable_midstep(\"Body::massMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(massMode==null)throw \"Error: cannot use null massMode\";\n #end\n zpp_inner.massMode=massMode==MassMode.DEFAULT?ZPP_Flags.id_MassMode_DEFAULT:ZPP_Flags.id_MassMode_FIXED;\n zpp_inner.invalidate_mass();\n }\n return get_massMode();\n }\n /**\n * Mass to be used for a Body in User built constraints.\n *

\n * This value is given as the inverse mass of the Body taking into account\n * Body type (Static and Kinematic Bodies will have constraintMass of 0)\n * as well as properties like allowMovement.\n */\n #if nape_swc@:isVar #end\n public var constraintMass(get_constraintMass,never):Float;\n inline function get_constraintMass():Float{\n if(!zpp_inner.world)zpp_inner.validate_mass();\n return zpp_inner.smass;\n }\n /**\n * Mass of the Body.\n *

\n * This value is computed by default based on the Body's Shape's areas and\n * Material densities.\n *
\n * When massMode is DEFAULT, accessing this value for an empty Body will thus\n * give an error as the value is undefined.\n *

\n * Setting this value will permit you to give a fixed mass to the Body\n * implicitly changing the massMode to MassMode.FIXED\n */\n #if nape_swc@:isVar #end\n public var mass(get_mass,set_mass):Float;\n inline function get_mass():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no mass\";\n #end\n zpp_inner.validate_mass();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.shapes.empty())throw \"Error: Given current mass mode, Body::mass only makes sense if it contains shapes\";\n #end\n return zpp_inner.cmass;\n }\n inline function set_mass(mass:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::mass\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((mass!=mass))throw \"Error: Mass cannot be NaN\";\n if(mass<=0)throw \"Error: Mass must be strictly positive\";\n if(mass>=ZPP_Const.POSINF())throw \"Error: Mass cannot be infinite, use allowMovement = false instead\";\n #end\n zpp_inner.massMode=ZPP_Flags.id_MassMode_FIXED;\n zpp_inner.cmass=mass;\n zpp_inner.invalidate_mass();\n }\n return get_mass();\n }\n /**\n * Method of computing mass as seen by gravity.\n *

\n * This value will be implicitly set by modifying gravMass or gravMassScale properties.\n *\n * @default GravMassMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var gravMassMode(get_gravMassMode,set_gravMassMode):GravMassMode;\n inline function get_gravMassMode():GravMassMode{\n return[GravMassMode.DEFAULT,GravMassMode.FIXED,GravMassMode.SCALED][zpp_inner.massMode];\n }\n inline function set_gravMassMode(gravMassMode:GravMassMode):GravMassMode{\n {\n zpp_inner.immutable_midstep(\"Body::gravMassMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(gravMassMode==null)throw \"Error: Cannot use null gravMassMode\";\n #end\n zpp_inner.gravMassMode=gravMassMode==GravMassMode.SCALED?ZPP_Flags.id_GravMassMode_SCALED:gravMassMode==GravMassMode.DEFAULT?ZPP_Flags.id_GravMassMode_DEFAULT:ZPP_Flags.id_GravMassMode_FIXED;\n zpp_inner.invalidate_gravMass();\n }\n return get_gravMassMode();\n }\n /**\n * Mass used in gravity computations in a Space.\n *

\n * Setting this value will implicitly change the gravMassMode to FIXED.\n *
\n * Set to 0 to disable gravity for this Body.\n */\n #if nape_swc@:isVar #end\n public var gravMass(get_gravMass,set_gravMass):Float;\n inline function get_gravMass():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no gravMass\";\n #end\n zpp_inner.validate_gravMass();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty()){\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.gravMassMode!=ZPP_Flags.id_GravMassMode_FIXED)throw \"Error: Given current mass/gravMass modes; Body::gravMass only makes sense if it contains Shapes\";\n }\n #end\n return zpp_inner.gravMass;\n }\n inline function set_gravMass(gravMass:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::gravMass\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((gravMass!=gravMass))throw \"Error: gravMass cannot be NaN\";\n #end\n zpp_inner.gravMassMode=ZPP_Flags.id_GravMassMode_FIXED;\n zpp_inner.gravMass=gravMass;\n zpp_inner.invalidate_gravMass();\n }\n return get_gravMass();\n }\n /**\n * Mass scale used in computation of gravity for Body in Space.\n *

\n * Setting this value will implicitly change the gravMassMode to SCALED.\n *
\n * When set, the gravMass of Body will be computed as this scaling factor\n * multiplied with the Body's mass.\n */\n #if nape_swc@:isVar #end\n public var gravMassScale(get_gravMassScale,set_gravMassScale):Float;\n inline function get_gravMassScale():Float{\n zpp_inner.validate_gravMassScale();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty()){\n if(zpp_inner.massMode==ZPP_Flags.id_MassMode_DEFAULT&&zpp_inner.gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)throw \"Error: Given current mass/gravMass modes; Body::gravMassScale only makes sense if it contains Shapes\";\n }\n #end\n return zpp_inner.gravMassScale;\n }\n inline function set_gravMassScale(gravMassScale:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::gravMassScale\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((gravMassScale!=gravMassScale))throw \"Error: gravMassScale cannot be NaN\";\n #end\n zpp_inner.gravMassMode=ZPP_Flags.id_GravMassMode_SCALED;\n zpp_inner.gravMassScale=gravMassScale;\n zpp_inner.invalidate_gravMassScale();\n }\n return get_gravMassScale();\n }\n /**\n * Method of computing Body moment of inertia.\n *

\n * This value will be set implicitly by modifying Body inertia property.\n *\n * @default InertiaMode.DEFAULT\n */\n #if nape_swc@:isVar #end\n public var inertiaMode(get_inertiaMode,set_inertiaMode):InertiaMode;\n inline function get_inertiaMode():InertiaMode{\n return[InertiaMode.DEFAULT,InertiaMode.FIXED][zpp_inner.inertiaMode];\n }\n inline function set_inertiaMode(inertiaMode:InertiaMode):InertiaMode{\n {\n zpp_inner.immutable_midstep(\"Body::inertiaMode\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(inertiaMode==null)throw \"Error: Cannot use null InertiaMode\";\n #end\n zpp_inner.inertiaMode=inertiaMode==InertiaMode.FIXED?ZPP_Flags.id_InertiaMode_FIXED:ZPP_Flags.id_InertiaMode_DEFAULT;\n zpp_inner.invalidate_inertia();\n }\n return get_inertiaMode();\n }\n /**\n * Moment of inertia to be used in user defined Constraints.\n *

\n * This value is equal to the inverse inertia of the Body taking into account\n * Body type (Static and Kinematic bodies will have constraintInertia of 0).\n * As well as properties like allowRotation.\n */\n #if nape_swc@:isVar #end\n public var constraintInertia(get_constraintInertia,never):Float;\n inline function get_constraintInertia():Float{\n if(!zpp_inner.world)zpp_inner.validate_inertia();\n return zpp_inner.sinertia;\n }\n /**\n * Moment of inertia of this Body.\n *

\n * Setting this value will implicitly change the inertiaMode to FIXED.\n */\n #if nape_swc@:isVar #end\n public var inertia(get_inertia,set_inertia):Float;\n inline function get_inertia():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no inertia\";\n #end\n zpp_inner.validate_inertia();\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT&&shapes.empty())throw \"Error: Given current inertia mode flag, Body::inertia only makes sense if Body contains Shapes\";\n #end\n return zpp_inner.cinertia;\n }\n inline function set_inertia(inertia:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Body::inertia\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((inertia!=inertia))throw \"Error: Inertia cannot be NaN\";\n if(inertia<=0)throw \"Error: Inertia must be strictly positive\";\n if(inertia>=ZPP_Const.POSINF())throw \"Error: Inertia cannot be infinite, use allowRotation = false instead\";\n #end\n zpp_inner.inertiaMode=ZPP_Flags.id_InertiaMode_FIXED;\n zpp_inner.cinertia=inertia;\n zpp_inner.invalidate_inertia();\n }\n return get_inertia();\n }\n /**\n * Compute set of bodies connected via constraints.\n *

\n * Only constraints that are inside of a Space will be considered the\n * same way that the body's constraints list only tracks constraints\n * that are part of a simulation.\n *\n * @param depth Control the depth limit of the graph search. Negative\n * values indicate an unlimited search. A depth value of\n * 0 would cause only the current Body to be returned.\n * (default -1)\n * @param output An optional list to append results to, if left as null\n * then a new list is created.\n * @return A list of the connected bodies up to\n * the given graph depth.\n */\n #if nape_swc@:keep #end\n public function connectedBodies(depth:Int=-1,output:BodyList=null):BodyList{\n return zpp_inner.connectedBodies(depth,output);\n }\n /**\n * Compute set of bodies interacting with this body.\n *\n * @param type When not equal to null, this parameter controls what sort\n * of interaction we permit in the search.\n * @param depth Control the depth limit of the graph search. Negative\n * values indicate an unlimited search. A depth value of\n * 0 would cause only the current Body to be returned.\n * (default -1)\n * @param output An optional list to append results to, if left as null\n * then a new list is created.\n * @return A list of the interacting bodies up to\n * the given graph depth.\n */\n #if nape_swc@:keep #end\n public function interactingBodies(type:InteractionType=null,depth:Int=-1,output:BodyList=null){\n var arbiter_type=if(type==null){\n ZPP_Arbiter.COL|ZPP_Arbiter.SENSOR|ZPP_Arbiter.FLUID;\n }\n else if(type==InteractionType.COLLISION)ZPP_Arbiter.COL else if(type==InteractionType.SENSOR)ZPP_Arbiter.SENSOR else ZPP_Arbiter.FLUID;\n return zpp_inner.interactingBodies(arbiter_type,depth,output);\n }\n /**\n * Determine how much this body is being crushed.\n *

\n * This is an approximate value, computed as:\n * crushFactor = (sum(magnitude(impulse)) - magnitude(sum(impulse))) / mass\n *

\n * In this way, it is a mass and time step invariant value which is 0 when all impulses\n * are acting on body in the same direction, and has maximum value when impulses\n * act in opposing directions 'crushing' the Body.\n *\n * @return A positive value representing an approximation to how much the\n * body is being crushed.\n * @throws # If body is not in a Space.\n */\n #if nape_swc@:keep #end\n public function crushFactor():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(space==null)throw \"Error: Makes no sense to see how much an object not taking part in a simulation is being crushed\";\n #end\n var msum=0.0;\n var jsum=Vec2.get();\n for(arb in arbiters){\n var imp3=arb.totalImpulse(this);\n var imp=imp3.xy();\n jsum.addeq(imp);\n msum+=imp.length;\n imp.dispose();\n imp3.dispose();\n }\n for(con in constraints){\n var imp3=con.bodyImpulse(this);\n var imp=imp3.xy();\n jsum.addeq(imp);\n msum+=imp.length;\n imp.dispose();\n imp3.dispose();\n }\n var ret=(msum-jsum.length)/(this.mass*space.zpp_inner.pre_dt);\n jsum.dispose();\n return ret;\n }\n /**\n * Transform a point from Body's local coordinates to world coordinates.\n *\n * @param point The point to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function localPointToWorld(point:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(zpp_inner.axisy*point.x-zpp_inner.axisx*point.y);\n tempy=(point.x*zpp_inner.axisx+point.y*zpp_inner.axisy);\n };\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx+zpp_inner.posx,tempy+zpp_inner.posy,weak);\n }\n /**\n * Transform a point from world coordinates to Body's local coordinates.\n *\n * @param point The point to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function worldPointToLocal(point:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n var pointx:Float=0.0;\n var pointy:Float=0.0;\n {\n pointx=point.x-zpp_inner.posx;\n pointy=point.y-zpp_inner.posy;\n };\n {\n tempx=pointx*zpp_inner.axisy+pointy*zpp_inner.axisx;\n tempy=pointy*zpp_inner.axisy-pointx*zpp_inner.axisx;\n };\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Transform vector from Body's local coordinates into world coordinates.\n *

\n *\n * @param vector The vector to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If vector is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function localVectorToWorld(vector:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(zpp_inner.axisy*vector.x-zpp_inner.axisx*vector.y);\n tempy=(vector.x*zpp_inner.axisx+vector.y*zpp_inner.axisy);\n };\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Transform vector from world coordinates to Body's local coordinates\n *

\n *\n * @param vector The vector to transform.\n * @param weak If true the returned Vec2 will be automatically released\n * back to object pool when used as an argument to a Nape function.\n * (default false)\n * @return The result of the transformation.\n * @throws # If vector is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function worldVectorToLocal(vector:Vec2,weak:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(vector!=null&&vector.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null)throw \"Error: Cannot transform null Vec2\";\n #end\n zpp_inner.validate_axis();\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=vector.x*zpp_inner.axisy+vector.y*zpp_inner.axisx;\n tempy=vector.y*zpp_inner.axisy-vector.x*zpp_inner.axisx;\n };\n ({\n if(({\n vector.zpp_inner.weak;\n })){\n vector.dispose();\n true;\n }\n else{\n false;\n }\n });\n return Vec2.get(tempx,tempy,weak);\n }\n /**\n * Apply impulse to a point on Body.\n *

\n * If position argument is not given, then body.position is assumed so that impulse\n * is applied at centre of Body.\n *\n * @param impulse The impulse to apply given in world coordinates.\n * @param pos The position to apply impulse given in world coordinates.\n * (default body.position)\n * @param sleepable This parameter can be set to true, in the case that you\n * are constantly applying an impulse which is dependent only\n * on the position/velocity of the body meaning that application\n * of this impulse does not need to prevent the object from sleeping.\n * When true, and the body is sleeping, this method call will not\n * apply any impulse.\n * (default false).\n * @throws # If impulse is null or disposed of.\n * @throws # If pos is non-null and disposed of.\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function applyImpulse(impulse:Vec2,pos:Vec2=null,sleepable:Bool=false){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(impulse!=null&&impulse.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n #if(!NAPE_RELEASE_BUILD)\n if(pos!=null&&pos.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(impulse==null)throw \"Error: Cannot apply null impulse to Body\";\n #end\n if(sleepable&&isSleeping){\n ({\n if(({\n impulse.zpp_inner.weak;\n })){\n impulse.dispose();\n true;\n }\n else{\n false;\n }\n });\n if(pos!=null){\n ({\n if(({\n pos.zpp_inner.weak;\n })){\n pos.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n return this;\n }\n zpp_inner.validate_mass();\n {\n var t=(zpp_inner.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"zpp_inner.vel\"+\",in b: \"+\"impulse.\"+\",in s: \"+\"zpp_inner.imass\"+\")\");\n #end\n };\n zpp_inner.velx+=impulse.x*t;\n zpp_inner.vely+=impulse.y*t;\n };\n if(pos!=null){\n var rx:Float=0.0;\n var ry:Float=0.0;\n {\n rx=pos.x-zpp_inner.posx;\n ry=pos.y-zpp_inner.posy;\n };\n zpp_inner.validate_inertia();\n zpp_inner.angvel+=(impulse.y*rx-impulse.x*ry)*zpp_inner.iinertia;\n ({\n if(({\n pos.zpp_inner.weak;\n })){\n pos.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n if(!sleepable){\n if(isDynamic())zpp_inner.invalidate_wake();\n }\n ({\n if(({\n impulse.zpp_inner.weak;\n })){\n impulse.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Apply a pure angular impulse to Body.\n *\n * @param impulse The angular impulse to apply.\n * @param sleepable This parameter can be set to true, in the case that you\n * are constantly applying an impulse which is dependent only\n * on the position/velocity of the body meaning that application\n * of this impulse does not need to prevent the object from sleeping.\n * When true, and the body is sleeping, this method call will not\n * apply any impulse.\n * (default false).\n * @returns A reference to 'this' Body.\n */\n #if nape_swc@:keep #end\n public function applyAngularImpulse(impulse:Float,sleepable:Bool=false){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n if(sleepable&&isSleeping){\n return this;\n }\n zpp_inner.validate_inertia();\n zpp_inner.angvel+=impulse*zpp_inner.iinertia;\n if(!sleepable){\n if(isDynamic())zpp_inner.invalidate_wake();\n }\n return this;\n }\n /**\n * Translate each shape in local coordinates.\n *

\n * This operation does not effect the Body's position, but the position\n * of the shapes 'inside' of the Body.\n *\n * @param translation The local translation to apply to Shapes.\n * @return A reference to this Body.\n * @throws # If translation is null or has been disposed of.\n * @throws # If this Body is static, and inside of a Space.\n */\n #if nape_swc@:keep #end\n public function translateShapes(translation:Vec2){\n zpp_inner.immutable_midstep(\"Body::translateShapes()\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(translation==null)throw \"Error: Cannot displace by null Vec2\";\n #end\n var weak=translation.zpp_inner.weak;\n translation.zpp_inner.weak=false;\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.translate(translation);\n cx_ite=cx_ite.next;\n }\n };\n translation.zpp_inner.weak=weak;\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Rotate each shape in local coordinates.\n *

\n * This operation does not effect the Body's rotation, but rotates\n * each of the shapes 'inside' of the Body.\n *\n * @param angle The angle to rotate shapes by in clockwise radians.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n */\n #if nape_swc@:keep #end\n public function rotateShapes(angle:Float){\n zpp_inner.immutable_midstep(\"Body::rotateShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.rotate(angle);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Scale each shape in local coordinates.\n *

\n * This operation does not affect the Body itself, but affects each\n * Shape 'inside' of the Body instead.\n *\n * @param scaleX The x-coordinate factor of scaling.\n * @param scaleY The y-coordinate factor of scaling.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If Body contains Circle shapes, and scaleX != scaleY\n */\n #if nape_swc@:keep #end\n public function scaleShapes(scaleX:Float,scaleY:Float){\n zpp_inner.immutable_midstep(\"Body::scaleShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.scale(scaleX,scaleY);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Transform each shape in local coordiantes.\n *

\n * This operation does not affect the Body itself, but affects each\n * Shape 'inside' of the Body instead.\n *\n * @param matrix The transformation matrix to apply to each Shape.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If matrix is null or singular.\n * @throws # If Body contains Circle shapes, and input matrix is\n * not equiorthogonal.\n */\n #if nape_swc@:keep #end\n public function transformShapes(matrix:Mat23){\n zpp_inner.immutable_midstep(\"Body::transformShapes()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.transform(matrix);\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Align rigid body so that its origin is also its centre of mass.\n *

\n * This operation will both translate the Shapes inside of the Body,\n * as well as translating the Body itself so that its 'apparent' position\n * has not been modified.\n *

\n * Alignment of Rigid bodies is necessary for dynamic bodies so that\n * they will interact and rotate as expected.\n *

\n * Simple Body's created with a single Polygon.box() or basic Circle\n * will already be aligned.\n *\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function align(){\n zpp_inner.immutable_midstep(\"Body::align()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.shapes.empty())throw \"Error: Cannot align empty Body\";\n #end\n zpp_inner.validate_localCOM();\n var dx=Vec2.get(-zpp_inner.localCOMx,-zpp_inner.localCOMy);\n translateShapes(dx);\n var dx2=localVectorToWorld(dx);\n position.subeq(dx2);\n if(zpp_inner.pre_posx
\n * Please note that this method is equivalent to teleporting the body,\n * the same way direct manipulation of position and rotation is.\n *\n * @param centre The centre of rotation in world coordinates.\n * @param angle The angle to rotate body by in clockwise radians.\n * @return A reference to this Body.\n * @throws # If this Body is static, and inside of a Space.\n * @throws # If centre is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function rotate(centre:Vec2,angle:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(centre!=null&¢re.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(centre==null)throw \"Error: Cannot rotate about a null Vec2\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle))throw \"Error: Cannot rotate by NaN radians\";\n #end\n var weak=centre.zpp_inner.weak;\n centre.zpp_inner.weak=false;\n var del=position.sub(centre);\n del.rotate(angle);\n position=centre.add(del,true);\n del.dispose();\n rotation+=angle;\n centre.zpp_inner.weak=weak;\n ({\n if(({\n centre.zpp_inner.weak;\n })){\n centre.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Set material of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.material = material)\n *\n * @param material The material to set Shape's material to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeMaterials(material:Material){\n zpp_inner.immutable_midstep(\"Body::setShapeMaterials()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.material=material;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Set interaction filter of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.filter = filter)\n *\n * @param filter The filter to set Shape's filter to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeFilters(filter:InteractionFilter){\n zpp_inner.immutable_midstep(\"Body::setShapeFilters()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.filter=filter;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Set fluidProperties of all shapes.\n *

\n * Equivalent to: body.shapes.foreach(function (shape) shape.fluidProperties = fluidProperties)\n *\n * @param fluidProperties The fluidProperties to set Shape's fluidProperties to.\n * @return A reference to this Body.\n */\n #if nape_swc@:keep #end\n public function setShapeFluidProperties(fluidProperties:FluidProperties){\n zpp_inner.immutable_midstep(\"Body::setShapeFluidProperties()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world is immutable\";\n #end\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.outer.fluidProperties=fluidProperties;\n cx_ite=cx_ite.next;\n }\n };\n return this;\n }\n /**\n * Local centre of mass of Body.\n *

\n * This value can be accessed even if Body has no shapes, but attempting\n * to query its values will result in a debug build error.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var localCOM(get_localCOM,never):Vec2;\n inline function get_localCOM():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no \"+\"localCOM\";\n #end\n if(zpp_inner.wrap_localCOM==null){\n zpp_inner.wrap_localCOM=Vec2.get(zpp_inner.localCOMx,zpp_inner.localCOMy);\n zpp_inner.wrap_localCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_localCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_localCOM.zpp_inner._validate=zpp_inner.getlocalCOM;\n }\n return zpp_inner.wrap_localCOM;\n }\n /**\n * World centre of mass of Body.\n *

\n * This value can be accessed even if Body has no shapes, but attempting\n * to query its values will result in a debug build error.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldCOM(get_worldCOM,never):Vec2;\n inline function get_worldCOM():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.world)throw \"Error: Space::world has no \"+\"worldCOM\";\n #end\n if(zpp_inner.wrap_worldCOM==null){\n zpp_inner.wrap_worldCOM=Vec2.get(zpp_inner.worldCOMx,zpp_inner.worldCOMy);\n zpp_inner.wrap_worldCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_worldCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_worldCOM.zpp_inner._validate=zpp_inner.getworldCOM;\n }\n return zpp_inner.wrap_worldCOM;\n }\n /**\n * Evaluate sum effect of all normal contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function normalImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.normalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all tangent contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function tangentImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.tangentImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all contact impulses on Body.\n *

\n * If the body argument is non-null, then only impulses between 'this' and\n * the given Body will be considered.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function totalContactsImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n {\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type!=ZPP_Arbiter.COL)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n {\n var imp=arb.wrapper().collisionArbiter.totalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n };\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Evaluate sum effect of all rolling friction contact impulses on Body.\n *





\n * Constraint impulses are not effected by the body argument.\n *\n * @param body The Body to restrict consideration of impulses with.\n * (default null)\n * @param freshOnly If true, then only 'new' contact points will be considered\n * when evaluating contact impulses.\n * (default false)\n * @return The summed effect of impulses acting on Body.\n */\n #if nape_swc@:keep #end\n public function totalImpulse(body:Body=null,freshOnly:Bool=false){\n var retx:Float=0;\n var rety:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((retx!=retx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(retx)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rety!=rety));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rety)\"+\") :: \"+(\"vec_new(in n: \"+\"ret\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var retz:Float=0;\n var arbs=zpp_inner.arbiters;\n for(oarb in arbiters){\n var arb=oarb.zpp_inner;\n if(arb.type==ZPP_Arbiter.SENSOR)continue;\n if(body!=null&&arb.b2!=body.zpp_inner&&arb.b1!=body.zpp_inner)continue;\n var imp=arb.wrapper().totalImpulse(this,freshOnly);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n {\n var cx_ite=zpp_inner.constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n {\n if(con.active){\n var imp=con.outer.bodyImpulse(this);\n {\n var t=(1);\n {\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"ret\"+\",in b: \"+\"imp.\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n retx+=imp.x*t;\n rety+=imp.y*t;\n };\n retz+=imp.z*t;\n };\n imp.dispose();\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n return Vec3.get(retx,rety,retz);\n }\n /**\n * Determine if point is contained in Body.\n *\n * @param point The point to test containment for in world coordinates.\n * @return True if point is contained.\n * @throws # If point is null or has been disposed.\n */\n #if nape_swc@:keep #end\n public function contains(point:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot check containment of null point\";\n #end\n var wasWeak=point.zpp_inner.weak;\n point.zpp_inner.weak=false;\n var retvar;\n {\n retvar=false;\n {\n var cx_ite=zpp_inner.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.outer.contains(point)){\n retvar=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n point.zpp_inner.weak=wasWeak;\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return retvar;\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n return(zpp_inner.world?\"(space::world\":(\"(\"+(isDynamic()?\"dynamic\":isStatic()?\"static\":\"kinematic\")))+\")#\"+id;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass BodyIterator{\n /**\n * @private\n */\n public var zpp_inner:BodyList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:BodyIterator=null;\n /**\n * @private\n */\n public var zpp_next:BodyIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_BodyList.internal)throw \"Error: Cannot instantiate \"+\"Body\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:BodyList){\n var ret=if(zpp_pool==null){\n ZPP_BodyList.internal=true;\n var ret=new BodyIterator();\n ZPP_BodyList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Body = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Body = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Body = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass BodyList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_BodyList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Body\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new BodyList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Body)#else Std.is(i,Body)#end)throw \"Error: Array contains non \"+\"Body\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new BodyList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Body):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Body{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Body{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Body):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Body):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Body\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return BodyIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new BodyList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Body\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:BodyList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_BodyList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Body->Void):BodyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=BodyIterator.zpp_pool;\n BodyIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Body->Bool):BodyList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This compound owns its constituents and works in the callback system and with\n * respect to adding/removing from a Space as a single object.\n *
\n *       ____Cmp1_____\n *      /    /    \   \\n * Body1 Body2--Joint Cmp2\n *   |     |        \  |\n * Shp1  Shp2        Body3\n *                     |\n *                    Shp3\n * 
\n * For example if you have a complex car built with several bodies and\n * constraints you might store this in a Compound providing an easy way\n * of removing/adding/copying the Car as well as being able to get a single\n * callback for when the car collides with something.\n *

\n * When you add a compound to a Space, all of it's constituents get added\n * and furthermore, those constituents cannot be added seperately.\n */\n@:final#if nape_swc@:keep #end\nclass Compound extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Compound=null;\n /**\n * List of bodies directly owned by this Compound.\n *

\n * This list does not include those bodies belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var bodies(get_bodies,never):BodyList;\n inline function get_bodies():BodyList{\n return zpp_inner.wrap_bodies;\n }\n /**\n * List of constraints directly owned by this Compound.\n *

\n * This list does not include those constraints belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n return zpp_inner.wrap_constraints;\n }\n /**\n * List of compounds directly owned by this Compound.\n *

\n * This list does not include those compounds belonging to sub-compounds.\n *\n * @default []\n */\n #if nape_swc@:isVar #end\n public var compounds(get_compounds,never):CompoundList;\n inline function get_compounds():CompoundList{\n return zpp_inner.wrap_compounds;\n }\n /**\n * Compound that this compound belongs to.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var compound(get_compound,set_compound):Null;\n inline function get_compound():Null{\n return if(zpp_inner.compound==null)null else zpp_inner.compound.outer;\n }\n inline function set_compound(compound:Null):Null{\n {\n zpp_inner.immutable_midstep(\"Compound::compound\");\n if(this.compound!=compound){\n if(this.compound!=null)this.compound.compounds.remove(this);\n if(compound!=null)compound.compounds.add(this);\n }\n }\n return get_compound();\n }\n /**\n * Space this compound belongs to.\n *

\n * This value is immutable when this compound belongs to another parent Compound.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var space(get_space,set_space):Null;\n inline function get_space():Null{\n return if(zpp_inner.space==null)null else zpp_inner.space.outer;\n }\n inline function set_space(space:Null):Null{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.compound!=null)throw \"Error: Cannot set the space of an inner Compound, only the root Compound space can be set\";\n #end\n zpp_inner.immutable_midstep(\"Compound::space\");\n if(this.space!=space){\n if(this.space!=null)this.space.compounds.remove(this);\n if(space!=null)space.compounds.add(this);\n }\n }\n return get_space();\n }\n /**\n * Construct a new Compound.\n *\n * @result The constructed Compound.\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner=new ZPP_Compound();\n zpp_inner.outer=this;\n zpp_inner.outer_i=this;\n zpp_inner_i=zpp_inner;\n zpp_inner.insert_cbtype(CbType.ANY_COMPOUND.zpp_inner);\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n return \"Compound\"+this.id;\n }\n /**\n * Produce an exact copy of this Compound.\n *

\n * This copy will remap owned constraints so that their body properties\n * refer to the newly copied bodies also owned by this compound.\n *

\n * If this compound tree contains any constraints that make references\n * to outside of this compound; then these properties will be made null.\n *
\n     *       ____Cmp1____               [Cmp2.copy()]\n     *      /    /        \\n     * Body1 Body2___     Cmp2        null    Cmp2'\n     *   |     |     \     /  \         \    /    \\n     * Shp1  Shp2     Joint--Body3       Joint'--Body3'\n     *                         |                   |\n     *                        Shp3               Shp3'\n     * 
\n * For instance if copying Cmp1 then all is well, but if we copy Cmp2 the\n * copied Joint will have one of it's body references null as that body is\n * not owned directly, or indirectly by the compound.\n */\n public function copy(){\n return zpp_inner.copy();\n }\n /**\n * Breaking compound apart in-place.\n *

\n * This method will destroy the compound, moving all of it's components\n * to the assigned Space if this is the root compound, otherwise to the\n * parent compound.\n *

\n * Apart from being easier than doing this manually it also means that we\n * do not have to temporarigly remove objects from the space meaning that\n * things like PreListener ignored interactions will be unaffected.\n */\n public function breakApart(){\n zpp_inner.breakApart();\n }\n /**\n * Method to iterate over all bodies contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitBodies\";\n #end\n for(b in bodies)lambda(b);\n for(c in compounds)c.visitBodies(lambda);\n }\n /**\n * Method to iterate over all constraints contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Constraint.\n * @throws # If lambda is null.\n */\n public function visitConstraints(lambda:Constraint->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitConstraints\";\n #end\n for(c in constraints)lambda(c);\n for(c in compounds)c.visitConstraints(lambda);\n }\n /**\n * Method to iterate over all compounds contained directly or indirectly by\n * this Compound.\n *\n * @param lambda The method to apply to each Compound.\n * @throws # If lambda is null.\n */\n public function visitCompounds(lambda:Compound->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Compound::visitConstraints\";\n #end\n for(c in compounds){\n lambda(c);\n c.visitCompounds(lambda);\n }\n }\n /**\n * Compute centre of mass of Compound.\n *\n * @param weak If true, the returned Vec2 will be automatically released\n * to the object pool when passed as an argument to a Nape\n * function. (default false)\n * @return The centre of mass of compound.\n * @throws # If Compound has no Bodies contained directly or indirectly\n * that contain at least one Shape.\n */\n public function COM(weak:Bool=false){\n var ret=Vec2.get(0,0,weak);\n var total=0.0;\n visitBodies(function(b){\n if(!b.shapes.empty()){\n ret.addeq(b.worldCOM.mul(b.mass,true));\n total+=b.mass;\n }\n });\n #if(!NAPE_RELEASE_BUILD)\n if(total==0.0)throw \"Error: COM of an empty Compound is undefined silly\";\n #end\n ret.muleq(1/total);\n return ret;\n }\n /**\n * Translate entire compound.\n *

\n * This is equivalent to: compound.visitBodies(function (b) b.translate(translation))\n *\n * @param translation The translation to apply to the Compound.\n * @return A reference to this Compound.\n * @throws # If translation is null or disposed of.\n * @throws # If any Body in the compound is static, and this compound is in a Space.\n */\n public function translate(translation:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(translation==null)throw \"Error: Cannot translate by null Vec2\";\n #end\n var weak=translation.zpp_inner.weak;\n translation.zpp_inner.weak=false;\n visitBodies(function(b)b.position.addeq(translation));\n translation.zpp_inner.weak=weak;\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Rotate entire compound about a point.\n *

\n * This is equivalent to: compound.visitBodies(function (b) b.rotate(centre, angle))\n *\n * @param centre The centre of rotation in world coordinates.\n * @param angle The clockwise angle of rotation in radians.\n * @return A reference to this Compound.\n * @throws # If centre is null or disposed of.\n * @throws # If any Body in the compound is static, and this compound is in a Space.\n */\n public function rotate(centre:Vec2,angle:Float){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(centre!=null&¢re.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(centre==null)throw \"Error: Cannot rotate about a null Vec2\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if((angle!=angle))throw \"Error: Cannot rotate by NaN radians\";\n #end\n var weak=centre.zpp_inner.weak;\n centre.zpp_inner.weak=false;\n visitBodies(function(b)b.rotate(centre,angle));\n centre.zpp_inner.weak=weak;\n ({\n if(({\n centre.zpp_inner.weak;\n })){\n centre.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CompoundIterator{\n /**\n * @private\n */\n public var zpp_inner:CompoundList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:CompoundIterator=null;\n /**\n * @private\n */\n public var zpp_next:CompoundIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_CompoundList.internal)throw \"Error: Cannot instantiate \"+\"Compound\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:CompoundList){\n var ret=if(zpp_pool==null){\n ZPP_CompoundList.internal=true;\n var ret=new CompoundIterator();\n ZPP_CompoundList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Compound = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Compound = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Compound = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass CompoundList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_CompoundList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Compound\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new CompoundList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Compound)#else Std.is(i,Compound)#end)throw \"Error: Array contains non \"+\"Compound\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new CompoundList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Compound):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Compound{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Compound{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Compound{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Compound):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Compound):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Compound\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return CompoundIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new CompoundList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Compound\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:CompoundList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_CompoundList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Compound->Void):CompoundList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=CompoundIterator.zpp_pool;\n CompoundIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Compound->Bool):CompoundList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Construct a new FluidProperties objects.\n *\n * @param density The density of the fluid in g/px/px. (default 1)\n * @param viscosity The viscosity of the fluid for drag computations in kg/px/s\n * (default 1)\n * @return The constructed FluidProperties object.\n */\n public function new(density:Float=1,viscosity:Float=1){\n {\n if(ZPP_FluidProperties.zpp_pool==null){\n zpp_inner=new ZPP_FluidProperties();\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_TOT++;\n ZPP_FluidProperties.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT--;\n ZPP_FluidProperties.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.density=density;\n this.viscosity=viscosity;\n }\n /**\n * Produce a copy of this FluidProperties object.\n *

\n * The copied object will be identical in all properties with the the\n * copied userData being assigned the same fields as 'this' Shape with the\n * same values copied over by reference for object types.\n *\n * @return The copied FluidProperties.\n */\n #if nape_swc@:keep #end\n public function copy(){\n var ret=new FluidProperties(density,viscosity);\n if(zpp_inner.userData!=null)ret.zpp_inner.userData=Reflect.copy(zpp_inner.userData);\n ret.gravity=this.gravity;\n return ret;\n }\n /**\n * Density of fluid.\n *

\n * This value, like Material density is of g/pixel/pixel.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var density(get_density,set_density):Float;\n inline function get_density():Float{\n return zpp_inner.density*(\"density\"==\"density\"?1000:1);\n }\n inline function set_density(density:Float):Float{\n {\n if(density!=this.density){\n #if(!NAPE_RELEASE_BUILD)\n if((density!=density))throw \"Error: FluidProperties::\"+\"density\"+\" cannot be NaN\";\n if(\"density\"!=\"density\"&&density<0)throw \"Error: FluidProperties::\"+\"density\"+\" (\"+density+\") must be >= 0\";\n #end\n zpp_inner.density=density/(\"density\"==\"density\"?1000:1);\n zpp_inner.invalidate();\n }\n }\n return get_density();\n }\n /**\n * Viscosity of fluid.\n *

\n * This value is used in drag comutations, the higher the viscosity the\n * more quickly objects will come to rest in the fluid.\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var viscosity(get_viscosity,set_viscosity):Float;\n inline function get_viscosity():Float{\n return zpp_inner.viscosity*(\"viscosity\"==\"density\"?1000:1);\n }\n inline function set_viscosity(viscosity:Float):Float{\n {\n if(viscosity!=this.viscosity){\n #if(!NAPE_RELEASE_BUILD)\n if((viscosity!=viscosity))throw \"Error: FluidProperties::\"+\"viscosity\"+\" cannot be NaN\";\n if(\"viscosity\"!=\"density\"&&viscosity<0)throw \"Error: FluidProperties::\"+\"viscosity\"+\" (\"+viscosity+\") must be >= 0\";\n #end\n zpp_inner.viscosity=viscosity/(\"viscosity\"==\"density\"?1000:1);\n zpp_inner.invalidate();\n }\n }\n return get_viscosity();\n }\n /**\n * Local gravity for buoyancy computations.\n *

\n * When this value is not null, it will be used in place of the Space gravity\n * when performing buoyancy computations.\n */\n #if nape_swc@:isVar #end\n public var gravity(get_gravity,set_gravity):Null;\n inline function get_gravity():Null{\n return zpp_inner.wrap_gravity;\n }\n inline function set_gravity(gravity:Null):Null{\n {\n if(gravity==null){\n if(zpp_inner.wrap_gravity!=null){\n zpp_inner.wrap_gravity.zpp_inner._inuse=false;\n zpp_inner.wrap_gravity.dispose();\n zpp_inner.wrap_gravity=null;\n }\n }\n else{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n if(zpp_inner.wrap_gravity==null)zpp_inner.getgravity();\n this.gravity.set(gravity);\n }\n }\n return get_gravity();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"{ density: \"+density+\" viscosity: \"+viscosity+\" gravity: \"+gravity+\" }\";\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of GravMassMode values for a Body.\n */\n@:final#if nape_swc@:keep #end\nclass GravMassMode{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"GravMassMode\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==DEFAULT)return\"DEFAULT\";\n else if(this==FIXED)return\"FIXED\";\n else if(this==SCALED)return\"SCALED\";\n else return \"\";\n }\n /**\n * Default method of computation.\n *

\n * Mass seen by gravity equal to the Body mass.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):GravMassMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.GravMassMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_DEFAULT=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Mass seen by gravity set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):GravMassMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.GravMassMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_FIXED=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_FIXED;\n }\n /**\n * Scaled method of computation.\n *

\n * Mass seen by gravity computed as a factor of the Body mass with\n * scaling factor set by user.\n */\n #if nape_swc@:isVar #end\n public static var SCALED(get_SCALED,never):GravMassMode;\n inline static function get_SCALED(){\n if(ZPP_Flags.GravMassMode_SCALED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.GravMassMode_SCALED=new GravMassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.GravMassMode_SCALED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Enumeration of InertiaMode values for a Body.\n */\n@:final#if nape_swc@:keep #end\nclass InertiaMode{\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Flags.internal)throw \"Error: Cannot instantiate \"+\"InertiaMode\"+\" derp!\";\n #end\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(false)return \"\";\n \n else if(this==DEFAULT)return\"DEFAULT\";\n else if(this==FIXED)return\"FIXED\";\n else return \"\";\n }\n /**\n * Default method of computation.\n *

\n * Moment of inertia will be computed based on Body's Shape's inertias and densities.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):InertiaMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.InertiaMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InertiaMode_DEFAULT=new InertiaMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InertiaMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Moment of inertia set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):InertiaMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.InertiaMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.InertiaMode_FIXED=new InertiaMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.InertiaMode_FIXED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractorIterator{\n /**\n * @private\n */\n public var zpp_inner:InteractorList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:InteractorIterator=null;\n /**\n * @private\n */\n public var zpp_next:InteractorIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_InteractorList.internal)throw \"Error: Cannot instantiate \"+\"Interactor\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:InteractorList){\n var ret=if(zpp_pool==null){\n ZPP_InteractorList.internal=true;\n var ret=new InteractorIterator();\n ZPP_InteractorList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Interactor = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Interactor = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Interactor = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass InteractorList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_InteractorList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Interactor\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new InteractorList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Interactor)#else Std.is(i,Interactor)#end)throw \"Error: Array contains non \"+\"Interactor\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new InteractorList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Interactor):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner_i);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Interactor{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner_i);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner_i);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner_i);\n }\n else zpp_inner.inner.add(obj.zpp_inner_i);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Interactor{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer_i;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Interactor{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer_i;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer_i;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Interactor):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Interactor):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner_i){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner_i);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Interactor\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return InteractorIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new InteractorList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Interactor\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:InteractorList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_InteractorList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Interactor->Void):InteractorList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=InteractorIterator.zpp_pool;\n InteractorIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Interactor->Bool):InteractorList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Mass will be computed based on Body's Shape's areas and densities.\n */\n #if nape_swc@:isVar #end\n public static var DEFAULT(get_DEFAULT,never):MassMode;\n inline static function get_DEFAULT(){\n if(ZPP_Flags.MassMode_DEFAULT==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.MassMode_DEFAULT=new MassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.MassMode_DEFAULT;\n }\n /**\n * Fixed method of computation.\n *

\n * Mass set by user.\n */\n #if nape_swc@:isVar #end\n public static var FIXED(get_FIXED,never):MassMode;\n inline static function get_FIXED(){\n if(ZPP_Flags.MassMode_FIXED==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.MassMode_FIXED=new MassMode();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.MassMode_FIXED;\n }\n}\n","package nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Material property providing physical attributes to a Shape.\n */\n@:final#if nape_swc@:keep #end\nclass Material{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Material=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Set of all active shapes using this object.\n *

\n * Activeness of a shape in the sense that the Shape's Body is inside of a Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var shapes(get_shapes,never):ShapeList;\n inline function get_shapes():ShapeList{\n if(zpp_inner.wrap_shapes==null)zpp_inner.wrap_shapes=ZPP_ShapeList.get(zpp_inner.shapes,true);\n return zpp_inner.wrap_shapes;\n }\n /**\n * Construct a new Material object.\n *\n * @param elasticity The coeffecient of elasticity for material.\n * (default 0.0)\n * @param dynamicFriction The coeffecient of dynamic friction for\n * material. (default 1.0)\n * @param staticFriction The coeffecient of static friction for\n * material. (default 2.0)\n * @param density The density of the shape using this material in units\n * of g/pixel/pixel. (default 1.0)\n * @param rollingFriction The coeffecient of rolling friction for material\n * used in circle friction computations. (default 0.001)\n * @return The constructed Material object.\n */\n public function new(elasticity:Float=0.0,dynamicFriction:Float=1.0,staticFriction:Float=2.0,density:Float=1,rollingFriction:Float=0.001){\n {\n if(ZPP_Material.zpp_pool==null){\n zpp_inner=new ZPP_Material();\n #if NAPE_POOL_STATS ZPP_Material.POOL_TOT++;\n ZPP_Material.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=zpp_inner.next;\n zpp_inner.next=null;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT--;\n ZPP_Material.POOL_ADD++;\n #end\n }\n zpp_inner.alloc();\n };\n zpp_inner.outer=this;\n this.elasticity=elasticity;\n this.dynamicFriction=dynamicFriction;\n this.staticFriction=staticFriction;\n this.density=density;\n this.rollingFriction=rollingFriction;\n }\n /**\n * Produce a copy of this Material object.\n *

\n * The copied object will be identical in all properties with the the\n * copied userData being assigned the same fields as 'this' Shape with the\n * same values copied over by reference for object types.\n *\n * @return The copied Material.\n */\n #if nape_swc@:keep #end\n public function copy(){\n var ret=new Material(elasticity,dynamicFriction,staticFriction,density,rollingFriction);\n if(zpp_inner.userData!=null)ret.zpp_inner.userData=Reflect.copy(zpp_inner.userData);\n return ret;\n }\n /**\n * Elasticity of material.\n *

\n * This property may take any value. Coeffecients of elasticity are combined\n * by taking their average, and then clamping to the range [0,1]. In this way\n * you may give very large values (even infinites) to this property to bias\n * the result of combining elasticities.\n *

\n * A combined, clamped value of 0 results in no bouncing whatsoever.\n *
\n * A combine, clamped value of 1 results in complete elasticity where if\n * possible, the objects will not lose any energy at all.\n *\n * @default 0.0\n */\n #if nape_swc@:isVar #end\n public var elasticity(get_elasticity,set_elasticity):Float;\n inline function get_elasticity():Float{\n return zpp_inner.elasticity*(\"elasticity\"==\"density\"?1000:1);\n }\n inline function set_elasticity(elasticity:Float):Float{\n {\n if(elasticity!=this.elasticity){\n #if(!NAPE_RELEASE_BUILD)\n if((elasticity!=elasticity))throw \"Error: Material::\"+\"elasticity\"+\" cannot be NaN\";\n if(\"elasticity\"==\"density\"&&elasticity<0)throw \"Error: Material::density must be positive\";\n if(\"elasticity\"!=\"elasticity\"&&elasticity<0)throw \"Error: Material::\"+\"elasticity\"+\" cannot be negative\";\n #end\n zpp_inner.elasticity=elasticity/(\"elasticity\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_elasticity();\n }\n /**\n * Coeffecient of dynamic friction for material.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * dynamicFriction are combined by taking the square root of their product.\n *

\n * The higher this value the more quickly objects will slow down from speed\n * when sliding.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var dynamicFriction(get_dynamicFriction,set_dynamicFriction):Float;\n inline function get_dynamicFriction():Float{\n return zpp_inner.dynamicFriction*(\"dynamicFriction\"==\"density\"?1000:1);\n }\n inline function set_dynamicFriction(dynamicFriction:Float):Float{\n {\n if(dynamicFriction!=this.dynamicFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((dynamicFriction!=dynamicFriction))throw \"Error: Material::\"+\"dynamicFriction\"+\" cannot be NaN\";\n if(\"dynamicFriction\"==\"density\"&&dynamicFriction<0)throw \"Error: Material::density must be positive\";\n if(\"dynamicFriction\"!=\"elasticity\"&&dynamicFriction<0)throw \"Error: Material::\"+\"dynamicFriction\"+\" cannot be negative\";\n #end\n zpp_inner.dynamicFriction=dynamicFriction/(\"dynamicFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ANGDRAG|ZPP_Material.ARBITERS);\n }\n }\n return get_dynamicFriction();\n }\n /**\n * Coeffecient of static friction for material.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * staticFriction are combined by taking the square root of their product.\n *

\n * The higher this value the more quickly objects will come to rest once moving\n * very slowly, and the harder it will be to cause the objcet to begin to slide.\n *\n * @default 2\n */\n #if nape_swc@:isVar #end\n public var staticFriction(get_staticFriction,set_staticFriction):Float;\n inline function get_staticFriction():Float{\n return zpp_inner.staticFriction*(\"staticFriction\"==\"density\"?1000:1);\n }\n inline function set_staticFriction(staticFriction:Float):Float{\n {\n if(staticFriction!=this.staticFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((staticFriction!=staticFriction))throw \"Error: Material::\"+\"staticFriction\"+\" cannot be NaN\";\n if(\"staticFriction\"==\"density\"&&staticFriction<0)throw \"Error: Material::density must be positive\";\n if(\"staticFriction\"!=\"elasticity\"&&staticFriction<0)throw \"Error: Material::\"+\"staticFriction\"+\" cannot be negative\";\n #end\n zpp_inner.staticFriction=staticFriction/(\"staticFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_staticFriction();\n }\n /**\n * Density of Shape's using this Material.\n *

\n * This property has units of g/pixel/pixel, not Kg/pixel/pixel for the\n * simple reason that we get more reasonable values like 1 instead of 0.001\n * to attain reasonable mass values for Bodys.\n *\n * @default 1\n */\n #if nape_swc@:isVar #end\n public var density(get_density,set_density):Float;\n inline function get_density():Float{\n return zpp_inner.density*(\"density\"==\"density\"?1000:1);\n }\n inline function set_density(density:Float):Float{\n {\n if(density!=this.density){\n #if(!NAPE_RELEASE_BUILD)\n if((density!=density))throw \"Error: Material::\"+\"density\"+\" cannot be NaN\";\n if(\"density\"==\"density\"&&density<0)throw \"Error: Material::density must be positive\";\n if(\"density\"!=\"elasticity\"&&density<0)throw \"Error: Material::\"+\"density\"+\" cannot be negative\";\n #end\n zpp_inner.density=density/(\"density\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.PROPS);\n }\n }\n return get_density();\n }\n /**\n * Coeffecient of rolling friction for circle interactions.\n *

\n * This property may take any zero or positive value. Coeffecients of\n * staticFriction are combined by taking the square root of their product.\n *

\n * The higher this value, the more quickly a rolling circle - which would\n * otherwise roll forever ignoring drag and numerical issues - will come to\n * rest.\n *\n * @default 0.01\n */\n #if nape_swc@:isVar #end\n public var rollingFriction(get_rollingFriction,set_rollingFriction):Float;\n inline function get_rollingFriction():Float{\n return zpp_inner.rollingFriction*(\"rollingFriction\"==\"density\"?1000:1);\n }\n inline function set_rollingFriction(rollingFriction:Float):Float{\n {\n if(rollingFriction!=this.rollingFriction){\n #if(!NAPE_RELEASE_BUILD)\n if((rollingFriction!=rollingFriction))throw \"Error: Material::\"+\"rollingFriction\"+\" cannot be NaN\";\n if(\"rollingFriction\"==\"density\"&&rollingFriction<0)throw \"Error: Material::density must be positive\";\n if(\"rollingFriction\"!=\"elasticity\"&&rollingFriction<0)throw \"Error: Material::\"+\"rollingFriction\"+\" cannot be negative\";\n #end\n zpp_inner.rollingFriction=rollingFriction/(\"rollingFriction\"==\"density\"?1000:1);\n zpp_inner.invalidate(ZPP_Material.WAKE|ZPP_Material.ARBITERS);\n }\n }\n return get_rollingFriction();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n return \"{ elasticity: \"+elasticity+\" dynamicFriction: \"+dynamicFriction+\" staticFriction: \"+staticFriction+\" density: \"+density+\" rollingFriction: \"+rollingFriction+\" }\";\n }\n /**\n * Predefined constructor for a wood style Material.\n *\n * @return new Material(0.4,0.2,0.38,0.7,0.005)\n */\n #if nape_swc@:keep #end\n public static function wood(){\n return new Material(0.4,0.2,0.38,0.7,0.005);\n }\n /**\n * Predefined constructor for a steel style Material.\n *\n * @return new Material(0.2,0.57,0.74,7.8,0.001)\n */\n #if nape_swc@:keep #end\n public static function steel(){\n return new Material(0.2,0.57,0.74,7.8,0.001);\n }\n /**\n * Predefined constructor for a ice style Material.\n *\n * @return new Material(0.3,0.03,0.1,0.9,0.0001)\n */\n #if nape_swc@:keep #end\n public static function ice(){\n return new Material(0.3,0.03,0.1,0.9,0.0001);\n }\n /**\n * Predefined constructor for a rubber style Material.\n *\n * @return new Material(0.8,1.0,1.4,1.5,0.01)\n */\n #if nape_swc@:keep #end\n public static function rubber(){\n return new Material(0.8,1.0,1.4,1.5,0.01);\n }\n /**\n * Predefined constructor for a glass style Material.\n *\n * @return new Material(0.4,0.4,0.94,2.6,0.002)\n */\n #if nape_swc@:keep #end\n public static function glass(){\n return new Material(0.4,0.4,0.94,2.6,0.002);\n }\n /**\n * Predefined constructor for a sand style Material.\n *\n * @return new Material(-1.0,0.45,0.6,1.6,16.0)\n */\n #if nape_swc@:keep #end\n public static function sand(){\n return new Material(-1.0,0.45,0.6,1.6,16.0);\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Base type for Nape Shape's\n */\n#if nape_swc@:keep #end\nclass Shape extends Interactor{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Shape=null;\n /**\n * Type of shape.\n */\n #if nape_swc@:isVar #end\n public var type(get_type,never):ShapeType;\n inline function get_type():ShapeType{\n return ZPP_Shape.types[zpp_inner.type];\n }\n /**\n * Faster equivalent to type == ShapeType.CIRCLE\n *\n * @return True if shape is a Circle type.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isCircle(){\n return zpp_inner.isCircle();\n }\n /**\n * Faster equivalent to type == ShapeType.POLYGON\n *\n * @return True if shape is a Polygon type.\n */\n #if nape_swc@:keep #end\n public#if NAPE_NO_INLINE#else inline #end\n function isPolygon(){\n return zpp_inner.isPolygon();\n }\n /**\n * @private\n */\n #if(!NAPE_RELEASE_BUILD)\n public static var zpp_internalAlloc=false;\n #end\n function new(){\n #if(!NAPE_RELEASE_BUILD)\n Interactor.zpp_internalAlloc=true;\n super();\n Interactor.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!zpp_internalAlloc)throw \"Error: Shape cannot be instantiated derp!\";\n #end\n }\n /**\n * Body this Shape is assigned to.\n *

\n * This value can be set to add Shape to the given Body, and set to null\n * to remove it from its present Body.\n *\n * @default null\n */\n #if nape_swc@:isVar #end\n public var body(get_body,set_body):Null;\n inline function get_body():Null{\n return if(zpp_inner.body!=null)zpp_inner.body.outer else null;\n }\n inline function set_body(body:Null):Null{\n {\n zpp_inner.immutable_midstep(\"Shape::body\");\n if(this.body!=body){\n if(zpp_inner.body!=null)this.body.shapes.remove(this);\n if(body!=null)body.shapes.add(this);\n }\n }\n return get_body();\n }\n /**\n * Faster equivalent to casting this to Circle type\n */\n #if nape_swc@:isVar #end\n public var castCircle(get_castCircle,never):Null;\n inline function get_castCircle():Null{\n return if(isCircle())zpp_inner.circle.outer_zn else null;\n }\n /**\n * Faster equivalent to casting this to Polygon type\n */\n #if nape_swc@:isVar #end\n public var castPolygon(get_castPolygon,never):Null;\n inline function get_castPolygon():Null{\n return if(isPolygon())zpp_inner.polygon.outer_zn else null;\n }\n /**\n * World space centre of mass of this Shape.\n *

\n * This value can be accessed even if Shape is not in a Body, but\n * attempting to query the values of it will return an error in debug\n * builds unless the Shape is in a Body.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldCOM(get_worldCOM,never):Vec2;\n inline function get_worldCOM():Vec2{\n if(zpp_inner.wrap_worldCOM==null){\n zpp_inner.wrap_worldCOM=Vec2.get(zpp_inner.worldCOMx,zpp_inner.worldCOMy);\n zpp_inner.wrap_worldCOM.zpp_inner._inuse=true;\n zpp_inner.wrap_worldCOM.zpp_inner._immutable=true;\n zpp_inner.wrap_worldCOM.zpp_inner._validate=zpp_inner.getworldCOM;\n }\n return zpp_inner.wrap_worldCOM;\n }\n /**\n * Local space centre of mass of this Shape.\n *

\n * This Vec2 can be set and is equivalent to performing the necessary\n * translation of the Shape in local coordinates, and also equivalent\n * to this.localCOM.set(value).\n *
\n * Setting this value whilst this shape is part of a static Body that\n * is part of a Space is not permitted.\n */\n #if nape_swc@:isVar #end\n public var localCOM(get_localCOM,set_localCOM):Vec2;\n inline function get_localCOM():Vec2{\n if(zpp_inner.wrap_localCOM==null){\n if(isCircle())zpp_inner.circle.setupLocalCOM();\n else zpp_inner.polygon.setupLocalCOM();\n }\n return zpp_inner.wrap_localCOM;\n }\n inline function set_localCOM(localCOM:Vec2):Vec2{\n {\n zpp_inner.immutable_midstep(\"Body::localCOM\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(localCOM!=null&&localCOM.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(localCOM==null)throw \"Error: Shape::localCOM cannot be null\";\n #end\n this.localCOM.set(localCOM);\n }\n return get_localCOM();\n }\n /**\n * Area of the Hhape.\n */\n #if nape_swc@:isVar #end\n public var area(get_area,never):Float;\n inline function get_area():Float{\n zpp_inner.validate_area_inertia();\n return zpp_inner.area;\n }\n /**\n * Non-mass weighted moment of inertia for Shape.\n */\n #if nape_swc@:isVar #end\n public var inertia(get_inertia,never):Float;\n inline function get_inertia():Float{\n zpp_inner.validate_area_inertia();\n return zpp_inner.inertia;\n }\n /**\n * Coeffecient of angular fluid drag for this Shape.\n */\n #if nape_swc@:isVar #end\n public var angDrag(get_angDrag,never):Float;\n inline function get_angDrag():Float{\n zpp_inner.validate_angDrag();\n return zpp_inner.angDrag;\n }\n /**\n * Material used by this shape.\n *\n * @default new Material()\n */\n #if nape_swc@:isVar #end\n public var material(get_material,set_material):Material;\n inline function get_material():Material{\n return zpp_inner.material.wrapper();\n }\n inline function set_material(material:Material):Material{\n {\n zpp_inner.immutable_midstep(\"Shape::material\");\n #if(!NAPE_RELEASE_BUILD)\n if(material==null)throw \"Error: Cannot assign null as Shape material\";\n #end\n zpp_inner.setMaterial(material.zpp_inner);\n }\n return get_material();\n }\n /**\n * InteractionFilter used by this shape.\n *\n * @default new InteractionFilter()\n */\n #if nape_swc@:isVar #end\n public var filter(get_filter,set_filter):InteractionFilter;\n inline function get_filter():InteractionFilter{\n return zpp_inner.filter.wrapper();\n }\n inline function set_filter(filter:InteractionFilter):InteractionFilter{\n {\n zpp_inner.immutable_midstep(\"Shape::filter\");\n #if(!NAPE_RELEASE_BUILD)\n if(filter==null)throw \"Error: Cannot assign null as Shape filter\";\n #end\n zpp_inner.setFilter(filter.zpp_inner);\n }\n return get_filter();\n }\n /**\n * FluidProperties used by this shape.\n *

\n * This object provides information for buoyancy and fluid drag computations\n * when this shape is interacting as a fluid.\n *\n * @default new FluidProperties();\n */\n #if nape_swc@:isVar #end\n public var fluidProperties(get_fluidProperties,set_fluidProperties):FluidProperties;\n inline function get_fluidProperties():FluidProperties{\n zpp_inner.immutable_midstep(\"Shape::fluidProperties\");\n if(zpp_inner.fluidProperties==null)zpp_inner.setFluid(new FluidProperties().zpp_inner);\n return zpp_inner.fluidProperties.wrapper();\n }\n inline function set_fluidProperties(fluidProperties:FluidProperties):FluidProperties{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(fluidProperties==null)throw \"Error: Cannot assign null as Shape fluidProperties, disable fluids by setting fluidEnabled to false\";\n #end\n zpp_inner.setFluid(fluidProperties.zpp_inner);\n }\n return get_fluidProperties();\n }\n /**\n * Whether this shape is able to interact as a fluid.\n *

\n * Unless this field is true, this Shape can never interact as a fluid.\n *

\n * Just because this field is true however, does not mean this shape will always\n * interact as a fluid, the final result is down to the combination of\n * InteractionFilters on the pairing of shapes and sensory interaction\n * takes higher priority.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var fluidEnabled(get_fluidEnabled,set_fluidEnabled):Bool;\n inline function get_fluidEnabled():Bool{\n return zpp_inner.fluidEnabled;\n }\n inline function set_fluidEnabled(fluidEnabled:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Shape::fluidEnabled\");\n zpp_inner.fluidEnabled=fluidEnabled;\n if(fluidEnabled&&zpp_inner.fluidProperties==null)this.fluidProperties=new FluidProperties();\n zpp_inner.wake();\n }\n return get_fluidEnabled();\n }\n /**\n * Whether this shape is able to interact as sensor.\n *

\n * Unless this field is true, this Shape can never interact as a sensor.\n *

\n * Just because this field is true however, does not mean this shape will always\n * interact as a sensor, the final result is down to the combination of\n * InteractionFilters on the pairing of shapes. Sensor interaction has highest priority.\n *\n * @default false\n */\n #if nape_swc@:isVar #end\n public var sensorEnabled(get_sensorEnabled,set_sensorEnabled):Bool;\n inline function get_sensorEnabled():Bool{\n return zpp_inner.sensorEnabled;\n }\n inline function set_sensorEnabled(sensorEnabled:Bool):Bool{\n {\n zpp_inner.immutable_midstep(\"Shape::sensorEnabled\");\n zpp_inner.sensorEnabled=sensorEnabled;\n zpp_inner.wake();\n }\n return get_sensorEnabled();\n }\n /**\n * World space bounding box for this shape.\n *

\n * This value can be accessed even if the Shape is not part of a Body,\n * however attempting to query its values would result in an error in\n * debug builds.\n *

\n * This AABB is immutable.\n */\n #if nape_swc@:isVar #end\n public var bounds(get_bounds,never):AABB;\n inline function get_bounds():AABB{\n return zpp_inner.aabb.wrapper();\n }\n /**\n * Translate this shape in its local coordinate system.\n *

\n * This is equivalent to: shape.localCOM.addeq(displacement)\n *\n * @param translation The local translation to apply to Shape.\n * @return A reference to 'this' Shape.\n * @throws # If translation is null or has been disposed of.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function translate(translation:Vec2){\n zpp_inner.immutable_midstep(\"Shape::translate()\");\n {\n #if(!NAPE_RELEASE_BUILD)\n if(translation!=null&&translation.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(translation==null)throw \"Error: Cannot displace Shape by null Vec2\";\n #end\n if(translation.lsq()>0){\n if(isCircle())zpp_inner.circle.__translate(translation.x,translation.y);\n else zpp_inner.polygon.__translate(translation.x,translation.y);\n }\n ({\n if(({\n translation.zpp_inner.weak;\n })){\n translation.dispose();\n true;\n }\n else{\n false;\n }\n });\n return this;\n }\n /**\n * Scale this shape in its local coordinate system.\n *

\n * For Circle shapes, scalex and scaley must be exactly equal.\n *\n * @param scalex The x-coordinate scaling to apply to Shape.\n * @param scaley The y-coordinate scaling to apply to Shape.\n * @return A reference to 'this' Shape.\n * @throws # If this shape is part of a static body that is inside of a Space.\n * @throws # If scalex or scaley is 0. Negative values 'are' permitted.\n */\n #if nape_swc@:keep #end\n public function scale(scalex:Float,scaley:Float){\n zpp_inner.immutable_midstep(\"Shape::scale()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if((scalex!=scalex)||(scaley!=scaley))throw \"Error: Cannot scale Shape by NaN\";\n if(scalex==0||scaley==0)throw \"Error: Cannot Scale shape by a factor of 0\";\n #end\n if(isCircle()){\n var d=scalex*scalex-scaley*scaley;\n if(d*d<(Config.epsilon*Config.epsilon)){\n zpp_inner.circle.__scale(scalex,scaley);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot perform a non equal scaling on a Circle\";\n #end\n }\n }\n else zpp_inner.polygon.__scale(scalex,scaley);\n return this;\n }\n /**\n * Rotate this shape in its local coordinate system.\n *\n * @param angle The number of radians to rotate this Shape by in a clockwise\n * direction.\n * @return A reference to 'this' Shape.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function rotate(angle:Float){\n zpp_inner.immutable_midstep(\"Shape::rotate()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if((angle!=angle))throw \"Error: Cannot rotate Shape by NaN\";\n #end\n var dr=angle%(2*Math.PI);\n if(dr!=0.0){\n var cos=Math.cos(angle);\n var sin=Math.sin(angle);\n if(isCircle())zpp_inner.circle.__rotate(sin,cos);\n else zpp_inner.polygon.__rotate(sin,cos);\n }\n return this;\n }\n /**\n * Apply local transformation matrix to Shape.\n *

\n * For Circle shapes, the matrix must be equiorthogonal.\n *\n * @param matrix The matrix to transform Shape by.\n * @return A reference to 'this' Shape.\n * @throws # If matrix is null or singular.\n * @throws # If shape is a Circle, and matrix is not equiorthogonal.\n * @throws # If this shape is part of a static body that is inside of a Space.\n */\n #if nape_swc@:keep #end\n public function transform(matrix:Mat23){\n zpp_inner.immutable_midstep(\"Shape::transform()\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.space!=null&&zpp_inner.body.isStatic())throw \"Error: Cannot modify Shape belonging to a static Object once inside a Space\";\n if(matrix==null)throw \"Error: Cannot transform Shape by null matrix\";\n if(matrix.singular())throw \"Error: Cannot transform Shape by a singular matrix\";\n #end\n if(isCircle()){\n if(matrix.equiorthogonal()){\n zpp_inner.circle.__transform(matrix);\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot transform Circle by a non equiorthogonal matrix\";\n #end\n }\n }\n else zpp_inner.polygon.__transform(matrix);\n return this;\n }\n /**\n * Test containment of world-space coordinate in Shape.\n *

\n * This Shape must be part of a Body so that world coordinates are\n * defined.\n *\n * @param point The point to check for containment.\n * @return True if point is contained within the Shape.\n * @throws If point is null or disposed of.\n * @throws If this shape is not part of a Body.\n */\n #if nape_swc@:keep #end\n public function contains(point:Vec2){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Cannot check null point for containment\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Shape is not well defined without a Body\";\n #end\n ZPP_Geom.validateShape(zpp_inner);\n point.zpp_inner.validate();\n var ret=ZPP_Collide.shapeContains(zpp_inner,point.zpp_inner);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Produce an exact copy of this Shape.\n *

\n * The copied shape will be identical with the copied Shape's userData\n * object being assigned the same fields as 'this' Shape with the same\n * values copied over by reference for object types.\n *\n * @return A copy of this shape.\n */\n #if nape_swc@:keep #end\n public function copy(){\n return zpp_inner.copy();\n }\n /**\n * @private\n */\n @:keep public override function toString(){\n var ret=isCircle()?\"Circle\":\"Polygon\";\n return ret+\"#\"+id;\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Shape subtype representing a Circle\n */\n@:final#if nape_swc@:keep #end\nclass Circle extends Shape{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_Circle=null;\n /**\n * Construct a new Circle\n *\n * @param radius The radius of the circle, this value must be positive.\n * @param localCOM The local offset for the circle. (default (0,0))\n * @param material The material for this circle. (default new Material())\n * @param filter The interaction filter for this circle.\n * (default new InteractionFilter())\n * @return The constructed Circle\n * @throws # If radius is not strictly positive\n * @throws # If localCOM is non-null, but has been disposed of.\n */\n #if flib@:keep function flibopts_3(){}\n #end\n public function new(radius:Float,localCOM:Vec2=null,material:Material=null,filter:InteractionFilter=null){\n #if(!NAPE_RELEASE_BUILD)\n Shape.zpp_internalAlloc=true;\n super();\n Shape.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n zpp_inner_zn=new ZPP_Circle();\n zpp_inner_zn.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner=zpp_inner_zn;\n zpp_inner_i=zpp_inner;\n zpp_inner_i.outer_i=this;\n this.radius=radius;\n if(localCOM==null){\n zpp_inner.localCOMx=0;\n zpp_inner.localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMx!=zpp_inner.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMy!=zpp_inner.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n else{\n {\n #if(!NAPE_RELEASE_BUILD)\n if(localCOM!=null&&localCOM.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n {\n zpp_inner.localCOMx=localCOM.x;\n zpp_inner.localCOMy=localCOM.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMx!=zpp_inner.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"localCOM.x\"+\",in y: \"+\"localCOM.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((zpp_inner.localCOMy!=zpp_inner.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(zpp_inner.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"zpp_inner.localCOM\"+\",in x: \"+\"localCOM.x\"+\",in y: \"+\"localCOM.y\"+\")\");\n #end\n };\n };\n ({\n if(({\n localCOM.zpp_inner.weak;\n })){\n localCOM.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n if(material==null){\n if(ZPP_Material.zpp_pool==null){\n zpp_inner.material=new ZPP_Material();\n #if NAPE_POOL_STATS ZPP_Material.POOL_TOT++;\n ZPP_Material.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner.material=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=zpp_inner.material.next;\n zpp_inner.material.next=null;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT--;\n ZPP_Material.POOL_ADD++;\n #end\n }\n zpp_inner.material.alloc();\n };\n else this.material=material;\n if(filter==null){\n if(ZPP_InteractionFilter.zpp_pool==null){\n zpp_inner.filter=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n zpp_inner.filter=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=zpp_inner.filter.next;\n zpp_inner.filter.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n zpp_inner.filter.alloc();\n };\n else this.filter=filter;\n zpp_inner_i.insert_cbtype(CbType.ANY_SHAPE.zpp_inner);\n }\n /**\n * Radius of circle\n *

\n * This value must be strictly positive, and attempting to set this value\n * whilst this Circle is part of a static Body inside a Space will result\n * in a debug time error.\n */\n #if nape_swc@:isVar #end\n public var radius(get_radius,set_radius):Float;\n inline function get_radius():Float{\n return zpp_inner_zn.radius;\n }\n inline function set_radius(radius:Float):Float{\n {\n zpp_inner.immutable_midstep(\"Circle::radius\");\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.body!=null&&zpp_inner.body.isStatic()&&zpp_inner.body.space!=null)throw \"Error: Cannot modifiy radius of Circle contained in static object once added to space\";\n #end\n if(radius!=this.radius){\n #if(!NAPE_RELEASE_BUILD)\n if((radius!=radius))throw \"Error: Circle::radius cannot be NaN\";\n if(radius Config.epsilon\";\n if(radius>ZPP_Const.FMAX)throw \"Error: Circle::radius (\"+radius+\") must be < PR(Const).FMAX\";\n #end\n zpp_inner_zn.radius=radius;\n zpp_inner_zn.invalidate_radius();\n }\n }\n return get_radius();\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Edge class providing internal details of Polygon.\n */\n@:final#if nape_swc@:keep #end\nclass Edge{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Edge=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_Edge.internal)throw \"Error: Cannot instantiate an Edge derp!\";\n #end\n }\n /**\n * Reference to Polygon this Edge belongs to.\n */\n #if nape_swc@:isVar #end\n public var polygon(get_polygon,never):Polygon;\n inline function get_polygon():Polygon{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n return zpp_inner.polygon.outer_zn;\n }\n /**\n * Normal of edge in local coordinates.\n *

\n * This Vec2 is immutable.\n */\n #if nape_swc@:isVar #end\n public var localNormal(get_localNormal,never):Vec2;\n inline function get_localNormal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n if(zpp_inner.wrap_lnorm==null)zpp_inner.getlnorm();\n return zpp_inner.wrap_lnorm;\n }\n /**\n * Normal of edge in world coordinates.\n *

\n * This Vec2 is immutable, and may be accessed even if the related Polygon\n * is not part of a Body but queries to its values will result in a debug\n * build error.\n */\n #if nape_swc@:isVar #end\n public var worldNormal(get_worldNormal,never):Vec2;\n inline function get_worldNormal():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n if(zpp_inner.wrap_gnorm==null)zpp_inner.getgnorm();\n return zpp_inner.wrap_gnorm;\n }\n /**\n * Length of edge.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Float;\n inline function get_length():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.length;\n }\n /**\n * Local projection of polygon onto edge axis.\n */\n #if nape_swc@:isVar #end\n public var localProjection(get_localProjection,never):Float;\n inline function get_localProjection():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lprojection;\n }\n /**\n * World projection of polygon to edge axis.\n *

\n * This value can only be accessed if related Polygon is part of a Body.\n */\n #if nape_swc@:isVar #end\n public var worldProjection(get_worldProjection,never):Float;\n inline function get_worldProjection():Float{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n if(zpp_inner.polygon.body==null)throw \"Error: Edge world projection only makes sense for Polygons contained within a rigid body\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gprojection;\n }\n /**\n * Reference to first local vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var localVertex1(get_localVertex1,never):Vec2;\n inline function get_localVertex1():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lp0.wrapper();\n }\n /**\n * Reference to second local vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var localVertex2(get_localVertex2,never):Vec2;\n inline function get_localVertex2():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_laxi();\n return zpp_inner.lp1.wrapper();\n }\n /**\n * Reference to first world vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var worldVertex1(get_worldVertex1,never):Vec2;\n inline function get_worldVertex1():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gp0.wrapper();\n }\n /**\n * Reference to second world vertex for edge.\n */\n #if nape_swc@:isVar #end\n public var worldVertex2(get_worldVertex2,never):Vec2;\n inline function get_worldVertex2():Vec2{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.polygon==null)throw \"Error: Edge not current in use\";\n #end\n zpp_inner.polygon.validate_gaxi();\n return zpp_inner.gp1.wrapper();\n }\n /**\n * @private\n */\n @:keep public function toString(){\n if(zpp_inner.polygon==null)return \"Edge(object-pooled)\";\n else if(zpp_inner.polygon.body==null){\n zpp_inner.polygon.validate_laxi();\n return \"{ localNormal : \"+(\"{ x: \"+zpp_inner.lnormx+\" y: \"+zpp_inner.lnormy+\" }\")+\" }\";\n }\n else{\n zpp_inner.polygon.validate_gaxi();\n return \"{ localNormal : \"+(\"{ x: \"+zpp_inner.lnormx+\" y: \"+zpp_inner.lnormy+\" }\")+\" worldNormal : \"+(\"{ x: \"+zpp_inner.gnormx+\" y: \"+zpp_inner.gnormy+\" }\")+\" }\";\n }\n }\n}\n","package nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * Haxe Iterator compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass EdgeIterator{\n /**\n * @private\n */\n public var zpp_inner:EdgeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:EdgeIterator=null;\n /**\n * @private\n */\n public var zpp_next:EdgeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_EdgeList.internal)throw \"Error: Cannot instantiate \"+\"Edge\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:EdgeList){\n var ret=if(zpp_pool==null){\n ZPP_EdgeList.internal=true;\n var ret=new EdgeIterator();\n ZPP_EdgeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Edge = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Edge = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Edge = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass EdgeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_EdgeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Edge\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new EdgeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Edge)#else Std.is(i,Edge)#end)throw \"Error: Array contains non \"+\"Edge\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new EdgeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Edge):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Edge{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(index==length-1?index:length-2-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Edge{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Edge{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.wrapper();\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.wrapper();\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Edge):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Edge):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Edge\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return EdgeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new EdgeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Edge\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:EdgeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_EdgeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Edge->Void):EdgeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=EdgeIterator.zpp_pool;\n EdgeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Edge->Bool):EdgeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * Can be used to simulate any convex polygon.\n */\n@:final#if nape_swc@:keep #end\nclass Polygon extends Shape{\n /**\n * @private\n */\n public var zpp_inner_zn:ZPP_Polygon=null;\n /**\n * Construct a polygon representing a rectangle.\n *

\n * For a dynamic object, you may consider use of the box method instead\n * as dynamic bodies will only respond as expected if their centre of mass\n * is equal to the origin.\n *

\n * The generate polygon will have coordinates equal to:\n *
\n     * (x, y) -> (x + width, y + height)\n     * 
\n * Negative values of width/height are permitted so that the given x/y values\n * may not necessarigly be the top-left corner of rectangle.\n *\n * @param x The x coordinate of rectangle.\n * @param y The y coordinate of rectangle.\n * @param width The width of the ractangle. This value may be negative.\n * @param height The height of the rectangle This value may be negative.\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the given rectangle.\n */\n #if nape_swc@:keep #end\n public static function rect(x:Float,y:Float,width:Float,height:Float,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((x!=x)||(y!=y)||(width!=width)||(height!=height))throw \"Error: Polygon.rect cannot accept NaN arguments\";\n #end\n return[Vec2.get(x,y,weak),Vec2.get(x+width,y,weak),Vec2.get(x+width,y+height,weak),Vec2.get(x,y+height,weak)];\n }\n /**\n * Construct a polygon representing an origin centred box.\n *

\n * This method is equivalent to calling: Polygon.rect(-width/2,-height/2,width,height)\n *\n * @param width The width of the box (This value may be negative but will\n * make no difference).\n * @param height The height of the box (This value may be negative but will\n * make no difference).\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the given box.\n */\n #if nape_swc@:keep #end\n public static function box(width:Float,height:Float,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((width!=width)||(height!=height))throw \"Error: Polygon.box cannot accept NaN arguments\";\n #end\n return rect(-width/2,-height/2,width,height,weak);\n }\n /**\n * Construct a regular polygon centred at origin.\n *

\n * Vertices are created at positions on the edge of an ellipsoid of given\n * radii, when radii are not equal the vertices will not have an equal\n * angle between them; it will be as though an actual regular polygon were\n * created, and then squashed to conform to the input radii.\n *\n * @param xRadius The x radius of polygon before angleOffset rotation.\n * @param yRadius The y radius of polygon before angleOffset rotation.\n * @param edgeCount The number of edges/vertices in polygon.\n * @param angleOffset The clockwise angular offset to generate vertices at\n * in radians. (default 0.0)\n * @param weak If true, the generated list of vertices will be allocated as\n * weak Vec2s so that when this list is passed to a Nape function\n * these Vec2s will be automatically sent back to object pool.\n * (default false)\n * @return An array of Vec2 representing the polygon.\n */\n #if nape_swc@:keep #end\n public static function regular(xRadius:Float,yRadius:Float,edgeCount:Int,angleOffset=0.0,weak:Bool=false):Array{\n #if(!NAPE_RELEASE_BUILD)\n if((xRadius!=xRadius)||(yRadius!=yRadius)||(angleOffset!=angleOffset))throw \"Error: Polygon.regular cannot accept NaN arguments\";\n #end\n var ret=[];\n var dangle=Math.PI*2/edgeCount;\n for(i in 0...edgeCount){\n var ang=i*dangle+angleOffset;\n var x=Vec2.get(Math.cos(ang)*xRadius,Math.sin(ang)*yRadius,weak);\n ret.push(x);\n }\n return ret;\n }\n /**\n * Local coordinates of vertices.\n *

\n * This list can be modified, but modifications to a Polygon that is\n * part of a static Body inside of a Space will given an error in\n * debug builds.\n */\n #if nape_swc@:isVar #end\n public var localVerts(get_localVerts,never):Vec2List;\n inline function get_localVerts():Vec2List{\n if(zpp_inner_zn.wrap_lverts==null)zpp_inner_zn.getlverts();\n return zpp_inner_zn.wrap_lverts;\n }\n /**\n * World coordinates of vertices.\n *

\n * This list can be accessed, but any queries of values will result\n * in an error in debug builds unless this Polygon is part of a Body.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var worldVerts(get_worldVerts,never):Vec2List;\n inline function get_worldVerts():Vec2List{\n if(zpp_inner_zn.wrap_gverts==null)zpp_inner_zn.getgverts();\n return zpp_inner_zn.wrap_gverts;\n }\n /**\n * Set of edges on polygon.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var edges(get_edges,never):EdgeList;\n inline function get_edges():EdgeList{\n if(zpp_inner_zn.wrap_edges==null)zpp_inner_zn.getedges();\n return zpp_inner_zn.wrap_edges;\n }\n /**\n * Determine validity of polygon for use in a Nape simulation.\n */\n #if nape_swc@:keep #end\n public function validity():ValidationResult{\n return zpp_inner_zn.valid();\n }\n /**\n * Construct a new Polygon.\n *

\n * The localVerts parameter is typed Dynamic and may be one of:\n * Array<Vec2>, flash.Vector<Vec2>, Vec2List, GeomPoly\n *\n * @param localVerts The local vertices of polygon.\n * @param material The material for this polygon. (default new Material())\n * @param filter The interaction filter for this polygon.\n * (default new InteractionFilter())\n * @return The constructed Polygon.\n * @throws # If localVerts is null, or not of the expected Type.\n * @throws # If localVerts contains any disposed or null Vec2.\n */\n #if flib@:keep function flibopts_2(){}\n #end\n public function new(localVerts:Dynamic,material:Material=null,filter:InteractionFilter=null){\n #if(!NAPE_RELEASE_BUILD)\n Shape.zpp_internalAlloc=true;\n super();\n Shape.zpp_internalAlloc=false;\n #end\n #if NAPE_RELEASE_BUILD \n super();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(localVerts==null)throw \"Error: localVerts cannot be null\";\n #end\n zpp_inner_zn=new ZPP_Polygon();\n zpp_inner_zn.outer=this;\n zpp_inner_zn.outer_zn=this;\n zpp_inner=zpp_inner_zn;\n zpp_inner_i=zpp_inner;\n zpp_inner_i.outer_i=this;\n {\n if(#if flash untyped __is__(localVerts,Array)#else Std.is(localVerts,Array)#end){\n var lv:Array=localVerts;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: Array contains null objects\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(vite,Vec2)#else Std.is(vite,Vec2)#end)throw \"Error: Array contains non Vec2 objects\";\n #end\n var x:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n }\n else if(#if flash10 untyped __is__(localVerts,ZPP_Const.vec2vector)#else false #end){\n #if flash10 var lv:flash.Vector=localVerts;\n for(vite in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(vite==null)throw \"Error: flash.Vector contains null objects\";\n #end\n var x:Vec2=vite;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n #end\n }\n else if(#if flash untyped __is__(localVerts,Vec2List)#else Std.is(localVerts,Vec2List)#end){\n var lv:Vec2List=localVerts;\n for(x in lv){\n #if(!NAPE_RELEASE_BUILD)\n if(x==null)throw \"Error: Vec2List contains null objects\";\n #end\n {\n #if(!NAPE_RELEASE_BUILD)\n if(x!=null&&x.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n this.localVerts.push(x.copy());\n }\n }\n else if(#if flash untyped __is__(localVerts,GeomPoly)#else Std.is(localVerts,GeomPoly)#end){\n var lv:GeomPoly=localVerts;\n {\n #if(!NAPE_RELEASE_BUILD)\n if(lv!=null&&lv.zpp_disp)throw \"Error: \"+\"GeomPoly\"+\" has been disposed and cannot be used!\";\n #end\n };\n var verts:ZPP_GeomVert=lv.zpp_inner.vertices;\n if(verts!=null){\n var vite=verts;\n do{\n var x=Vec2.get(vite.x,vite.y);\n vite=vite.next;\n this.localVerts.push(x.copy());\n x.dispose();\n }\n while(vite!=verts);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Invalid type for polygon object, should be Array, Vec2List, GeomPoly or for flash10+ flash.Vector\";\n #end\n }\n };\n {\n if(#if flash untyped __is__(localVerts,Array)#else Std.is(localVerts,Array)#end){\n var lv:Array=localVerts;\n var i=0;\n while(i=localVerts;\n if(!lv.fixed){\n var i:Int=0;\n while(i compatible iterator over Nape list.\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ShapeIterator{\n /**\n * @private\n */\n public var zpp_inner:ShapeList=null;\n /**\n * @private\n */\n public var zpp_i:Int=0;\n /**\n * @private\n */\n public var zpp_critical:Bool=false;\n /**\n * @private\n */\n public static var zpp_pool:ShapeIterator=null;\n /**\n * @private\n */\n public var zpp_next:ShapeIterator=null;\n /**\n * @private\n */\n public function new(){\n #if(!NAPE_RELEASE_BUILD)\n if(!ZPP_ShapeList.internal)throw \"Error: Cannot instantiate \"+\"Shape\"+\"Iterator derp!\";\n #end\n }\n /**\n * Create iterator for Nape list.\n *

\n * There is no specific reason to use this over: list.iterator()\n * especcialy since this requires writing the class name :)\n * (This function is used internally)\n *\n * @param list The Nape list to create iterator for.\n * @return An iterator over the Nape list.\n */\n public static function get(list:ShapeList){\n var ret=if(zpp_pool==null){\n ZPP_ShapeList.internal=true;\n var ret=new ShapeIterator();\n ZPP_ShapeList.internal=false;\n ret;\n }\n else{\n var r=zpp_pool;\n zpp_pool=r.zpp_next;\n r;\n }\n ret.zpp_i=0;\n ret.zpp_inner=list;\n ret.zpp_critical=false;\n return ret;\n }\n /**\n * Check if there are any elements remaining.\n *\n * @return True if there are more elements to iterator over.\n */\n #if nape_swc@:keep #end\n public inline function hasNext(){\n #if true zpp_inner.zpp_inner.valmod();\n #else zpp_inner.zpp_vm();\n #end\n var length=zpp_inner.length;\n zpp_critical=true;\n if(zpp_i
\n * Internally this list is at present implemented as a linked list with\n * object pooled nodes and iterators with various fast paths made for\n * standard access patterns (For instance accessing successive elements\n * runs in constant time when using random access functions)\n *

\n * Iteration of this list can be done in various ways, but the preferred\n * way on all targets, is through use of the foreach function:\n *
\n * list.foreach(function (obj) {\n * });\n * 
\n * This method is inlined so that in haxe no closure will need to be created.\n *

\n * In AS3, a closure would need to be created in general, so for performance\n * reasons you 'may' choose to use iteration as follows:\n *
\n * for (var i:int = 0; i < list.length; i++) {\n *     var obj:Shape = list.at(i);\n * }\n * 
\n *
\n * NOTE: It is 'not' safe to modify a list whilst iterating over it.\n * If you wish to remove elements during an iteration you should use the\n * filter method, for example:\n *
\n * list.filter(function (obj) {\n *     // operate on object.\n *     // ...\n *     return (false if you want object to be removed);\n * });\n * 
\n *

\n * In AS3, if you wish to avoid a closure generation, you can perform such\n * an iteration in a safe manner as follows:\n *
\n * var i:int = 0;\n * while (i < list.length) {\n *     var obj:Shape = list.at(i);\n *     // operate on object.\n *     // ...\n *     if (should remove obj) {\n *         list.remove(obj);\n *         continue;\n *     }\n *     else i++;\n * }\n * 
\n * Or if you are always clearing the list entirely you could write:\n *
\n * while (!list.empty()) {\n *     var obj:Shape = list.pop();\n *     // operate on object.\n *     // ...\n * }\n * 
\n */\n#if!false@:final #end\n#if nape_swc@:keep #end\nclass ShapeList{\n /**\n * @private\n */\n public var zpp_inner:ZPP_ShapeList=null;\n /**\n * Length of list.\n */\n #if nape_swc@:isVar #end\n public var length(get_length,never):Int;\n #if true inline function get_length(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n #else inline function get_length(){\n return zpp_gl();\n }\n /**\n * @private\n */\n public function zpp_gl(){\n zpp_inner.valmod();\n if(zpp_inner.zip_length){\n zpp_inner.zip_length=false;\n if(false){\n zpp_inner.user_length=0;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)zpp_inner.user_length++;\n cx_ite=cx_ite.next;\n }\n };\n }\n else zpp_inner.user_length=zpp_inner.inner.length;\n }\n return zpp_inner.user_length;\n }\n /**\n * @private\n */\n public function zpp_vm(){\n zpp_inner.valmod();\n }\n #end\n /**\n * Convert standard Array to Nape list.\n *\n * @param array The array to be converted\n * @return An equivalent Nape list.\n * @throws If array argument is null.\n * @throws If array contains elements of type other than Shape\n */\n #if nape_swc@:keep #end\n public static function fromArray(array:Array){\n #if(!NAPE_RELEASE_BUILD)\n if(array==null){\n throw \"Error: Cannot convert null Array to Nape list\";\n }\n #end\n var ret=new ShapeList();\n for(i in array){\n #if flash9#if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(i,Shape)#else Std.is(i,Shape)#end)throw \"Error: Array contains non \"+\"Shape\"+\" types.\";\n #end\n #end\n ret.push(i);\n }\n return ret;\n }\n #if flash9 /**\n * Convert flash.Vector to Nape list.\n *\n * @param vector The vector to be converted\n * @return An equivalent Nape list.\n * @throws # If vector argument is null.\n */\n #if nape_swc@:keep #end\n public static function fromVector(vector:flash.Vector){\n #if(!NAPE_RELEASE_BUILD)\n if(vector==null){\n throw \"Error: Cannot convert null Vector to Nape list\";\n }\n #end\n var ret=new ShapeList();\n for(i in vector)ret.push(i);\n return ret;\n }\n #end\n /**\n * Check if element is already in the list\n *\n * @param obj The object to test.\n * @return True if object is in the list.\n */\n #if nape_swc@:keep #end\n public function has(obj:Shape):Bool{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return zpp_inner.inner.has(obj.zpp_inner);\n }\n /**\n * Random access to elements of list by index.\n *

\n * Under normal circumstances, accessing succesive elements via this\n * method will occur in constant time.\n *\n * @param index The index of the element in list to access.\n * @returns The element at the given index.\n * @throws # If index is out of bounds.\n */\n #if nape_swc@:keep #end\n public function at(index:Int):Shape{\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=(length-1-index);\n if(!false){\n if(index
\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function push(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag)zpp_inner.inner.add(obj.zpp_inner);\n else{\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Push element to front of list.\n *

\n * When the order of objects is not important, it is best to use the\n * add() method instead.\n *\n * @param obj The object to insert.\n * @returns True if object was successively inserted.\n * @throws # If list is immutable.\n */\n #if nape_swc@:keep #end\n public function unshift(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var cont=if(zpp_inner.adder!=null)zpp_inner.adder(obj)else true;\n if(cont){\n if(zpp_inner.reverse_flag){\n if(zpp_inner.push_ite==null)zpp_inner.push_ite=empty()?null:zpp_inner.inner.iterator_at(length-1);\n zpp_inner.push_ite=zpp_inner.inner.insert(zpp_inner.push_ite,obj.zpp_inner);\n }\n else zpp_inner.inner.add(obj.zpp_inner);\n zpp_inner.invalidate();\n if(zpp_inner.post_adder!=null)zpp_inner.post_adder(obj);\n }\n return cont;\n }\n /**\n * Pop element from back of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function pop():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n else{\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Pop element from front of list.\n *

\n * If you are wanting to clear a list, whilst operating on its elements,\n * consider use of the filter method instead.\n *\n * @returns The element removed from list.\n * @throws # If list is immutable.\n * @throws # If the list is empty.\n */\n #if nape_swc@:keep #end\n public function shift():Shape{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if(!NAPE_RELEASE_BUILD)\n if(empty())throw \"Error: Cannot remove from empty list\";\n #end\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret=null;\n if(zpp_inner.reverse_flag){\n if(zpp_inner.at_ite!=null&&zpp_inner.at_ite.next==null)zpp_inner.at_ite=null;\n var ite=length==1?null:zpp_inner.inner.iterator_at(length-2);\n ret=ite==null?zpp_inner.inner.front():ite.next.elem();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.erase(ite);\n }\n else{\n ret=zpp_inner.inner.front();\n var retx=ret.outer;\n if(zpp_inner.subber!=null)zpp_inner.subber(retx);\n if(!zpp_inner.dontremove)zpp_inner.inner.pop();\n }\n zpp_inner.invalidate();\n var retx=ret.outer;\n return retx;\n }\n /**\n * Insert element into list in most effecient way.\n *

\n * This method will defer to either the push or unshift function\n * depending on which is most effecient in the context.\n *

\n * If order of elements is not important then you should always use\n * this function to insert elements.\n *\n * @param obj The object to insert.\n * @return True if object was successfuly inserted.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public inline function add(obj:Shape):Bool{\n return if(zpp_inner.reverse_flag)push(obj)else unshift(obj);\n }\n /**\n * Remove element from list.\n *

\n * This is a linear time operation.\n *\n * @param obj The object to remove\n * @return True if object was removed from list.\n * @throws # If list is immutable\n */\n #if nape_swc@:keep #end\n public function remove(obj:Shape):Bool{\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n zpp_inner.modify_test();\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n var ret;\n {\n ret=false;\n {\n var cx_ite=zpp_inner.inner.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x==obj.zpp_inner){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n if(ret){\n if(zpp_inner.subber!=null)zpp_inner.subber(obj);\n if(!zpp_inner.dontremove)zpp_inner.inner.remove(obj.zpp_inner);\n zpp_inner.invalidate();\n }\n return ret;\n }\n /**\n * Clear the list, removing all elements.\n *\n * @throws # If list is iummutable\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.immutable)throw \"Error: \"+\"Shape\"+\"List is immutable\";\n #end\n if(zpp_inner.reverse_flag){\n while(!empty())pop();\n }\n else{\n while(!empty())shift();\n }\n }\n /**\n * Test if list is empty or not.\n *\n * @return True if list is empty.\n */\n #if nape_swc@:keep #end\n public inline function empty(){\n #if true if(false)return length==0;\n else return zpp_inner.inner.empty();\n #else return length==0;\n #end\n }\n /**\n * Return Haxe iterator for list.\n *

\n * Use of this iterator, whilst stylistically better in Haxe should not\n * be used, in preference for use of the foreach function which will\n * not require allocation of an iterator object.\n *

\n * Equally in AS3, the foreach method should be the preferred way to iterate.\n */\n #if nape_swc@:keep #end\n public inline function iterator(){\n #if true zpp_inner.valmod();\n #else zpp_vm();\n #end\n return ShapeIterator.get(this);\n }\n /**\n * Produce a possibly deep copy of list.\n *\n * @param deep If true, then each element will have its own copy\n * function called instead of simply having its\n * reference copied over.\n * @return The copied list.\n */\n #if nape_swc@:keep #end\n public function copy(deep:Bool=false){\n var ret=new ShapeList();\n for(i in this)ret.push(deep?{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: \"+\"Shape\"+\" is not a copyable type\";\n #end\n null;\n }\n :i);\n return ret;\n }\n /**\n * Merge given list into this one.\n *

\n * The result is that this list will have all objects from the argument\n * that were not already in the list inserted. You should make no\n * assumption about the order of these insertions.\n *\n * @param xs The list to merge.\n * @throws # If xs argument is null.\n */\n #if nape_swc@:keep #end\n public function merge(xs:ShapeList):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(xs==null)throw \"Error: Cannot merge with null list\";\n #end\n for(x in xs){\n if(!has(x))add(x);\n }\n }\n /**\n * Construct a new list.\n */\n public function new(){\n zpp_inner=new ZPP_ShapeList();\n zpp_inner.outer=this;\n }\n /**\n * @private\n */\n @:keep public function toString(){\n var ret=\"[\";\n var fst=true;\n for(i in this){\n if(!fst)ret+=\",\";\n ret+=(i==null?\"NULL\":i.toString());\n fst=false;\n }\n return ret+\"]\";\n }\n /**\n * Iterate over list applying function.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method should be preferred to using standard haxe iteration\n * as there will be no allocation of an iterator object.\n *
\n     * list.foreach(function (obj) {\n     *     if (ignore_object(obj)) return; //acts as a 'continue' statement\n     *     if (halt_iteration(obj)) throw \"\": //acts as a 'break' statement\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public inline function foreach(lambda:Shape->Void):ShapeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot execute null on list elements\";\n #end\n var it=iterator();\n while(it.hasNext()){\n try{\n lambda(it.next());\n }\n catch(e:Dynamic){\n {\n it.zpp_next=ShapeIterator.zpp_pool;\n ShapeIterator.zpp_pool=it;\n it.zpp_inner=null;\n };\n break;\n }\n }\n return this;\n }\n /**\n * Iterate over list filtering elements.\n *

\n * The given function will be applied to each element, whenever the\n * function returns false, the element will be removed from the list.\n *

\n * Any exception thrown by the supplied function will be treat as a\n * signal to halt iteration acting as a 'break' statement.\n *

\n * This method is to be greatly preferred for filtering logic as\n * it is otherwise unsafe to modify the list during an iteration.\n *

\n * An example of using this method to clean up a list whilst performing\n * actions on the elements.\n *
\n     * list.filter(function (obj) {\n     *    // perform clean up with obj\n     *    return false; // remove from list.\n     * });\n     * 
\n *\n * @param lambda The function to apply to each argument, deciding if\n * element should be removed.\n * @return A reference to 'this' list.\n * @throws # If lambda argument is null.\n */\n #if nape_swc@:keep #end\n public function filter(lambda:Shape->Bool):ShapeList{\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: Cannot select elements of list with null\";\n #end\n var i=0;\n while(i
\n * This broadphase uses a pair of binary trees with objects inserted based\n * on containment of their AABB.\n *

\n * This is a general purpose broadphase which does not suffer for objects\n * of varying sizes, or objects moving very quickly and is well set for such\n * acts as ray casting and spatial queries like objectsInAABB of the Space type.\n *

\n * This is the default broadphase nape will use.\n */\n #if nape_swc@:isVar #end\n public static var DYNAMIC_AABB_TREE(get_DYNAMIC_AABB_TREE,never):Broadphase;\n inline static function get_DYNAMIC_AABB_TREE(){\n if(ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE=new Broadphase();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Broadphase_DYNAMIC_AABB_TREE;\n }\n /**\n * Sweep and prune broadphase.\n *

\n * This is a very simple broadphase using the x-axis to keep objects\n * sorted by their minimum x coordinate.\n *

\n * Performance of this broadphase is generally good and in some circumstances\n * superior to the DYNAMIC_AABB_TREE broadphase.\n *

\n * This broadphase will however be much slower for things such as ray casts and\n * spatial queries like objectsInAABB on the Space type.\n * Also in cases where lots of objects are moving very quickly or when there is a\n * large variety in the size of objects.\n *

\n * Due to the simplicity of this broadphase, it serves as a good test should you\n * ever feel there might be something going wrong with the DYNAMIC_AABB_TREE\n * broadphase type.\n */\n #if nape_swc@:isVar #end\n public static var SWEEP_AND_PRUNE(get_SWEEP_AND_PRUNE,never):Broadphase;\n inline static function get_SWEEP_AND_PRUNE(){\n if(ZPP_Flags.Broadphase_SWEEP_AND_PRUNE==null){\n ZPP_Flags.internal=true;\n ZPP_Flags.Broadphase_SWEEP_AND_PRUNE=new Broadphase();\n ZPP_Flags.internal=false;\n }\n return ZPP_Flags.Broadphase_SWEEP_AND_PRUNE;\n }\n}\n","package nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n/**\n * The heart of all Nape simulations.\n */\n@:final#if nape_swc@:keep #end\nclass Space{\n /**\n * @private\n */\n public var zpp_inner:ZPP_Space=null;\n /**\n * Dynamic object for user to store additional data.\n *

\n * This object cannot be set, only its dynamically created\n * properties may be set. In AS3 the type of this property is *\n *

\n * This object will be lazily constructed so that until accessed\n * for the first time, will be null internally.\n *\n * @default {}\n */\n #if nape_swc@:isVar #end\n public var userData(get_userData,never):Dynamic;\n inline function get_userData():Dynamic{\n if(zpp_inner.userData==null){\n zpp_inner.userData=cast{};\n }\n return zpp_inner.userData;\n }\n /**\n * Space gravity.\n *

\n * Units are of pixels/second/second\n * @default (0,0)\n */\n #if nape_swc@:isVar #end\n public var gravity(get_gravity,set_gravity):Vec2;\n inline function get_gravity():Vec2{\n if(zpp_inner.wrap_gravity==null)zpp_inner.getgravity();\n return zpp_inner.wrap_gravity;\n }\n inline function set_gravity(gravity:Vec2):Vec2{\n {\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(gravity==null)throw \"Error: Space::gravity cannot be null\";\n #end\n this.gravity.set(gravity);\n }\n return get_gravity();\n }\n /**\n * Broadphase type in use.\n */\n #if nape_swc@:isVar #end\n public var broadphase(get_broadphase,never):Broadphase;\n inline function get_broadphase():Broadphase{\n return zpp_inner.bphase.is_sweep?Broadphase.SWEEP_AND_PRUNE:Broadphase.DYNAMIC_AABB_TREE;\n }\n /**\n * Flag controlling sorting of contact points.\n *

\n * If true, then collisions will be resolved in an order defined by their\n * penetration depths. This can be shown to improve stability of the physics\n * as well as making simulations more consistent regardless of which broadphase\n * is used.\n *

\n * Having sorting enabled obviously incurs a cost, and you may consider\n * disabling it if you are having issues with performance (Though things\n * such as number of physics iterations will have much greater bearing on\n * performance than this, especcialy since enabling this may permit you\n * to use less iterations).\n *\n * @default true\n */\n #if nape_swc@:isVar #end\n public var sortContacts(get_sortContacts,set_sortContacts):Bool;\n inline function get_sortContacts():Bool{\n return zpp_inner.sortcontacts;\n }\n inline function set_sortContacts(sortContacts:Bool):Bool{\n {\n zpp_inner.sortcontacts=sortContacts;\n }\n return get_sortContacts();\n }\n /**\n * Angular drag applied to all bodies in Space.\n *

\n * This represents the fraction of a body's angular velocity which will be\n * removed per second. This value has no unit attached.\n *\n * @default 0.015\n */\n #if nape_swc@:isVar #end\n public var worldAngularDrag(get_worldAngularDrag,set_worldAngularDrag):Float;\n inline function get_worldAngularDrag():Float{\n return zpp_inner.global_ang_drag;\n }\n inline function set_worldAngularDrag(worldAngularDrag:Float):Float{\n {\n var d=worldAngularDrag;\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d))throw \"Error: Space::worldAngularDrag cannot be NaN\";\n #end\n zpp_inner.global_ang_drag=d;\n }\n return get_worldAngularDrag();\n }\n /**\n * Linear drag applied to all bodies in Space.\n *

\n * This represents the fraction of a body's linear velocity which will be\n * removed per second. This value has no unit attached.\n *\n * @default 0.015\n */\n #if nape_swc@:isVar #end\n public var worldLinearDrag(get_worldLinearDrag,set_worldLinearDrag):Float;\n inline function get_worldLinearDrag():Float{\n return zpp_inner.global_lin_drag;\n }\n inline function set_worldLinearDrag(worldLinearDrag:Float):Float{\n {\n var d=worldLinearDrag;\n #if(!NAPE_RELEASE_BUILD)\n if((d!=d))throw \"Error: Space::worldLinearDrag cannot be NaN\";\n #end\n zpp_inner.global_lin_drag=d;\n }\n return get_worldLinearDrag();\n }\n /**\n * List of all Compounds directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Compound to this Space equivalent to: compound.space = space\n *

\n * This list is only those compounds directly placed in the space, any\n * compound that is a child of another compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var compounds(get_compounds,never):CompoundList;\n inline function get_compounds():CompoundList{\n return zpp_inner.wrap_compounds;\n }\n /**\n * List of all Bodys directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Body to this Space equivalent to: body.space = space\n *

\n * This list is only those bodies directly placed in the space, any\n * body that is a child of a Compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var bodies(get_bodies,never):BodyList;\n inline function get_bodies():BodyList{\n return zpp_inner.wrap_bodies;\n }\n /**\n * List of all active dynamic Bodies in space.\n *

\n * This list contains all dynamic bodies that are awake regardless of their containment in a Compound.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var liveBodies(get_liveBodies,never):BodyList;\n inline function get_liveBodies():BodyList{\n return zpp_inner.wrap_live;\n }\n /**\n * List of all Constraints directly placed in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Constraint to this Space equivalent to: constraint.space = space\n *

\n * This list is only those bodies directly placed in the space, any\n * constraint that is a child of a Compound will not be in this list.\n */\n #if nape_swc@:isVar #end\n public var constraints(get_constraints,never):ConstraintList;\n inline function get_constraints():ConstraintList{\n return zpp_inner.wrap_constraints;\n }\n /**\n * List of all active Constraints in space.\n *

\n * This list contains all constraints regardless of their containment in a Compound.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var liveConstraints(get_liveConstraints,never):ConstraintList;\n inline function get_liveConstraints():ConstraintList{\n return zpp_inner.wrap_livecon;\n }\n /**\n * Apply given function to all bodies in space.\n *

\n * This method is a way to iterate over 'every' Body in the Space\n * regardless of containment in a Compound.\n *\n * @param lambda The function to apply to each Body.\n * @throws # If lambda is null.\n */\n public function visitBodies(lambda:Body->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitBodies\";\n #end\n for(b in bodies)lambda(b);\n for(c in compounds)c.visitBodies(lambda);\n }\n /**\n * Apply given function to all constraints in space.\n *

\n * This method is a way to iterate over 'every' Constraint in the Space\n * regardless of containment in a Compound.\n *\n * @param lambda The function to apply to each Constraint.\n * @throws # If lambda is null.\n */\n public function visitConstraints(lambda:Constraint->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitConstraints\";\n #end\n for(c in constraints)lambda(c);\n for(c in compounds)c.visitConstraints(lambda);\n }\n /**\n * Apply given function to all compounds in space.\n *

\n * This method is a way to iterate over 'every' Compound in the Space\n * regardless of containment in another Compound.\n *\n * @param lambda The function to apply to each Compound.\n * @throws # If lambda is null.\n */\n public function visitCompounds(lambda:Compound->Void){\n #if(!NAPE_RELEASE_BUILD)\n if(lambda==null)throw \"Error: lambda cannot be null for Space::visitCompounds\";\n #end\n for(c in compounds){\n lambda(c);\n c.visitCompounds(lambda);\n }\n }\n /**\n * Static, immutable Body for constraint purposes.\n *

\n * This is a completely static, uncollidable, uninteractable Body\n * with no Shapes, that cannot be modified in any way.\n *

\n * Its purpose is to provide a means for attaching Constraints\n * from one Body to the Space itself, for instance pinning a body\n * against a static point in space.\n */\n #if nape_swc@:isVar #end\n public var world(get_world,never):Body;\n inline function get_world():Body{\n return zpp_inner.__static;\n }\n /**\n * List of all active arbiters in Space.\n *

\n * This list is immutable.\n */\n #if nape_swc@:isVar #end\n public var arbiters(get_arbiters,never):ArbiterList;\n inline function get_arbiters():ArbiterList{\n if(zpp_inner.wrap_arbiters==null){\n var ret=new ZPP_SpaceArbiterList();\n ret.space=zpp_inner;\n zpp_inner.wrap_arbiters=ret;\n }\n return zpp_inner.wrap_arbiters;\n }\n /**\n * List of all Listeners in space.\n *

\n * This list is mutable, and adding an element to this list is one way of\n * adding a Listener to this Space equivalent to: listener.space = space\n */\n #if nape_swc@:isVar #end\n public var listeners(get_listeners,never):ListenerList;\n inline function get_listeners():ListenerList{\n return zpp_inner.wrap_listeners;\n }\n /**\n * Clear the Space of all objects.\n *

\n * Things such as the elapsed simulation time, and time step will too be\n * reset to 0.\n *

\n * Parameters such as gravity, and worldLinearDrag will be untouched by\n * this operation.\n */\n #if nape_swc@:keep #end\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(zpp_inner.midstep)throw \"Error: Space::clear() cannot be called during space step()\";\n #end\n zpp_inner.clear();\n }\n /**\n * Step simulation forward in time.\n *\n * @param deltaTime The number of seconds to simulate. For 60fps physics\n * you would use a value of 1/60.\n * @param velocityIterations The number of iterations to use in resolving\n * errors in the velocities of objects. This is\n * together with collision detection the most\n * expensive phase of a simulation update, as well\n * as the most important for stable results.\n * (default 10)\n * @param positionIterations The number of iterations to use in resolving\n * errors in the positions of objects. This is\n * far more lightweight than velocity iterations,\n * as well as being less important for the\n * stability of results. (default 10)\n * @throws # If deltaTime is not strictly positive.\n * @throws # If either of the number of iterations is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function step(deltaTime:Float,velocityIterations:Int=10,positionIterations:Int=10){\n #if(!NAPE_RELEASE_BUILD)\n if((deltaTime!=deltaTime))throw \"Error: deltaTime cannot be NaN\";\n if(deltaTime<=0)throw \"Error: deltaTime must be strictly positive\";\n if(velocityIterations<=0)throw \"Error: must use atleast one velocity iteration\";\n if(positionIterations<=0)throw \"Error: must use atleast one position iteration\";\n #end\n zpp_inner.step(deltaTime,velocityIterations,positionIterations);\n }\n /**\n * The time stamp of this Space object.\n *

\n * This is equal to the number of times that space.step(..) has been invoked.\n */\n #if nape_swc@:isVar #end\n public var timeStamp(get_timeStamp,never):Int;\n inline function get_timeStamp():Int{\n return zpp_inner.stamp;\n }\n /**\n * The elapsed simulation time.\n *

\n * This is the total amount of 'time' that has elapsed in the Space simulation.\n */\n #if nape_swc@:isVar #end\n public var elapsedTime(get_elapsedTime,never):Float;\n inline function get_elapsedTime():Float{\n return zpp_inner.time;\n }\n /**\n * Construct a new Space object.\n *\n * @param gravity The gravity of this space. (default (0,0))\n * @param broadphase The broadphase type to use. (default DYNAMIC_AABB_TREE)\n * @return The constructed Space object.\n * @throws # If gravity is non-null, and has been disposed of.\n */\n public function new(gravity:Vec2=null,broadphase:Broadphase=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(gravity!=null&&gravity.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n zpp_inner=new ZPP_Space(gravity==null?null:gravity.zpp_inner,broadphase);\n zpp_inner.outer=this;\n if(gravity!=null)({\n if(({\n gravity.zpp_inner.weak;\n })){\n gravity.dispose();\n true;\n }\n else{\n false;\n }\n });\n }\n /**\n * Determine the interaction type that would occur between a pair of Shapes.\n *

\n * This function takes into account everything possible, and ignoring the\n * callback system will tell you precisely the type of interaction (if any\n * at all) which will occur between these Shapes.\n *

\n * This function can only work if the Shapes belong to a Body.\n *

\n * This function can only make use of any constraints 'ignore' property\n * to determine if 'null' should be returned if the constraints being used\n * are inside of a Space.\n *\n * @param shape1 The first Shape to test.\n * @param shape2 The second Shape to test.\n * @return The interaction type that will occur between these shapes, or null\n * if no interaction will occur.\n * @throws # If either shape is null, or is not contained within a body.\n */\n #if nape_swc@:keep #end\n public function interactionType(shape1:Shape,shape2:Shape):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(shape1==null||shape2==null)throw \"Error: Cannot evaluate interaction type for null shapes\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape1.body==null||shape2.body==null)throw \"Error: Cannot evaluate interaction type for shapes not part of a Body\";\n #end\n if(shape1.body.isStatic()&&shape2.body.isStatic())return null;\n if(shape1.body==shape2.body)return null;\n var s1=shape1.zpp_inner;\n var s2=shape2.zpp_inner;\n return switch(zpp_inner.interactionType(s1,s2,s1.body,s2.body)){\n case 0:InteractionType.FLUID;\n case 1:InteractionType.COLLISION;\n case 2:InteractionType.SENSOR;\n default:null;\n }\n }\n /**\n * Evaluate all Shapes under a given Point.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param point The point to evaluate shapes.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the Shapes containing the given point.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function shapesUnderPoint(point:Vec2,filter:InteractionFilter=null,output:ShapeList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot evaluate shapes under a null point :)\";\n #end\n var ret=zpp_inner.shapesUnderPoint(point.x,point.y,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Bodies under a given Point.\n *

\n * If the filter argument is non-null, then only bodies with a shape containing\n * the given point whose filter agrees to 'collide' will be considered.\n *\n * @param point The point to evaluate bodies.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the Bodies containing the given point.\n * @throws # If point is null or disposed of.\n */\n #if nape_swc@:keep #end\n public function bodiesUnderPoint(point:Vec2,filter:InteractionFilter=null,output:BodyList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(point!=null&&point.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(point==null)throw \"Error: Cannot evaluate objects under a null point :)\";\n #end\n var ret=zpp_inner.bodiesUnderPoint(point.x,point.y,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n point.zpp_inner.weak;\n })){\n point.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Shapes given an AABB.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param aabb The bounding box to query shapes by,\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param strict If false, then the Shape's bounding box will be used to\n * classify the Shape, instead of the Shape itself.\n * (default true)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given AABB.\n * @throws # If AABB is null, or is degenerate.\n */\n #if nape_swc@:keep #end\n public function shapesInAABB(aabb:AABB,containment:Bool=false,strict:Bool=true,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(aabb==null)throw \"Error: Cannot evaluate shapes in a null AABB :)\";\n if(aabb.width==0||aabb.height==0)throw \"Error: Cannot evaluate shapes in degenerate AABB :/\";\n #end\n return zpp_inner.shapesInAABB(aabb,strict,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Bodies given an AABB.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the AABB, whose filter agrees to collide\n * will be considered.\n *\n * @param aabb The bounding box to query bodies by,\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered.\n * (default false)\n * @param strict If false, then the body's shape's bounding box will be used to\n * classify the shapes of the body, instead of the Shape itself.\n * (default true)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given AABB.\n * @throws # If AABB is null, or is degenerate.\n */\n #if nape_swc@:keep #end\n public function bodiesInAABB(aabb:AABB,containment:Bool=false,strict:Bool=true,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(aabb==null)throw \"Error: Cannot evaluate objects in a null AABB :)\";\n if(aabb.width==0||aabb.height==0)throw \"Error: Cannot evaluate objects in degenerate AABB :/\";\n #end\n return zpp_inner.bodiesInAABB(aabb,strict,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Shapes given a circle.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered.\n *\n * @param position The position of the centre of the circle.\n * @param radius The radius of the circle.\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given circle.\n * @throws # If positions is null or disposed of.\n * @throws # If radius is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function shapesInCircle(position:Vec2,radius:Float,containment:Bool=false,filter:InteractionFilter=null,output:ShapeList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Cannot evaluate shapes at null circle :)\";\n if((radius!=radius))throw \"Error: Circle radius cannot be NaN\";\n if(radius<=0)throw \"Error: Circle radius must be strictly positive\";\n #end\n var ret=zpp_inner.shapesInCircle(position,radius,containment,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Bodies given a circle.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the circle, whose filter agrees to collide\n * will be considered.\n *\n * @param position The position of the centre of the circle.\n * @param radius The radius of the circle.\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered. If a\n * filter is supplied, only shapes that agree to collide\n * will be used in this containment check.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given circle.\n * @throws # If positions is null or disposed of.\n * @throws # If radius is not strictly positive.\n */\n #if nape_swc@:keep #end\n public function bodiesInCircle(position:Vec2,radius:Float,containment:Bool=false,filter:InteractionFilter=null,output:BodyList=null){\n {\n #if(!NAPE_RELEASE_BUILD)\n if(position!=null&&position.zpp_disp)throw \"Error: \"+\"Vec2\"+\" has been disposed and cannot be used!\";\n #end\n };\n #if(!NAPE_RELEASE_BUILD)\n if(position==null)throw \"Error: Cannot evaluate objects at null circle :)\";\n if((radius!=radius))throw \"Error: Circle radius cannot be NaN\";\n if(radius<=0)throw \"Error: Circle radius must be strictly positive\";\n #end\n var ret=zpp_inner.bodiesInCircle(position,radius,containment,filter==null?null:filter.zpp_inner,output);\n ({\n if(({\n position.zpp_inner.weak;\n })){\n position.dispose();\n true;\n }\n else{\n false;\n }\n });\n return ret;\n }\n /**\n * Evaluate all Shapes given another shape.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered. The input shape's own filter\n * is never used in this method. The input shape is considered a purely\n * geometric object.\n *

\n * The input shape must be part of a Body so as to be well defined.\n *\n * @param shape The shape to use in classifying other shapes.\n * @param containment If true, then only Shapes entirely contained (Rather\n * than simply intersected) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given shape.\n * @throws # If shape is null or not part of a body.\n * @throws # If shape is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function shapesInShape(shape:Shape,containment:Bool=false,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot evaluate shapes in a null shapes :)\";\n if(shape.body==null)throw \"Error: Query shape needs to be inside a Body to be well defined :)\";\n if(shape.isPolygon()){\n var res=shape.zpp_inner.polygon.valid();\n if(res!=ValidationResult.VALID)throw \"Error: Polygon query shape is invalid : \"+res.toString();\n }\n #end\n return zpp_inner.shapesInShape(shape.zpp_inner,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Bodies given a shape.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the input shape, whose filter agrees to collide\n * will be considered. The input shape is considered a purely geometric\n *

\n * The input shape must be part of a Body so as to be well defined.\n *\n * @param shape The shape to use in classifying other shapes.\n * @param containment If true, then only Bodies entirely contained (Rather\n * than simply intersecting) will be considered.\n * (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the bodies for given shape.\n * @throws # If shape is null or not part of a body.\n * @throws # If shape is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function bodiesInShape(shape:Shape,containment:Bool=false,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot evaluate bodies in a null shapes :)\";\n if(shape.body==null)throw \"Error: Query shape needs to be inside a Body to be well defined :)\";\n if(shape.isPolygon()){\n var res=shape.zpp_inner.polygon.valid();\n if(res!=ValidationResult.VALID)throw \"Error: Polygon query shape is invalid : \"+res.toString();\n }\n #end\n return zpp_inner.bodiesInShape(shape.zpp_inner,containment,filter==null?null:filter.zpp_inner,output);\n }\n /**\n * Evaluate all Shapes given a Body.\n *

\n * If the filter argument is non-null, then only shapes who's filter\n * agrees to 'collide' will be considered. The input body's shape's own filters\n * are never used in this method. The input body is considered a purely\n * geometric object.\n *\n * @param body The body to use in classifying other shapes.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the shapes for given body.\n * @throws # If body is null.\n * @throws # If body has a shape that is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function shapesInBody(body:Body,filter:InteractionFilter=null,output:ShapeList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Cannot evaluate shapes in null body\";\n #end\n var ret=(output==null?new ShapeList():output);\n for(shape in body.shapes){\n var cur=shapesInShape(shape,false,filter,ret);\n }\n return ret;\n }\n /**\n * Evaluate all Bodies given a Body.\n *

\n * If the filter argument is non-null, then only bodies with a shape\n * classified as being part of the input body, whose filter agrees to collide\n * will be considered. The input body is considered a purely geometric\n *\n * @param body The body to use in classifying other bodies.\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output Optional list to append results to instead of creating a new list (default null).\n * @return A list of all the bodies for given body.\n * @throws # If body is null.\n * @throws # If body has a shape that is a polygon, and that polygon is not 'valid'\n */\n #if nape_swc@:keep #end\n public function bodiesInBody(body:Body,filter:InteractionFilter=null,output:BodyList=null){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: Cannot evaluate shapes in null body\";\n #end\n var ret=(output==null?new BodyList():output);\n for(shape in body.shapes){\n var cur=bodiesInShape(shape,false,filter,ret);\n }\n return ret;\n }\n /**\n * Perform a convex cast for soonest collision.\n *

\n * This method will return only the soonest collision result (if any), to find\n * more than this, use the convexMultiCast method. The shape will not be\n * swept further than the time delta provided.\n * Shapes already intersecting\n * the sweep shape at t = 0 are ignored.\n *

\n * If the filter argument is null, then all shapes will be collidable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param shape The Shape to be cast through space. This shape must belong\n * to a body whose velocity is used to define the sweep.\n * @param deltaTime The amount of time to sweep the shape forward.\n * @param liveSweep If true, then moving objects in the space will have their motion considered during the sweep. Otherwise; like with normal rayCast, objects in the space are considered un-moving for the cast. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @return The soonest result (if any) of convex intersection.\n * @throws # If shape is null, or not part of a body.\n * @throws # If deltaTime is negative.\n */\n #if nape_swc@:keep #end\n public function convexCast(shape:Shape,deltaTime:Float,liveSweep:Bool=false,filter:InteractionFilter=null):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot cast null shape :)\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape.body==null)throw \"Error: Shape must belong to a body to be cast.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(deltaTime<0||(deltaTime!=deltaTime))throw \"Error: deltaTime must be positive\";\n #end\n return zpp_inner.convexCast(shape.zpp_inner,deltaTime,filter,liveSweep);\n }\n /**\n * Perform a convex cast for all collisions in time order.\n *

\n * This method will return all collisions, or an empty list if there are none.\n * The shape will not be\n * swept further than the time delta provided. Shapes already intersecting\n * the sweep shape at t = 0 are ignored.\n *

\n * If the filter argument is null, then all shapes will be collidable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param shape The Shape to be cast through space. This shape must belong\n * to a body whose velocity is used to define the sweep.\n * @param deltaTime The amount of time to sweep the shape forward.\n * @param liveSweep If true, then moving objects in the space will have their motion considered during the sweep. Otherwise; like with normal rayCast, objects in the space are considered un-moving for the cast. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output A list to append results to instead of allocating a new one (default null)\n * @return The collision results in time order.\n * @throws # If shape is null, or not part of a body.\n * @throws # If deltaTime is negative.\n */\n #if nape_swc@:keep #end\n public function convexMultiCast(shape:Shape,deltaTime:Float,liveSweep:Bool=false,filter:InteractionFilter=null,output:ConvexResultList):ConvexResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(shape==null)throw \"Error: Cannot cast null shape :)\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(shape.body==null)throw \"Error: Shape must belong to a body to be cast.\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(deltaTime<0||(deltaTime!=deltaTime))throw \"Error: deltaTime must be positive\";\n #end\n return zpp_inner.convexMultiCast(shape.zpp_inner,deltaTime,filter,liveSweep,output);\n }\n /**\n * Perform a ray cast for closest result.\n *

\n * This method will return only the closest result (if any), to find more\n * the first result, use the rayMultiCast method. The ray will not be\n * cast beyond its maxDistance.\n *

\n * If the filter argument is null, then all shapes will be intersectable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param ray The ray to cast through space.\n * @param inner If true then inner surfaces of shapes will also be intersected.\n * otherwise only the outer surfaces. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @return The closest result (if any) of ray intersection.\n * @throws # If ray is null.\n */\n #if nape_swc@:keep #end\n public function rayCast(ray:Ray,inner:Bool=false,filter:InteractionFilter=null):Null{\n #if(!NAPE_RELEASE_BUILD)\n if(ray==null)throw \"Error: Cannot cast null ray :)\";\n #end\n return zpp_inner.rayCast(ray,inner,filter);\n }\n /**\n * Perform a ray cast for all valid results.\n *

\n * This method will return all intersections (in distance order) of ray\n * with shapes in the space up to the ray's maxDistance.\n *

\n * If the filter argument is null, then all shapes will be intersectable\n * otherwise only those for whose filter agrees to 'collide'.\n *\n * @param ray The ray to cast through space.\n * @param inner If true then inner surfaces of shapes will also be intersected.\n * otherwise only the outer surfaces. (default false)\n * @param filter Optional filter to pick and choose shapes, based on whether\n * the filters agree to collide. (default null)\n * @param output A list to append results to instead of allocating a new one (default null)\n * @return All valid results of ray cast in distance order from closest to furthest.\n * @throws # If ray is null.\n */\n #if nape_swc@:keep #end\n public function rayMultiCast(ray:Ray,inner:Bool=false,filter:InteractionFilter=null,output:RayResultList=null):RayResultList{\n #if(!NAPE_RELEASE_BUILD)\n if(ray==null)throw \"Error: Cannot cast null ray :)\";\n #end\n return zpp_inner.rayMultiCast(ray,inner,filter,output);\n }\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.nape;\n\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport pixi.plugins.app.Application;\nimport haxe.Timer;\n\nimport nape.geom.Vec2;\nimport nape.phys.Body;\nimport nape.phys.BodyType;\nimport nape.shape.Circle;\nimport nape.shape.Polygon;\nimport nape.space.Space;\nimport nape.phys.Material;\n\nclass Main extends Application {\n\n\tvar _floor:Body;\n\tvar _space:Space;\n\tvar _balls:Array;\n\tvar _pballs:Array;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\n\t\t_balls = [];\n\t\t_pballs = [];\n\t\t_setUpPhysics();\n\t\tonUpdate = _onUpdate;\n\t\tvar timer:Timer = new Timer(1000);\n\t\ttimer.run = _addBall;\n\t\t_addBall();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x6699FF;\n\t\tautoResize = false;\n\t\twidth = 800;\n\t\theight = 600;\n\t\tsuper.start();\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_space.step(1 / 60);\n\n\t\tfor(i in 0 ... _pballs.length) {\n\t\t\t_balls[i].position.x = _pballs[i].position.x;\n\t\t\t_balls[i].position.y = _pballs[i].position.y;\n\t\t\t_balls[i].rotation = _pballs[i].rotation;\n\t\t}\n\t}\n\n\tfunction _setUpPhysics() {\n\t\tvar gravity = Vec2.weak(0, 600);\n\t\t_space = new Space(gravity);\n\n\t\t_floor = new Body(BodyType.STATIC);\n\t\t_floor.setShapeMaterials(Material.wood());\n\t\t_floor.shapes.add(new Polygon(Polygon.rect(0, 595, 800, 1)));\n\t\t_floor.space = _space;\n\t}\n\n\tfunction _addBall() {\n\t\tvar ball:Sprite = new Sprite(Texture.fromImage(\"assets/nape/ball.png\"));\n\t\tball.anchor.set(0.5, 0.5);\n\t\t_balls.push(ball);\n\t\tstage.addChild(ball);\n\n\t\tvar pball:Body = new Body(BodyType.DYNAMIC);\n\t\tpball.shapes.add(new Circle(10));\n\t\tpball.position.setxy(Std.random(800), 0);\n\t\tpball.angularVel = 0;\n\t\tpball.allowRotation = true;\n\n\t\tpball.setShapeMaterials(Material.rubber());\n\t\tpball.space = _space;\n\t\t_pballs.push(pball);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}","package zpp_nape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_ID{\n \n public static var _Constraint:Int=0;\n public static function Constraint(){\n return _Constraint++;\n }\n public static var _Interactor:Int=0;\n public static function Interactor(){\n return _Interactor++;\n }\n public static var _CbType:Int=0;\n public static function CbType(){\n return _CbType++;\n }\n public static var _CbSet:Int=0;\n public static function CbSet(){\n return _CbSet++;\n }\n public static var _Listener:Int=0;\n public static function Listener(){\n return _Listener++;\n }\n public static var _ZPP_SimpleVert:Int=0;\n public static function ZPP_SimpleVert(){\n return _ZPP_SimpleVert++;\n }\n public static var _ZPP_SimpleSeg:Int=0;\n public static function ZPP_SimpleSeg(){\n return _ZPP_SimpleSeg++;\n }\n public static var _Space:Int=0;\n public static function Space(){\n return _Space++;\n }\n public static var _InteractionGroup:Int=0;\n public static function InteractionGroup(){\n return _InteractionGroup++;\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Callback{\n public var outer_body:Null=null;\n public var outer_con:Null=null;\n public var outer_int:Null=null;\n #if(!NAPE_RELEASE_BUILD)\n public static var internal=false;\n #end\n public function wrapper_body(){\n if(outer_body==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_body=new BodyCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_body.zpp_inner=this;\n }\n return outer_body;\n }\n public function wrapper_con(){\n if(outer_con==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_con=new ConstraintCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_con.zpp_inner=this;\n }\n return outer_con;\n }\n public function wrapper_int(){\n if(outer_int==null){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer_int=new InteractionCallback();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n outer_int.zpp_inner=this;\n }\n genarbs();\n return outer_int;\n }\n public var event:Int=0;\n public var listener:ZPP_Listener=null;\n public var space:ZPP_Space=null;\n public var index:Int=0;\n public var next:ZPP_Callback=null;\n public var prev:ZPP_Callback=null;\n public var length:Int=0;\n public function push(obj:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"push null?\");\n #end\n };\n if(prev!=null)prev.next=obj;\n else next=obj;\n obj.prev=prev;\n obj.next=null;\n prev=obj;\n length++;\n }\n public function push_rev(obj:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"push_rev null?\");\n #end\n };\n if(next!=null)next.prev=obj;\n else prev=obj;\n obj.next=next;\n obj.prev=null;\n next=obj;\n length++;\n }\n public function pop():ZPP_Callback{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n next!=null;\n };\n if(!res)throw \"assert(\"+\"next!=null\"+\") :: \"+(\"empty queue\");\n #end\n };\n var ret=next;\n next=ret.next;\n if(next==null)prev=null;\n else next.prev=null;\n length--;\n return ret;\n }\n public function pop_rev():ZPP_Callback{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n prev!=null;\n };\n if(!res)throw \"assert(\"+\"prev!=null\"+\") :: \"+(\"empty queue\");\n #end\n };\n var ret=prev;\n prev=ret.prev;\n if(prev==null)next=null;\n else prev.next=null;\n length--;\n return ret;\n }\n public function empty(){\n return next==null;\n }\n public function clear(){\n while(!empty())pop();\n }\n public function splice(o:ZPP_Callback){\n var ret=o.next;\n if(o.prev==null){\n next=o.next;\n if(next!=null)next.prev=null;\n else prev=null;\n }\n else{\n o.prev.next=o.next;\n if(o.next!=null)o.next.prev=o.prev;\n else prev=o.prev;\n }\n length--;\n return ret;\n }\n public function rotateL(){\n push(pop());\n }\n public function rotateR(){\n push_rev(pop_rev());\n }\n public function cycleNext(o:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"cyclNext null?\");\n #end\n };\n if(o.next==null)return next;\n else return o.next;\n }\n public function cyclePrev(o:ZPP_Callback){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"cyclPrev null?\");\n #end\n };\n if(o.prev==null)return prev;\n else return o.prev;\n }\n public function at(i:Int){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i>=0&&i=0&&i=0&&i=0&&i0;\n };\n if(!res)throw \"assert(\"+\"count>0\"+\") :: \"+(\"decrementing ref.count into negatives??\");\n #end\n };\n return(--count)==0;\n }\n public function invalidate_pairs():Void{\n {\n var cx_ite=cbpairs.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.invalidate();\n cx_ite=cx_ite.next;\n }\n };\n }\n public var listeners:ZNPList_ZPP_InteractionListener=null;\n public var zip_listeners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_listeners():Void{\n zip_listeners=true;\n #if true invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_listeners():Void{\n if(zip_listeners){\n zip_listeners=false;\n realvalidate_listeners();\n }\n }\n public function realvalidate_listeners(){\n listeners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=listeners.begin();\n var cite=cb.listeners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !listeners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!listeners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if true true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=listeners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public var bodylisteners:ZNPList_ZPP_BodyListener=null;\n public var zip_bodylisteners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_bodylisteners():Void{\n zip_bodylisteners=true;\n #if false invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_bodylisteners():Void{\n if(zip_bodylisteners){\n zip_bodylisteners=false;\n realvalidate_bodylisteners();\n }\n }\n public function realvalidate_bodylisteners(){\n bodylisteners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=bodylisteners.begin();\n var cite=cb.bodylisteners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !bodylisteners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!bodylisteners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if false true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=bodylisteners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public var conlisteners:ZNPList_ZPP_ConstraintListener=null;\n public var zip_conlisteners:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_conlisteners():Void{\n zip_conlisteners=true;\n #if false invalidate_pairs();\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_conlisteners():Void{\n if(zip_conlisteners){\n zip_conlisteners=false;\n realvalidate_conlisteners();\n }\n }\n public function realvalidate_conlisteners(){\n conlisteners.clear();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n var npre=null;\n var nite=conlisteners.begin();\n var cite=cb.conlisteners.begin();\n while(cite!=null){\n var cx=cite.elem();\n if(nite!=null&&nite.elem()==cx){\n cite=cite.next;\n npre=nite;\n nite=nite.next;\n }\n else if(nite==null||ZPP_Listener.setlt(cx,nite.elem())){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !conlisteners.has(cx);\n };\n if(!res)throw \"assert(\"+\"!conlisteners.has(cx)\"+\") :: \"+(\"merged list already contains listener\");\n #end\n };\n if(#if false true#else!cx.options.excluded(cbTypes)#end\n &&manager.valid_listener(cx)){\n npre=conlisteners.inlined_insert(npre,cx);\n }\n cite=cite.next;\n }\n else{\n npre=nite;\n nite=nite.next;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function validate(){\n \n validate_listeners();\n validate_bodylisteners();\n validate_conlisteners();\n }\n public var interactors:ZNPList_ZPP_Interactor=null;\n public var wrap_interactors:InteractorList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addConstraint(con:ZPP_Constraint){\n constraints.add(con);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addInteractor(intx:ZPP_Interactor){\n interactors.add(intx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remConstraint(con:ZPP_Constraint){\n constraints.remove(con);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remInteractor(intx:ZPP_Interactor){\n interactors.remove(intx);\n }\n public static function setlt(a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n var i=a.cbTypes.begin();\n var j=b.cbTypes.begin();\n while(i!=null&&j!=null){\n var ca=i.elem();\n var cb=j.elem();\n if(ZPP_CbType.setlt(ca,cb))return true;\n if(ZPP_CbType.setlt(cb,ca))return false;\n else{\n i=i.next;\n j=j.next;\n }\n }\n return j!=null&&i==null;\n }\n public function new(){\n cbTypes=new ZNPList_ZPP_CbType();\n \n listeners=new ZNPList_ZPP_InteractionListener();\n zip_listeners=true;\n bodylisteners=new ZNPList_ZPP_BodyListener();\n zip_bodylisteners=true;\n conlisteners=new ZNPList_ZPP_ConstraintListener();\n zip_conlisteners=true;\n constraints=new ZNPList_ZPP_Constraint();\n interactors=new ZNPList_ZPP_Interactor();\n id=ZPP_ID.CbSet();\n cbpairs=new ZNPList_ZPP_CbSetPair();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n constraints.empty();\n };\n if(!res)throw \"assert(\"+\"constraints.empty()\"+\") :: \"+(\"non-empty constraints\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n interactors.empty();\n };\n if(!res)throw \"assert(\"+\"interactors.empty()\"+\") :: \"+(\"non-empty interactors\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n count==0;\n };\n if(!res)throw \"assert(\"+\"count==0\"+\") :: \"+(\"deallocating with count!=0?\");\n #end\n };\n \n listeners.clear();\n zip_listeners=true;\n bodylisteners.clear();\n zip_bodylisteners=true;\n conlisteners.clear();\n zip_conlisteners=true;\n {\n while(!cbTypes.empty()){\n var cb=cbTypes.pop_unsafe();\n cb.cbsets.remove(this);\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbpairs.empty();\n };\n if(!res)throw \"assert(\"+\"cbpairs.empty()\"+\") :: \"+(\"non-empty cbpairs\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_ASSERT public static function assert_cbTypes(cbTypes:ZNPList_ZPP_CbType):Void{\n var pre=null;\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n if(pre!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ZPP_CbType.setlt(pre,cur);\n };\n if(!res)throw \"assert(\"+\"ZPP_CbType.setlt(pre,cur)\"+\") :: \"+(\"cbTypes of CbSet not well-ordered!\");\n #end\n };\n }\n pre=cur;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #end\n public static function get(cbTypes:ZNPList_ZPP_CbType){\n var ret;\n {\n if(ZPP_CbSet.zpp_pool==null){\n ret=new ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_TOT++;\n ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT--;\n ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n var ite=null;\n #if NAPE_ASSERT assert_cbTypes(cbTypes);\n #end\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n ite=ret.cbTypes.insert(ite,cb);\n cb.cbsets.add(ret);\n };\n cx_ite=cx_ite.next;\n }\n };\n return ret;\n }\n #if NAPE_NO_INLINE#else inline #end\n static function compatible(i:ZPP_InteractionListener,a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n return(i.options1.compatible(a.cbTypes)&&i.options2.compatible(b.cbTypes))||(i.options2.compatible(a.cbTypes)&&i.options1.compatible(b.cbTypes));\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function empty_intersection(a:ZPP_CbSet,b:ZPP_CbSet):Bool{\n return a.manager.pair(a,b).empty_intersection();\n }\n public static function single_intersection(a:ZPP_CbSet,b:ZPP_CbSet,i:ZPP_InteractionListener):Bool{\n return a.manager.pair(a,b).single_intersection(i);\n }\n #if NAPE_NO_INLINE#else inline #end\n public static function find_all(a:ZPP_CbSet,b:ZPP_CbSet,event:Int,cb:ZPP_InteractionListener->Void):Void{\n a.manager.pair(a,b).forall(event,cb);\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_CbSetPair{\n public var a:ZPP_CbSet=null;\n public var b:ZPP_CbSet=null;\n public var next:ZPP_CbSetPair=null;\n static public var zpp_pool:ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n a=b=null;\n listeners.clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n zip_listeners=true;\n }\n public function new(){\n listeners=new ZNPList_ZPP_InteractionListener();\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function get(a:ZPP_CbSet,b:ZPP_CbSet):ZPP_CbSetPair{\n var ret;\n {\n if(ZPP_CbSetPair.zpp_pool==null){\n ret=new ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_TOT++;\n ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT--;\n ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n if(ZPP_CbSet.setlt(a,b)){\n ret.a=a;\n ret.b=b;\n }\n else{\n ret.a=b;\n ret.b=a;\n }\n return ret;\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function setlt(x:ZPP_CbSetPair,y:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n (x.a==y.a)==(!ZPP_CbSet.setlt(x.a,y.a)&&!ZPP_CbSet.setlt(y.a,x.a));\n };\n if(!res)throw \"assert(\"+\"(x.a==y.a)==(!ZPP_CbSet.setlt(x.a,y.a)&&!ZPP_CbSet.setlt(y.a,x.a))\"+\") :: \"+(\"Assumption that CbSet's are unique!! Aka we can compare for 'equal' CbSet with == is wrong?? :(\");\n #end\n };\n return ZPP_CbSet.setlt(x.a,y.a)||(x.a==y.a&&ZPP_CbSet.setlt(x.b,y.b));\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function compatible(i:ZPP_InteractionListener):Bool{\n return(i.options1.compatible(a.cbTypes)&&i.options2.compatible(b.cbTypes))||(i.options2.compatible(a.cbTypes)&&i.options1.compatible(b.cbTypes));\n }\n public var zip_listeners:Bool=false;\n public var listeners:ZNPList_ZPP_InteractionListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n zip_listeners=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(zip_listeners){\n zip_listeners=false;\n __validate();\n }\n }\n public function __validate():Void{\n listeners.clear();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !a.zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!a.zip_listeners\"+\") :: \"+(\"a.listeners not validated??\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !b.zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!b.zip_listeners\"+\") :: \"+(\"b.listeners not validated??\");\n #end\n };\n var aite=a.listeners.begin();\n var bite=b.listeners.begin();\n while(aite!=null&&bite!=null){\n var ax=aite.elem();\n var bx=bite.elem();\n if(ax==bx){\n if(compatible(ax)){\n listeners.add(ax);\n }\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_Listener.setlt(ax,bx))aite=aite.next;\n else bite=bite.next;\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty_intersection():Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before empty_intersection\");\n #end\n };\n return listeners.empty();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function single_intersection(i:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before single_intersection\");\n #end\n };\n var ite=listeners.begin();\n return ite!=null&&ite.elem()==i&&ite.next==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function forall(event:Int,cb:ZPP_InteractionListener->Void):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !zip_listeners;\n };\n if(!res)throw \"assert(\"+\"!zip_listeners\"+\") :: \"+(\"not validated before forall\");\n #end\n };\n {\n var cx_ite=listeners.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x.event==event)cb(x);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbType{\n public var head:ZNPNode_ZPP_CbType=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbType{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbType):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbType):ZPP_CbType{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbType):ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbType.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbType();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_TOT++;\n ZNPNode_ZPP_CbType.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT--;\n ZNPNode_ZPP_CbType.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbType,o:ZPP_CbType):ZNPNode_ZPP_CbType{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbType,o:ZPP_CbType):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbType.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbType();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_TOT++;\n ZNPNode_ZPP_CbType.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT--;\n ZNPNode_ZPP_CbType.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbType\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT++;\n ZNPNode_ZPP_CbType.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbType{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbType):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbType):ZNPNode_ZPP_CbType{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbType):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbType;\n var ret:ZNPNode_ZPP_CbType;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbType\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbType.zpp_pool;\n ZNPNode_ZPP_CbType.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbType.POOL_CNT++;\n ZNPNode_ZPP_CbType.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbType,n:Int):ZNPNode_ZPP_CbType{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbType):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbType):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbType\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbType{\n return begin().elem();\n }\n public function back():ZPP_CbType{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbType{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CallbackSet{\n public var head:ZNPNode_ZPP_CallbackSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CallbackSet{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CallbackSet):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CallbackSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_TOT++;\n ZNPNode_ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT--;\n ZNPNode_ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CallbackSet,o:ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CallbackSet,o:ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CallbackSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_TOT++;\n ZNPNode_ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT--;\n ZNPNode_ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CallbackSet\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT++;\n ZNPNode_ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CallbackSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CallbackSet):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CallbackSet;\n var ret:ZNPNode_ZPP_CallbackSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CallbackSet\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CallbackSet.zpp_pool;\n ZNPNode_ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CallbackSet.POOL_CNT++;\n ZNPNode_ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CallbackSet,n:Int):ZNPNode_ZPP_CallbackSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CallbackSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CallbackSet{\n return begin().elem();\n }\n public function back():ZPP_CallbackSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Shape{\n public var head:ZNPNode_ZPP_Shape=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Shape{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Shape):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Shape):ZPP_Shape{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Shape):ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Shape.zpp_pool==null){\n ret=new ZNPNode_ZPP_Shape();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_TOT++;\n ZNPNode_ZPP_Shape.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT--;\n ZNPNode_ZPP_Shape.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Shape,o:ZPP_Shape):ZNPNode_ZPP_Shape{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Shape,o:ZPP_Shape):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Shape.zpp_pool==null){\n ret=new ZNPNode_ZPP_Shape();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_TOT++;\n ZNPNode_ZPP_Shape.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT--;\n ZNPNode_ZPP_Shape.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Shape\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT++;\n ZNPNode_ZPP_Shape.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Shape{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Shape):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Shape):ZNPNode_ZPP_Shape{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Shape):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Shape;\n var ret:ZNPNode_ZPP_Shape;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Shape\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Shape.zpp_pool;\n ZNPNode_ZPP_Shape.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Shape.POOL_CNT++;\n ZNPNode_ZPP_Shape.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Shape,n:Int):ZNPNode_ZPP_Shape{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Shape):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Shape):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Shape\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Shape{\n return begin().elem();\n }\n public function back():ZPP_Shape{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Shape{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Body{\n public var head:ZNPNode_ZPP_Body=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Body{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Body):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Body):ZPP_Body{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Body):ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Body.zpp_pool==null){\n ret=new ZNPNode_ZPP_Body();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_TOT++;\n ZNPNode_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT--;\n ZNPNode_ZPP_Body.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Body,o:ZPP_Body):ZNPNode_ZPP_Body{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Body,o:ZPP_Body):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Body.zpp_pool==null){\n ret=new ZNPNode_ZPP_Body();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_TOT++;\n ZNPNode_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT--;\n ZNPNode_ZPP_Body.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Body\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT++;\n ZNPNode_ZPP_Body.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Body{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Body):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Body):ZNPNode_ZPP_Body{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Body):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Body;\n var ret:ZNPNode_ZPP_Body;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Body\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Body.zpp_pool;\n ZNPNode_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Body.POOL_CNT++;\n ZNPNode_ZPP_Body.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Body,n:Int):ZNPNode_ZPP_Body{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Body):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Body):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Body\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Body{\n return begin().elem();\n }\n public function back():ZPP_Body{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Body{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Constraint{\n public var head:ZNPNode_ZPP_Constraint=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Constraint{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Constraint):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Constraint):ZPP_Constraint{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Constraint):ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Constraint.zpp_pool==null){\n ret=new ZNPNode_ZPP_Constraint();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_TOT++;\n ZNPNode_ZPP_Constraint.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT--;\n ZNPNode_ZPP_Constraint.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Constraint,o:ZPP_Constraint):ZNPNode_ZPP_Constraint{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Constraint,o:ZPP_Constraint):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Constraint.zpp_pool==null){\n ret=new ZNPNode_ZPP_Constraint();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_TOT++;\n ZNPNode_ZPP_Constraint.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT--;\n ZNPNode_ZPP_Constraint.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Constraint\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT++;\n ZNPNode_ZPP_Constraint.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Constraint{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Constraint):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Constraint):ZNPNode_ZPP_Constraint{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Constraint):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Constraint;\n var ret:ZNPNode_ZPP_Constraint;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Constraint\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Constraint.zpp_pool;\n ZNPNode_ZPP_Constraint.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Constraint.POOL_CNT++;\n ZNPNode_ZPP_Constraint.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Constraint,n:Int):ZNPNode_ZPP_Constraint{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Constraint):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Constraint):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Constraint\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Constraint{\n return begin().elem();\n }\n public function back():ZPP_Constraint{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Constraint{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Compound{\n public var head:ZNPNode_ZPP_Compound=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Compound{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Compound):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Compound):ZPP_Compound{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Compound):ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Compound.zpp_pool==null){\n ret=new ZNPNode_ZPP_Compound();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_TOT++;\n ZNPNode_ZPP_Compound.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT--;\n ZNPNode_ZPP_Compound.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Compound,o:ZPP_Compound):ZNPNode_ZPP_Compound{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Compound,o:ZPP_Compound):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Compound.zpp_pool==null){\n ret=new ZNPNode_ZPP_Compound();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_TOT++;\n ZNPNode_ZPP_Compound.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT--;\n ZNPNode_ZPP_Compound.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Compound\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT++;\n ZNPNode_ZPP_Compound.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Compound{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Compound):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Compound):ZNPNode_ZPP_Compound{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Compound):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Compound;\n var ret:ZNPNode_ZPP_Compound;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Compound\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Compound.zpp_pool;\n ZNPNode_ZPP_Compound.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Compound.POOL_CNT++;\n ZNPNode_ZPP_Compound.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Compound,n:Int):ZNPNode_ZPP_Compound{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Compound):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Compound):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Compound\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Compound{\n return begin().elem();\n }\n public function back():ZPP_Compound{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Compound{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Arbiter{\n public var head:ZNPNode_ZPP_Arbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Arbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Arbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Arbiter):ZPP_Arbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Arbiter):ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Arbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_Arbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_TOT++;\n ZNPNode_ZPP_Arbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT--;\n ZNPNode_ZPP_Arbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Arbiter,o:ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Arbiter,o:ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Arbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_Arbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_TOT++;\n ZNPNode_ZPP_Arbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT--;\n ZNPNode_ZPP_Arbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Arbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT++;\n ZNPNode_ZPP_Arbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Arbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Arbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Arbiter):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Arbiter;\n var ret:ZNPNode_ZPP_Arbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Arbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Arbiter.zpp_pool;\n ZNPNode_ZPP_Arbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Arbiter.POOL_CNT++;\n ZNPNode_ZPP_Arbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Arbiter,n:Int):ZNPNode_ZPP_Arbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Arbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Arbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Arbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Arbiter{\n return begin().elem();\n }\n public function back():ZPP_Arbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Arbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_InteractionListener{\n public var head:ZNPNode_ZPP_InteractionListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_InteractionListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_InteractionListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_InteractionListener):ZPP_InteractionListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_InteractionListener):ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_TOT++;\n ZNPNode_ZPP_InteractionListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT--;\n ZNPNode_ZPP_InteractionListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_InteractionListener,o:ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_InteractionListener,o:ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_TOT++;\n ZNPNode_ZPP_InteractionListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT--;\n ZNPNode_ZPP_InteractionListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT++;\n ZNPNode_ZPP_InteractionListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_InteractionListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_InteractionListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_InteractionListener):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_InteractionListener;\n var ret:ZNPNode_ZPP_InteractionListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionListener.zpp_pool;\n ZNPNode_ZPP_InteractionListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionListener.POOL_CNT++;\n ZNPNode_ZPP_InteractionListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_InteractionListener,n:Int):ZNPNode_ZPP_InteractionListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_InteractionListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_InteractionListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_InteractionListener{\n return begin().elem();\n }\n public function back():ZPP_InteractionListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_InteractionListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbSet{\n public var head:ZNPNode_ZPP_CbSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbSet{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbSet):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbSet):ZPP_CbSet{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbSet):ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_TOT++;\n ZNPNode_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT--;\n ZNPNode_ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbSet,o:ZPP_CbSet):ZNPNode_ZPP_CbSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbSet,o:ZPP_CbSet):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSet.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSet();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_TOT++;\n ZNPNode_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT--;\n ZNPNode_ZPP_CbSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSet\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT++;\n ZNPNode_ZPP_CbSet.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbSet):ZNPNode_ZPP_CbSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbSet):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbSet;\n var ret:ZNPNode_ZPP_CbSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSet\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSet.zpp_pool;\n ZNPNode_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSet.POOL_CNT++;\n ZNPNode_ZPP_CbSet.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbSet,n:Int):ZNPNode_ZPP_CbSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbSet{\n return begin().elem();\n }\n public function back():ZPP_CbSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Interactor{\n public var head:ZNPNode_ZPP_Interactor=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Interactor{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Interactor):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Interactor):ZPP_Interactor{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Interactor):ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Interactor.zpp_pool==null){\n ret=new ZNPNode_ZPP_Interactor();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_TOT++;\n ZNPNode_ZPP_Interactor.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT--;\n ZNPNode_ZPP_Interactor.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Interactor,o:ZPP_Interactor):ZNPNode_ZPP_Interactor{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Interactor,o:ZPP_Interactor):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Interactor.zpp_pool==null){\n ret=new ZNPNode_ZPP_Interactor();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_TOT++;\n ZNPNode_ZPP_Interactor.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT--;\n ZNPNode_ZPP_Interactor.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Interactor\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT++;\n ZNPNode_ZPP_Interactor.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Interactor{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Interactor):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Interactor):ZNPNode_ZPP_Interactor{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Interactor):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Interactor;\n var ret:ZNPNode_ZPP_Interactor;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Interactor\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Interactor.zpp_pool;\n ZNPNode_ZPP_Interactor.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Interactor.POOL_CNT++;\n ZNPNode_ZPP_Interactor.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Interactor,n:Int):ZNPNode_ZPP_Interactor{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Interactor):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Interactor):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Interactor\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Interactor{\n return begin().elem();\n }\n public function back():ZPP_Interactor{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Interactor{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_BodyListener{\n public var head:ZNPNode_ZPP_BodyListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_BodyListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_BodyListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_BodyListener):ZPP_BodyListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_BodyListener):ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_BodyListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_BodyListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_TOT++;\n ZNPNode_ZPP_BodyListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT--;\n ZNPNode_ZPP_BodyListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_BodyListener,o:ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_BodyListener,o:ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_BodyListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_BodyListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_TOT++;\n ZNPNode_ZPP_BodyListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT--;\n ZNPNode_ZPP_BodyListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_BodyListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT++;\n ZNPNode_ZPP_BodyListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_BodyListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_BodyListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_BodyListener):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_BodyListener;\n var ret:ZNPNode_ZPP_BodyListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_BodyListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_BodyListener.zpp_pool;\n ZNPNode_ZPP_BodyListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_BodyListener.POOL_CNT++;\n ZNPNode_ZPP_BodyListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_BodyListener,n:Int):ZNPNode_ZPP_BodyListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_BodyListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_BodyListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_BodyListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_BodyListener{\n return begin().elem();\n }\n public function back():ZPP_BodyListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_BodyListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CbSetPair{\n public var head:ZNPNode_ZPP_CbSetPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CbSetPair{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CbSetPair):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CbSetPair):ZPP_CbSetPair{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CbSetPair):ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSetPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_TOT++;\n ZNPNode_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT--;\n ZNPNode_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CbSetPair,o:ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CbSetPair,o:ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CbSetPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_TOT++;\n ZNPNode_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT--;\n ZNPNode_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSetPair\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT++;\n ZNPNode_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CbSetPair{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CbSetPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CbSetPair):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CbSetPair;\n var ret:ZNPNode_ZPP_CbSetPair;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CbSetPair\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CbSetPair.zpp_pool;\n ZNPNode_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CbSetPair.POOL_CNT++;\n ZNPNode_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CbSetPair,n:Int):ZNPNode_ZPP_CbSetPair{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CbSetPair):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CbSetPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CbSetPair\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CbSetPair{\n return begin().elem();\n }\n public function back():ZPP_CbSetPair{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CbSetPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ConstraintListener{\n public var head:ZNPNode_ZPP_ConstraintListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ConstraintListener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ConstraintListener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ConstraintListener):ZPP_ConstraintListener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ConstraintListener):ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ConstraintListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_ConstraintListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_TOT++;\n ZNPNode_ZPP_ConstraintListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT--;\n ZNPNode_ZPP_ConstraintListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ConstraintListener,o:ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ConstraintListener,o:ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ConstraintListener.zpp_pool==null){\n ret=new ZNPNode_ZPP_ConstraintListener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_TOT++;\n ZNPNode_ZPP_ConstraintListener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT--;\n ZNPNode_ZPP_ConstraintListener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ConstraintListener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT++;\n ZNPNode_ZPP_ConstraintListener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ConstraintListener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ConstraintListener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ConstraintListener):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ConstraintListener;\n var ret:ZNPNode_ZPP_ConstraintListener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ConstraintListener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ConstraintListener.zpp_pool;\n ZNPNode_ZPP_ConstraintListener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ConstraintListener.POOL_CNT++;\n ZNPNode_ZPP_ConstraintListener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ConstraintListener,n:Int):ZNPNode_ZPP_ConstraintListener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ConstraintListener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ConstraintListener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ConstraintListener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ConstraintListener{\n return begin().elem();\n }\n public function back():ZPP_ConstraintListener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ConstraintListener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CutInt{\n public var head:ZNPNode_ZPP_CutInt=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CutInt{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CutInt):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CutInt):ZPP_CutInt{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CutInt):ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutInt.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutInt();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_TOT++;\n ZNPNode_ZPP_CutInt.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT--;\n ZNPNode_ZPP_CutInt.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CutInt,o:ZPP_CutInt):ZNPNode_ZPP_CutInt{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CutInt,o:ZPP_CutInt):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutInt.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutInt();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_TOT++;\n ZNPNode_ZPP_CutInt.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT--;\n ZNPNode_ZPP_CutInt.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutInt\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT++;\n ZNPNode_ZPP_CutInt.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CutInt{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CutInt):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CutInt):ZNPNode_ZPP_CutInt{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CutInt):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CutInt;\n var ret:ZNPNode_ZPP_CutInt;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutInt\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutInt.zpp_pool;\n ZNPNode_ZPP_CutInt.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutInt.POOL_CNT++;\n ZNPNode_ZPP_CutInt.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CutInt,n:Int):ZNPNode_ZPP_CutInt{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CutInt):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CutInt):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutInt\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CutInt{\n return begin().elem();\n }\n public function back():ZPP_CutInt{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CutInt{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_CutVert{\n public var head:ZNPNode_ZPP_CutVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_CutVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_CutVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_CutVert):ZPP_CutVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_CutVert):ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_TOT++;\n ZNPNode_ZPP_CutVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT--;\n ZNPNode_ZPP_CutVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_CutVert,o:ZPP_CutVert):ZNPNode_ZPP_CutVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_CutVert,o:ZPP_CutVert):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_CutVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_CutVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_TOT++;\n ZNPNode_ZPP_CutVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT--;\n ZNPNode_ZPP_CutVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT++;\n ZNPNode_ZPP_CutVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CutVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CutVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_CutVert):ZNPNode_ZPP_CutVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_CutVert):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_CutVert;\n var ret:ZNPNode_ZPP_CutVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_CutVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_CutVert.zpp_pool;\n ZNPNode_ZPP_CutVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_CutVert.POOL_CNT++;\n ZNPNode_ZPP_CutVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_CutVert,n:Int):ZNPNode_ZPP_CutVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CutVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CutVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CutVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CutVert{\n return begin().elem();\n }\n public function back():ZPP_CutVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CutVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_PartitionVertex{\n public var head:ZNPNode_ZPP_PartitionVertex=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_PartitionVertex{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_PartitionVertex):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_PartitionVertex):ZPP_PartitionVertex{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_PartitionVertex):ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionVertex.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_TOT++;\n ZNPNode_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT--;\n ZNPNode_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_PartitionVertex,o:ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_PartitionVertex,o:ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionVertex.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_TOT++;\n ZNPNode_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT--;\n ZNPNode_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionVertex\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT++;\n ZNPNode_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_PartitionVertex{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_PartitionVertex):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_PartitionVertex):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_PartitionVertex;\n var ret:ZNPNode_ZPP_PartitionVertex;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionVertex\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionVertex.zpp_pool;\n ZNPNode_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionVertex.POOL_CNT++;\n ZNPNode_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_PartitionVertex,n:Int):ZNPNode_ZPP_PartitionVertex{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_PartitionVertex):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_PartitionVertex):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionVertex\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_PartitionVertex{\n return begin().elem();\n }\n public function back():ZPP_PartitionVertex{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_PartitionVertex{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimplifyP{\n public var head:ZNPNode_ZPP_SimplifyP=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimplifyP{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimplifyP):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimplifyP):ZPP_SimplifyP{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimplifyP):ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimplifyP.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimplifyP();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_TOT++;\n ZNPNode_ZPP_SimplifyP.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT--;\n ZNPNode_ZPP_SimplifyP.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimplifyP,o:ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimplifyP,o:ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimplifyP.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimplifyP();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_TOT++;\n ZNPNode_ZPP_SimplifyP.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT--;\n ZNPNode_ZPP_SimplifyP.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimplifyP\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT++;\n ZNPNode_ZPP_SimplifyP.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimplifyP{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimplifyP):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimplifyP):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimplifyP;\n var ret:ZNPNode_ZPP_SimplifyP;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimplifyP\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimplifyP.zpp_pool;\n ZNPNode_ZPP_SimplifyP.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimplifyP.POOL_CNT++;\n ZNPNode_ZPP_SimplifyP.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimplifyP,n:Int):ZNPNode_ZPP_SimplifyP{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimplifyP):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimplifyP):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimplifyP\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimplifyP{\n return begin().elem();\n }\n public function back():ZPP_SimplifyP{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimplifyP{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_PartitionedPoly{\n public var head:ZNPNode_ZPP_PartitionedPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_PartitionedPoly{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_PartitionedPoly):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_PartitionedPoly):ZPP_PartitionedPoly{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_PartitionedPoly):ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionedPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionedPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_TOT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT--;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_PartitionedPoly,o:ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_PartitionedPoly,o:ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_PartitionedPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_PartitionedPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_TOT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT--;\n ZNPNode_ZPP_PartitionedPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionedPoly\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_PartitionedPoly{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_PartitionedPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_PartitionedPoly):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_PartitionedPoly;\n var ret:ZNPNode_ZPP_PartitionedPoly;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_PartitionedPoly\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_PartitionedPoly.zpp_pool;\n ZNPNode_ZPP_PartitionedPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_PartitionedPoly.POOL_CNT++;\n ZNPNode_ZPP_PartitionedPoly.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_PartitionedPoly,n:Int):ZNPNode_ZPP_PartitionedPoly{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_PartitionedPoly):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_PartitionedPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_PartitionedPoly\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_PartitionedPoly{\n return begin().elem();\n }\n public function back():ZPP_PartitionedPoly{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_PartitionedPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_GeomVert{\n public var head:ZNPNode_ZPP_GeomVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_GeomVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_GeomVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_GeomVert):ZPP_GeomVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_GeomVert):ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_TOT++;\n ZNPNode_ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT--;\n ZNPNode_ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_GeomVert,o:ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_GeomVert,o:ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_TOT++;\n ZNPNode_ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT--;\n ZNPNode_ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT++;\n ZNPNode_ZPP_GeomVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_GeomVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_GeomVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_GeomVert):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_GeomVert;\n var ret:ZNPNode_ZPP_GeomVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomVert.zpp_pool;\n ZNPNode_ZPP_GeomVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomVert.POOL_CNT++;\n ZNPNode_ZPP_GeomVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_GeomVert,n:Int):ZNPNode_ZPP_GeomVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_GeomVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_GeomVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_GeomVert{\n return begin().elem();\n }\n public function back():ZPP_GeomVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_GeomVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimpleVert{\n public var head:ZNPNode_ZPP_SimpleVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimpleVert{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimpleVert):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimpleVert):ZPP_SimpleVert{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimpleVert):ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_TOT++;\n ZNPNode_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT--;\n ZNPNode_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimpleVert,o:ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimpleVert,o:ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleVert.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_TOT++;\n ZNPNode_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT--;\n ZNPNode_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleVert\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT++;\n ZNPNode_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimpleVert{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimpleVert):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimpleVert):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimpleVert;\n var ret:ZNPNode_ZPP_SimpleVert;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleVert\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleVert.zpp_pool;\n ZNPNode_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleVert.POOL_CNT++;\n ZNPNode_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimpleVert,n:Int):ZNPNode_ZPP_SimpleVert{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimpleVert):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimpleVert):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleVert\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimpleVert{\n return begin().elem();\n }\n public function back():ZPP_SimpleVert{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimpleVert{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SimpleEvent{\n public var head:ZNPNode_ZPP_SimpleEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SimpleEvent{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SimpleEvent):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SimpleEvent):ZPP_SimpleEvent{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SimpleEvent):ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_TOT++;\n ZNPNode_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT--;\n ZNPNode_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SimpleEvent,o:ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SimpleEvent,o:ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SimpleEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_TOT++;\n ZNPNode_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT--;\n ZNPNode_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleEvent\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT++;\n ZNPNode_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SimpleEvent{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SimpleEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SimpleEvent):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SimpleEvent;\n var ret:ZNPNode_ZPP_SimpleEvent;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SimpleEvent\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SimpleEvent.zpp_pool;\n ZNPNode_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SimpleEvent.POOL_CNT++;\n ZNPNode_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SimpleEvent,n:Int):ZNPNode_ZPP_SimpleEvent{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SimpleEvent):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SimpleEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SimpleEvent\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SimpleEvent{\n return begin().elem();\n }\n public function back():ZPP_SimpleEvent{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SimpleEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Vec2{\n public var head:ZNPNode_ZPP_Vec2=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Vec2{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Vec2):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Vec2):ZPP_Vec2{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Vec2.zpp_pool==null){\n ret=new ZNPNode_ZPP_Vec2();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_TOT++;\n ZNPNode_ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT--;\n ZNPNode_ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Vec2,o:ZPP_Vec2):ZNPNode_ZPP_Vec2{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Vec2,o:ZPP_Vec2):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Vec2.zpp_pool==null){\n ret=new ZNPNode_ZPP_Vec2();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_TOT++;\n ZNPNode_ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT--;\n ZNPNode_ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Vec2\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT++;\n ZNPNode_ZPP_Vec2.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Vec2{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Vec2):ZNPNode_ZPP_Vec2{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Vec2):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Vec2;\n var ret:ZNPNode_ZPP_Vec2;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Vec2\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Vec2.zpp_pool;\n ZNPNode_ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Vec2.POOL_CNT++;\n ZNPNode_ZPP_Vec2.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Vec2,n:Int):ZNPNode_ZPP_Vec2{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Vec2):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Vec2{\n return begin().elem();\n }\n public function back():ZPP_Vec2{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_AABBPair{\n public var head:ZNPNode_ZPP_AABBPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_AABBPair{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_AABBPair):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_AABBPair):ZPP_AABBPair{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_AABBPair):ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_TOT++;\n ZNPNode_ZPP_AABBPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT--;\n ZNPNode_ZPP_AABBPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_AABBPair,o:ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_AABBPair,o:ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBPair.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBPair();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_TOT++;\n ZNPNode_ZPP_AABBPair.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT--;\n ZNPNode_ZPP_AABBPair.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBPair\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT++;\n ZNPNode_ZPP_AABBPair.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_AABBPair{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_AABBPair):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_AABBPair):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_AABBPair;\n var ret:ZNPNode_ZPP_AABBPair;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBPair\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBPair.zpp_pool;\n ZNPNode_ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBPair.POOL_CNT++;\n ZNPNode_ZPP_AABBPair.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_AABBPair,n:Int):ZNPNode_ZPP_AABBPair{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_AABBPair):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_AABBPair):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBPair\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_AABBPair{\n return begin().elem();\n }\n public function back():ZPP_AABBPair{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_AABBPair{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Edge{\n public var head:ZNPNode_ZPP_Edge=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Edge{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Edge):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Edge):ZPP_Edge{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Edge):ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Edge.zpp_pool==null){\n ret=new ZNPNode_ZPP_Edge();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_TOT++;\n ZNPNode_ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT--;\n ZNPNode_ZPP_Edge.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Edge,o:ZPP_Edge):ZNPNode_ZPP_Edge{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Edge,o:ZPP_Edge):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Edge.zpp_pool==null){\n ret=new ZNPNode_ZPP_Edge();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_TOT++;\n ZNPNode_ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT--;\n ZNPNode_ZPP_Edge.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Edge\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT++;\n ZNPNode_ZPP_Edge.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Edge{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Edge):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Edge):ZNPNode_ZPP_Edge{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Edge):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Edge;\n var ret:ZNPNode_ZPP_Edge;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Edge\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Edge.zpp_pool;\n ZNPNode_ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Edge.POOL_CNT++;\n ZNPNode_ZPP_Edge.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Edge,n:Int):ZNPNode_ZPP_Edge{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Edge):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Edge):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Edge\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Edge{\n return begin().elem();\n }\n public function back():ZPP_Edge{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Edge{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_AABBNode{\n public var head:ZNPNode_ZPP_AABBNode=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_AABBNode{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_AABBNode):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_AABBNode):ZPP_AABBNode{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_AABBNode):ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBNode.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBNode();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_TOT++;\n ZNPNode_ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT--;\n ZNPNode_ZPP_AABBNode.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_AABBNode,o:ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_AABBNode,o:ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_AABBNode.zpp_pool==null){\n ret=new ZNPNode_ZPP_AABBNode();\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_TOT++;\n ZNPNode_ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT--;\n ZNPNode_ZPP_AABBNode.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBNode\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT++;\n ZNPNode_ZPP_AABBNode.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_AABBNode{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_AABBNode):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_AABBNode):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_AABBNode;\n var ret:ZNPNode_ZPP_AABBNode;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_AABBNode\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_AABBNode.zpp_pool;\n ZNPNode_ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_AABBNode.POOL_CNT++;\n ZNPNode_ZPP_AABBNode.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_AABBNode,n:Int):ZNPNode_ZPP_AABBNode{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_AABBNode):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_AABBNode):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_AABBNode\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_AABBNode{\n return begin().elem();\n }\n public function back():ZPP_AABBNode{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_AABBNode{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Component{\n public var head:ZNPNode_ZPP_Component=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Component{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Component):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Component):ZPP_Component{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Component):ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Component.zpp_pool==null){\n ret=new ZNPNode_ZPP_Component();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_TOT++;\n ZNPNode_ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT--;\n ZNPNode_ZPP_Component.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Component,o:ZPP_Component):ZNPNode_ZPP_Component{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Component,o:ZPP_Component):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Component.zpp_pool==null){\n ret=new ZNPNode_ZPP_Component();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_TOT++;\n ZNPNode_ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT--;\n ZNPNode_ZPP_Component.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Component\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT++;\n ZNPNode_ZPP_Component.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Component{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Component):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Component):ZNPNode_ZPP_Component{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Component):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Component;\n var ret:ZNPNode_ZPP_Component;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Component\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Component.zpp_pool;\n ZNPNode_ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Component.POOL_CNT++;\n ZNPNode_ZPP_Component.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Component,n:Int):ZNPNode_ZPP_Component{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Component):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Component):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Component\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Component{\n return begin().elem();\n }\n public function back():ZPP_Component{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Component{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_FluidArbiter{\n public var head:ZNPNode_ZPP_FluidArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_FluidArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_FluidArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_FluidArbiter):ZPP_FluidArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_FluidArbiter):ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_TOT++;\n ZNPNode_ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT--;\n ZNPNode_ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_FluidArbiter,o:ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_FluidArbiter,o:ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_FluidArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_TOT++;\n ZNPNode_ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT--;\n ZNPNode_ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_FluidArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT++;\n ZNPNode_ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_FluidArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_FluidArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_FluidArbiter):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_FluidArbiter;\n var ret:ZNPNode_ZPP_FluidArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_FluidArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_FluidArbiter.zpp_pool;\n ZNPNode_ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_FluidArbiter.POOL_CNT++;\n ZNPNode_ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_FluidArbiter,n:Int):ZNPNode_ZPP_FluidArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_FluidArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_FluidArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_FluidArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_FluidArbiter{\n return begin().elem();\n }\n public function back():ZPP_FluidArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_FluidArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_SensorArbiter{\n public var head:ZNPNode_ZPP_SensorArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_SensorArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_SensorArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_SensorArbiter):ZPP_SensorArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_SensorArbiter):ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_TOT++;\n ZNPNode_ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT--;\n ZNPNode_ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_SensorArbiter,o:ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_SensorArbiter,o:ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_SensorArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_TOT++;\n ZNPNode_ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT--;\n ZNPNode_ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SensorArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT++;\n ZNPNode_ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_SensorArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_SensorArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_SensorArbiter):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_SensorArbiter;\n var ret:ZNPNode_ZPP_SensorArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_SensorArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_SensorArbiter.zpp_pool;\n ZNPNode_ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_SensorArbiter.POOL_CNT++;\n ZNPNode_ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_SensorArbiter,n:Int):ZNPNode_ZPP_SensorArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_SensorArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_SensorArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_SensorArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_SensorArbiter{\n return begin().elem();\n }\n public function back():ZPP_SensorArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_SensorArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_Listener{\n public var head:ZNPNode_ZPP_Listener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_Listener{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_Listener):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Listener):ZPP_Listener{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Listener):ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Listener.zpp_pool==null){\n ret=new ZNPNode_ZPP_Listener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_TOT++;\n ZNPNode_ZPP_Listener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT--;\n ZNPNode_ZPP_Listener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_Listener,o:ZPP_Listener):ZNPNode_ZPP_Listener{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_Listener,o:ZPP_Listener):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_Listener.zpp_pool==null){\n ret=new ZNPNode_ZPP_Listener();\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_TOT++;\n ZNPNode_ZPP_Listener.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT--;\n ZNPNode_ZPP_Listener.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Listener\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT++;\n ZNPNode_ZPP_Listener.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Listener{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Listener):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_Listener):ZNPNode_ZPP_Listener{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_Listener):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_Listener;\n var ret:ZNPNode_ZPP_Listener;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_Listener\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_Listener.zpp_pool;\n ZNPNode_ZPP_Listener.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_Listener.POOL_CNT++;\n ZNPNode_ZPP_Listener.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_Listener,n:Int):ZNPNode_ZPP_Listener{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Listener):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Listener):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Listener\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Listener{\n return begin().elem();\n }\n public function back():ZPP_Listener{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Listener{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ColArbiter{\n public var head:ZNPNode_ZPP_ColArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ColArbiter{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ColArbiter):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ColArbiter):ZPP_ColArbiter{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ColArbiter):ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ColArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_TOT++;\n ZNPNode_ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT--;\n ZNPNode_ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ColArbiter,o:ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ColArbiter,o:ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ColArbiter.zpp_pool==null){\n ret=new ZNPNode_ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_TOT++;\n ZNPNode_ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT--;\n ZNPNode_ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ColArbiter\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT++;\n ZNPNode_ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ColArbiter{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ColArbiter):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ColArbiter):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ColArbiter;\n var ret:ZNPNode_ZPP_ColArbiter;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ColArbiter\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ColArbiter.zpp_pool;\n ZNPNode_ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ColArbiter.POOL_CNT++;\n ZNPNode_ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ColArbiter,n:Int):ZNPNode_ZPP_ColArbiter{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ColArbiter):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ColArbiter):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ColArbiter\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ColArbiter{\n return begin().elem();\n }\n public function back():ZPP_ColArbiter{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ColArbiter{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_InteractionGroup{\n public var head:ZNPNode_ZPP_InteractionGroup=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_InteractionGroup{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_InteractionGroup):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_InteractionGroup):ZPP_InteractionGroup{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_InteractionGroup):ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionGroup.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionGroup();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_TOT++;\n ZNPNode_ZPP_InteractionGroup.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT--;\n ZNPNode_ZPP_InteractionGroup.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_InteractionGroup,o:ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_InteractionGroup,o:ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_InteractionGroup.zpp_pool==null){\n ret=new ZNPNode_ZPP_InteractionGroup();\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_TOT++;\n ZNPNode_ZPP_InteractionGroup.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT--;\n ZNPNode_ZPP_InteractionGroup.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionGroup\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT++;\n ZNPNode_ZPP_InteractionGroup.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_InteractionGroup{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_InteractionGroup):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_InteractionGroup):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_InteractionGroup;\n var ret:ZNPNode_ZPP_InteractionGroup;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_InteractionGroup\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_InteractionGroup.zpp_pool;\n ZNPNode_ZPP_InteractionGroup.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_InteractionGroup.POOL_CNT++;\n ZNPNode_ZPP_InteractionGroup.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_InteractionGroup,n:Int):ZNPNode_ZPP_InteractionGroup{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_InteractionGroup):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_InteractionGroup):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_InteractionGroup\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_InteractionGroup{\n return begin().elem();\n }\n public function back():ZPP_InteractionGroup{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_InteractionGroup{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_ToiEvent{\n public var head:ZNPNode_ZPP_ToiEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_ToiEvent{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_ToiEvent):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_ToiEvent):ZPP_ToiEvent{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_ToiEvent):ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ToiEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_TOT++;\n ZNPNode_ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT--;\n ZNPNode_ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_ToiEvent,o:ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_ToiEvent,o:ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_ToiEvent.zpp_pool==null){\n ret=new ZNPNode_ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_TOT++;\n ZNPNode_ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT--;\n ZNPNode_ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ToiEvent\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT++;\n ZNPNode_ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_ToiEvent{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_ToiEvent):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_ToiEvent):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_ToiEvent;\n var ret:ZNPNode_ZPP_ToiEvent;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_ToiEvent\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_ToiEvent.zpp_pool;\n ZNPNode_ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_ToiEvent.POOL_CNT++;\n ZNPNode_ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_ToiEvent,n:Int):ZNPNode_ZPP_ToiEvent{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_ToiEvent):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_ToiEvent):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_ToiEvent\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_ToiEvent{\n return begin().elem();\n }\n public function back():ZPP_ToiEvent{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_ToiEvent{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ConvexResult{\n public var head:ZNPNode_ConvexResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ConvexResult{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ConvexResult):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ConvexResult):ConvexResult{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ConvexResult):ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ConvexResult.zpp_pool==null){\n ret=new ZNPNode_ConvexResult();\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_TOT++;\n ZNPNode_ConvexResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT--;\n ZNPNode_ConvexResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ConvexResult,o:ConvexResult):ZNPNode_ConvexResult{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ConvexResult,o:ConvexResult):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ConvexResult.zpp_pool==null){\n ret=new ZNPNode_ConvexResult();\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_TOT++;\n ZNPNode_ConvexResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT--;\n ZNPNode_ConvexResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ConvexResult\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT++;\n ZNPNode_ConvexResult.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ConvexResult{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ConvexResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ConvexResult):ZNPNode_ConvexResult{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ConvexResult):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ConvexResult;\n var ret:ZNPNode_ConvexResult;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ConvexResult\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ConvexResult.zpp_pool;\n ZNPNode_ConvexResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ConvexResult.POOL_CNT++;\n ZNPNode_ConvexResult.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ConvexResult,n:Int):ZNPNode_ConvexResult{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ConvexResult):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ConvexResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ConvexResult\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ConvexResult{\n return begin().elem();\n }\n public function back():ConvexResult{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ConvexResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_ZPP_GeomPoly{\n public var head:ZNPNode_ZPP_GeomPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_ZPP_GeomPoly{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_ZPP_GeomPoly):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_GeomPoly):ZPP_GeomPoly{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_GeomPoly):ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_TOT++;\n ZNPNode_ZPP_GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT--;\n ZNPNode_ZPP_GeomPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_ZPP_GeomPoly,o:ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_ZPP_GeomPoly,o:ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_ZPP_GeomPoly.zpp_pool==null){\n ret=new ZNPNode_ZPP_GeomPoly();\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_TOT++;\n ZNPNode_ZPP_GeomPoly.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT--;\n ZNPNode_ZPP_GeomPoly.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomPoly\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT++;\n ZNPNode_ZPP_GeomPoly.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_GeomPoly{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_GeomPoly):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_ZPP_GeomPoly):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_ZPP_GeomPoly;\n var ret:ZNPNode_ZPP_GeomPoly;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_ZPP_GeomPoly\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_ZPP_GeomPoly.zpp_pool;\n ZNPNode_ZPP_GeomPoly.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_ZPP_GeomPoly.POOL_CNT++;\n ZNPNode_ZPP_GeomPoly.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_ZPP_GeomPoly,n:Int):ZNPNode_ZPP_GeomPoly{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_GeomPoly):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_GeomPoly):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_GeomPoly\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_GeomPoly{\n return begin().elem();\n }\n public function back():ZPP_GeomPoly{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_GeomPoly{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPList_RayResult{\n public var head:ZNPNode_RayResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZNPNode_RayResult{\n return head;\n }\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZNPNode_RayResult):Void{\n head=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:RayResult):RayResult{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:RayResult):RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_RayResult.zpp_pool==null){\n ret=new ZNPNode_RayResult();\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_TOT++;\n ZNPNode_RayResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT--;\n ZNPNode_RayResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n temp.next=begin();\n head=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZNPList_RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZNPNode_RayResult,o:RayResult):ZNPNode_RayResult{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZNPNode_RayResult,o:RayResult):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n var ret;\n {\n if(ZNPNode_RayResult.zpp_pool==null){\n ret=new ZNPNode_RayResult();\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_TOT++;\n ZNPNode_RayResult.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT--;\n ZNPNode_RayResult.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.elt=o;\n ret;\n };\n if(cur==null){\n temp.next=begin();\n head=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] pop\");\n #end\n };\n var ret=begin();\n head=ret.next;\n {};\n {\n var o=ret;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_RayResult\"+\", in obj: \"+\"ret\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT++;\n ZNPNode_RayResult.POOL_SUB++;\n #end\n };\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():RayResult{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:RayResult):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZNPNode_RayResult):ZNPNode_RayResult{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZNPNode_RayResult):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZNPNode_RayResult;\n var ret:ZNPNode_RayResult;\n if(pre==null){\n old=begin();\n ret=old.next;\n head=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {};\n {\n var o=old;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZNPNode_RayResult\"+\", in obj: \"+\"old\"+\")\");\n #end\n };\n o.free();\n o.next=ZNPNode_RayResult.zpp_pool;\n ZNPNode_RayResult.zpp_pool=o;\n #if NAPE_POOL_STATS ZNPNode_RayResult.POOL_CNT++;\n ZNPNode_RayResult.POOL_SUB++;\n #end\n };\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZNPNode_RayResult,n:Int):ZNPNode_RayResult{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(true){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n head=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:RayResult):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:RayResult):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"RayResult\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():RayResult{\n return begin().elem();\n }\n public function back():RayResult{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZNPNode_RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):RayResult{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbType{\n static public var zpp_pool:ZNPNode_ZPP_CbType=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbType=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbType=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbType{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CallbackSet{\n static public var zpp_pool:ZNPNode_ZPP_CallbackSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CallbackSet=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CallbackSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CallbackSet{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Shape{\n static public var zpp_pool:ZNPNode_ZPP_Shape=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Shape=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Shape=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Shape{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Body{\n static public var zpp_pool:ZNPNode_ZPP_Body=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Body=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Body=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Body{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Constraint{\n static public var zpp_pool:ZNPNode_ZPP_Constraint=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Constraint=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Constraint=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Constraint{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Compound{\n static public var zpp_pool:ZNPNode_ZPP_Compound=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Compound=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Compound=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Compound{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Arbiter{\n static public var zpp_pool:ZNPNode_ZPP_Arbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Arbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Arbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Arbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_InteractionListener{\n static public var zpp_pool:ZNPNode_ZPP_InteractionListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_InteractionListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_InteractionListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_InteractionListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbSet{\n static public var zpp_pool:ZNPNode_ZPP_CbSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbSet=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbSet=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbSet{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Interactor{\n static public var zpp_pool:ZNPNode_ZPP_Interactor=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Interactor=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Interactor=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Interactor{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_BodyListener{\n static public var zpp_pool:ZNPNode_ZPP_BodyListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_BodyListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_BodyListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_BodyListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CbSetPair{\n static public var zpp_pool:ZNPNode_ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CbSetPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CbSetPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CbSetPair{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ConstraintListener{\n static public var zpp_pool:ZNPNode_ZPP_ConstraintListener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ConstraintListener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ConstraintListener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ConstraintListener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CutInt{\n static public var zpp_pool:ZNPNode_ZPP_CutInt=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CutInt=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CutInt=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CutInt{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_CutVert{\n static public var zpp_pool:ZNPNode_ZPP_CutVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_CutVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_CutVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_CutVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_PartitionVertex{\n static public var zpp_pool:ZNPNode_ZPP_PartitionVertex=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_PartitionVertex=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_PartitionVertex=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_PartitionVertex{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimplifyP{\n static public var zpp_pool:ZNPNode_ZPP_SimplifyP=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimplifyP=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimplifyP=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimplifyP{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_PartitionedPoly{\n static public var zpp_pool:ZNPNode_ZPP_PartitionedPoly=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_PartitionedPoly=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_PartitionedPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_PartitionedPoly{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_GeomVert{\n static public var zpp_pool:ZNPNode_ZPP_GeomVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_GeomVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_GeomVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_GeomVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimpleVert{\n static public var zpp_pool:ZNPNode_ZPP_SimpleVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimpleVert=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimpleVert=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimpleVert{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SimpleEvent{\n static public var zpp_pool:ZNPNode_ZPP_SimpleEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SimpleEvent=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SimpleEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SimpleEvent{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Vec2{\n static public var zpp_pool:ZNPNode_ZPP_Vec2=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Vec2=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Vec2{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_AABBPair{\n static public var zpp_pool:ZNPNode_ZPP_AABBPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_AABBPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_AABBPair=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_AABBPair{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Edge{\n static public var zpp_pool:ZNPNode_ZPP_Edge=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Edge=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Edge=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Edge{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_AABBNode{\n static public var zpp_pool:ZNPNode_ZPP_AABBNode=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_AABBNode=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_AABBNode=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_AABBNode{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Component{\n static public var zpp_pool:ZNPNode_ZPP_Component=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Component=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Component=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Component{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_FluidArbiter{\n static public var zpp_pool:ZNPNode_ZPP_FluidArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_FluidArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_FluidArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_FluidArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_SensorArbiter{\n static public var zpp_pool:ZNPNode_ZPP_SensorArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_SensorArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_SensorArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_SensorArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_Listener{\n static public var zpp_pool:ZNPNode_ZPP_Listener=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_Listener=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_Listener=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Listener{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ColArbiter{\n static public var zpp_pool:ZNPNode_ZPP_ColArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ColArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ColArbiter=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ColArbiter{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_InteractionGroup{\n static public var zpp_pool:ZNPNode_ZPP_InteractionGroup=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_InteractionGroup=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_InteractionGroup=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_InteractionGroup{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_ToiEvent{\n static public var zpp_pool:ZNPNode_ZPP_ToiEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_ToiEvent=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_ToiEvent=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_ToiEvent{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ConvexResult{\n static public var zpp_pool:ZNPNode_ConvexResult=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ConvexResult=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ConvexResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ConvexResult{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_ZPP_GeomPoly{\n static public var zpp_pool:ZNPNode_ZPP_GeomPoly=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_ZPP_GeomPoly=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:ZPP_GeomPoly=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_GeomPoly{\n return elt;\n }\n}\n#if nape_swc@:keep #end\nclass ZNPNode_RayResult{\n static public var zpp_pool:ZNPNode_RayResult=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZNPNode_RayResult=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n elt=null;\n }\n public var elt:RayResult=null;\n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():RayResult{\n return elt;\n }\n}\n\n#if nape_swc@:keep #end\nclass ZPP_MixVec2List extends Vec2List{\n public var inner:ZPP_Vec2=null;\n public var _length:Int=0;\n public var zip_length:Bool=false;\n public var at_ite:ZPP_Vec2=null;\n public var at_index:Int=0;\n public static function get(list:ZPP_Vec2,immutable=false):ZPP_MixVec2List{\n var ret=new ZPP_MixVec2List();\n ret.inner=list;\n ret.zpp_inner.immutable=immutable;\n return ret;\n }\n public function new(){\n super();\n at_ite=null;\n at_index=0;\n zip_length=true;\n _length=0;\n }\n public override function zpp_gl():Int{\n zpp_vm();\n if(zip_length){\n _length=0;\n {\n var cx_ite=inner.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n if(true)_length++;\n cx_ite=cx_ite.next;\n }\n };\n zip_length=false;\n }\n return _length;\n }\n public override function zpp_vm():Void{\n zpp_inner.validate();\n if(inner.modified){\n zip_length=true;\n _length=0;\n at_ite=null;\n }\n }\n #if nape_swc@:keep #end\n public override function at(index:Int):Vec2{\n zpp_vm();\n #if(!NAPE_RELEASE_BUILD)\n if(index<0||index>=length)throw \"Error: Index out of bounds\";\n #end\n if(zpp_inner.reverse_flag)index=length-1-index;\n if(indexVoid=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Constraint->Bool=null;\n public var post_adder:Constraint->Void=null;\n public var subber:Constraint->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Constraint,imm:Bool=false):ConstraintList{\n var ret=new ConstraintList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Constraint=null;\n public var push_ite:ZNPNode_ZPP_Constraint=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Constraint();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_BodyList{\n public var outer:BodyList=null;\n public var inner:ZNPList_ZPP_Body=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_BodyList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Body->Bool=null;\n public var post_adder:Body->Void=null;\n public var subber:Body->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Body,imm:Bool=false):BodyList{\n var ret=new BodyList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Body=null;\n public var push_ite:ZNPNode_ZPP_Body=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Body();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractorList{\n public var outer:InteractorList=null;\n public var inner:ZNPList_ZPP_Interactor=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_InteractorList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Interactor->Bool=null;\n public var post_adder:Interactor->Void=null;\n public var subber:Interactor->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Interactor,imm:Bool=false):InteractorList{\n var ret=new InteractorList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Interactor=null;\n public var push_ite:ZNPNode_ZPP_Interactor=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Interactor();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CompoundList{\n public var outer:CompoundList=null;\n public var inner:ZNPList_ZPP_Compound=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_CompoundList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Compound->Bool=null;\n public var post_adder:Compound->Void=null;\n public var subber:Compound->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Compound,imm:Bool=false):CompoundList{\n var ret=new CompoundList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Compound=null;\n public var push_ite:ZNPNode_ZPP_Compound=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Compound();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ListenerList{\n public var outer:ListenerList=null;\n public var inner:ZNPList_ZPP_Listener=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ListenerList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Listener->Bool=null;\n public var post_adder:Listener->Void=null;\n public var subber:Listener->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Listener,imm:Bool=false):ListenerList{\n var ret=new ListenerList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Listener=null;\n public var push_ite:ZNPNode_ZPP_Listener=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Listener();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CbTypeList{\n public var outer:CbTypeList=null;\n public var inner:ZNPList_ZPP_CbType=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_CbTypeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:CbType->Bool=null;\n public var post_adder:CbType->Void=null;\n public var subber:CbType->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_CbType,imm:Bool=false):CbTypeList{\n var ret=new CbTypeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_CbType=null;\n public var push_ite:ZNPNode_ZPP_CbType=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_CbType();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Vec2List{\n public var outer:Vec2List=null;\n public var inner:ZNPList_ZPP_Vec2=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_Vec2List->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Vec2->Bool=null;\n public var post_adder:Vec2->Void=null;\n public var subber:Vec2->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Vec2,imm:Bool=false):Vec2List{\n var ret=new Vec2List();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Vec2=null;\n public var push_ite:ZNPNode_ZPP_Vec2=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Vec2();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomPolyList{\n public var outer:GeomPolyList=null;\n public var inner:ZNPList_ZPP_GeomPoly=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_GeomPolyList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:GeomPoly->Bool=null;\n public var post_adder:GeomPoly->Void=null;\n public var subber:GeomPoly->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_GeomPoly,imm:Bool=false):GeomPolyList{\n var ret=new GeomPolyList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_GeomPoly=null;\n public var push_ite:ZNPNode_ZPP_GeomPoly=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_GeomPoly();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_RayResultList{\n public var outer:RayResultList=null;\n public var inner:ZNPList_RayResult=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_RayResultList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:RayResult->Bool=null;\n public var post_adder:RayResult->Void=null;\n public var subber:RayResult->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_RayResult,imm:Bool=false):RayResultList{\n var ret=new RayResultList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_RayResult=null;\n public var push_ite:ZNPNode_RayResult=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_RayResult();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ConvexResultList{\n public var outer:ConvexResultList=null;\n public var inner:ZNPList_ConvexResult=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ConvexResultList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:ConvexResult->Bool=null;\n public var post_adder:ConvexResult->Void=null;\n public var subber:ConvexResult->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ConvexResult,imm:Bool=false):ConvexResultList{\n var ret=new ConvexResultList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ConvexResult=null;\n public var push_ite:ZNPNode_ConvexResult=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ConvexResult();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_EdgeList{\n public var outer:EdgeList=null;\n public var inner:ZNPList_ZPP_Edge=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_EdgeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Edge->Bool=null;\n public var post_adder:Edge->Void=null;\n public var subber:Edge->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Edge,imm:Bool=false):EdgeList{\n var ret=new EdgeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Edge=null;\n public var push_ite:ZNPNode_ZPP_Edge=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Edge();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ShapeList{\n public var outer:ShapeList=null;\n public var inner:ZNPList_ZPP_Shape=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ShapeList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Shape->Bool=null;\n public var post_adder:Shape->Void=null;\n public var subber:Shape->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Shape,imm:Bool=false):ShapeList{\n var ret=new ShapeList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Shape=null;\n public var push_ite:ZNPNode_ZPP_Shape=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Shape();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractionGroupList{\n public var outer:InteractionGroupList=null;\n public var inner:ZNPList_ZPP_InteractionGroup=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_InteractionGroupList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:InteractionGroup->Bool=null;\n public var post_adder:InteractionGroup->Void=null;\n public var subber:InteractionGroup->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_InteractionGroup,imm:Bool=false):InteractionGroupList{\n var ret=new InteractionGroupList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_InteractionGroup=null;\n public var push_ite:ZNPNode_ZPP_InteractionGroup=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_InteractionGroup();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ArbiterList{\n public var outer:ArbiterList=null;\n public var inner:ZNPList_ZPP_Arbiter=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ArbiterList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Arbiter->Bool=null;\n public var post_adder:Arbiter->Void=null;\n public var subber:Arbiter->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZNPList_ZPP_Arbiter,imm:Bool=false):ArbiterList{\n var ret=new ArbiterList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZNPNode_ZPP_Arbiter=null;\n public var push_ite:ZNPNode_ZPP_Arbiter=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZNPList_ZPP_Arbiter();\n _invalidated=true;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ContactList{\n public var outer:ContactList=null;\n public var inner:ZPP_Contact=null;\n public var immutable:Bool=false;\n public var _invalidated:Bool=false;\n public var _invalidate:ZPP_ContactList->Void=null;\n public var _validate:Void->Void=null;\n public var _modifiable:Void->Void=null;\n public static var internal:Bool=false;\n public var adder:Contact->Bool=null;\n public var post_adder:Contact->Void=null;\n public var subber:Contact->Void=null;\n public var dontremove:Bool=false;\n public var reverse_flag:Bool=false;\n public static function get(list:ZPP_Contact,imm:Bool=false):ContactList{\n var ret=new ContactList();\n ret.zpp_inner.inner=list;\n if(imm)ret.zpp_inner.immutable=true;\n ret.zpp_inner.zip_length=true;\n return ret;\n }\n public function valmod():Void{\n validate();\n if(inner.modified){\n if(inner.pushmod)push_ite=null;\n at_ite=null;\n inner.modified=false;\n inner.pushmod=false;\n zip_length=true;\n }\n }\n public function modified():Void{\n zip_length=true;\n at_ite=null;\n push_ite=null;\n }\n public function modify_test():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_modifiable!=null)_modifiable();\n #end\n }\n public function validate():Void{\n if(_invalidated){\n _invalidated=false;\n if(_validate!=null)_validate();\n }\n }\n public function invalidate():Void{\n _invalidated=true;\n if(_invalidate!=null)_invalidate(this);\n }\n public var at_index:Int=0;\n public var at_ite:ZPP_Contact=null;\n public var push_ite:ZPP_Contact=null;\n public var zip_length:Bool=false;\n public var user_length:Int=0;\n public function new(){\n inner=new ZPP_Contact();\n _invalidated=true;\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_CbType{\n public var outer:CbType=null;\n public var userData:Dynamic=null;\n public var id:Int=0;\n public var cbsets:ZNPList_ZPP_CbSet=null;\n public#if NAPE_NO_INLINE#else inline #end\n static function setlt(a:ZPP_CbType,b:ZPP_CbType):Bool{\n return a.id=[ListenerType.BODY,ListenerType.CONSTRAINT,ListenerType.INTERACTION,ListenerType.PRE];\n public static var events:Array=[CbEvent.BEGIN,CbEvent.END,CbEvent.WAKE,CbEvent.SLEEP,CbEvent.BREAK,CbEvent.PRE,CbEvent.ONGOING];\n public var precedence:Int=0;\n public var body:Null=null;\n public var constraint:Null=null;\n public var interaction:Null=null;\n public var space:Null=null;\n function new(){\n id=ZPP_ID.Listener();\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function setlt(a:ZPP_Listener,b:ZPP_Listener):Bool{\n return(a.precedence>b.precedence)||(a.precedence==b.precedence&&a.id>b.id);\n }\n public function swapEvent(event:Int):Void{}\n public function invalidate_precedence():Void{}\n public function addedToSpace():Void{}\n public function removedFromSpace():Void{}\n}\n#if nape_swc@:keep #end\nclass ZPP_BodyListener extends ZPP_Listener{\n public var outer_zn:BodyListener=null;\n public var options:ZPP_OptionType=null;\n public var handler:BodyCallback->Void=null;\n #if(!NAPE_RELEASE_BUILD)\n function immutable_options(){\n if(space!=null&&space.midstep){\n throw \"Error: Cannot change listener type options during space.step()\";\n }\n }\n #end\n public function new(options:OptionType,event:Int,handler:BodyCallback->Void){\n super();\n this.event=event;\n this.handler=handler;\n body=this;\n type=ZPP_Flags.id_ListenerType_BODY;\n this.options=options.zpp_inner;\n }\n public override function addedToSpace():Void{\n options.handler=cbtype_change;\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.addbody(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public override function removedFromSpace():Void{\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.removebody(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n options.handler=null;\n }\n function cbtype_change(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n }\n public override function invalidate_precedence():Void{\n if(space!=null){\n removedFromSpace();\n addedToSpace();\n }\n }\n public override function swapEvent(newev:Int):Void{\n #if(!NAPE_RELEASE_BUILD)\n if(newev!=ZPP_Flags.id_CbEvent_WAKE&&newev!=ZPP_Flags.id_CbEvent_SLEEP){\n throw \"Error: BodyListener event must be either WAKE or SLEEP only\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ConstraintListener extends ZPP_Listener{\n public var outer_zn:ConstraintListener=null;\n public var options:ZPP_OptionType=null;\n public var handler:ConstraintCallback->Void=null;\n #if(!NAPE_RELEASE_BUILD)\n function immutable_options(){\n if(space!=null&&space.midstep){\n throw \"Error: Cannot change listener type options during space.step()\";\n }\n }\n #end\n public function new(options:OptionType,event:Int,handler:ConstraintCallback->Void){\n super();\n this.event=event;\n this.handler=handler;\n constraint=this;\n type=ZPP_Flags.id_ListenerType_CONSTRAINT;\n this.options=options.zpp_inner;\n }\n public override function addedToSpace():Void{\n options.handler=cbtype_change;\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.addconstraint(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public override function removedFromSpace():Void{\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n {\n cb.removeconstraint(this);\n };\n cx_ite=cx_ite.next;\n }\n };\n options.handler=null;\n }\n function cbtype_change(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n }\n public override function invalidate_precedence():Void{\n if(space!=null){\n removedFromSpace();\n addedToSpace();\n }\n }\n public override function swapEvent(newev:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(newev!=ZPP_Flags.id_CbEvent_WAKE&&newev!=ZPP_Flags.id_CbEvent_SLEEP&&newev!=ZPP_Flags.id_CbEvent_BREAK){\n throw \"Error: ConstraintListener event must be either WAKE or SLEEP only\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_InteractionListener extends ZPP_Listener{\n public var outer_zni:Null=null;\n public var outer_znp:Null=null;\n public var itype:Int=0;\n public var options1:ZPP_OptionType=null;\n public var options2:ZPP_OptionType=null;\n public var handleri:NullVoid>=null;\n public var allowSleepingCallbacks:Bool=false;\n public var pure:Bool=false;\n public var handlerp:NullNull>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setInteractionType(itype:Int){\n this.itype=itype;\n }\n public function new(options1:OptionType,options2:OptionType,event:Int,type:Int){\n super();\n this.type=type;\n interaction=this;\n this.event=event;\n this.options1=options1.zpp_inner;\n this.options2=options2.zpp_inner;\n allowSleepingCallbacks=false;\n }\n public function wake(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n type==ZPP_Flags.id_ListenerType_PRE;\n };\n if(!res)throw \"assert(\"+\"type==ZPP_Flags.id_ListenerType_PRE\"+\") :: \"+(\"waking non-pre?\");\n #end\n };\n with_union(function(cb:ZPP_CbType):Void{\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n i.wake();\n };\n cx_ite=cx_ite.next;\n }\n };\n });\n }\n \n static var UCbSet=new ZNPList_ZPP_CbSet();\n static var VCbSet=new ZNPList_ZPP_CbSet();\n static var WCbSet=new ZNPList_ZPP_CbSet();\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function CbSetset(A:ZNPList_ZPP_CbSet,B:ZNPList_ZPP_CbSet,lambda:ZPP_CbSet->ZPP_CbSet->Void):Void{\n var U=UCbSet;\n var V=VCbSet;\n var W=WCbSet;\n var aite=A.begin();\n var bite=B.begin();\n while(aite!=null&&bite!=null){\n var a=aite.elem();\n var b=bite.elem();\n if(a==b){\n W.inlined_add(a);\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_CbSet.setlt(a,b)){\n U.inlined_add(a);\n aite=aite.next;\n }\n else{\n V.inlined_add(b);\n bite=bite.next;\n }\n }\n while(aite!=null){\n U.inlined_add(aite.elem());\n aite=aite.next;\n }\n while(bite!=null){\n V.inlined_add(bite.elem());\n bite=bite.next;\n }\n {\n while(!U.empty()){\n var x=U.pop_unsafe();\n {\n var cx_ite=B.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!V.empty()){\n var x=V.pop_unsafe();\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!W.empty()){\n var x=W.pop_unsafe();\n {\n lambda(x,x);\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n };\n }\n static var UCbType=new ZNPList_ZPP_CbType();\n static var VCbType=new ZNPList_ZPP_CbType();\n static var WCbType=new ZNPList_ZPP_CbType();\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function CbTypeset(A:ZNPList_ZPP_CbType,B:ZNPList_ZPP_CbType,lambda:ZPP_CbType->ZPP_CbType->Void):Void{\n var U=UCbType;\n var V=VCbType;\n var W=WCbType;\n var aite=A.begin();\n var bite=B.begin();\n while(aite!=null&&bite!=null){\n var a=aite.elem();\n var b=bite.elem();\n if(a==b){\n W.inlined_add(a);\n aite=aite.next;\n bite=bite.next;\n }\n else if(ZPP_CbType.setlt(a,b)){\n U.inlined_add(a);\n aite=aite.next;\n }\n else{\n V.inlined_add(b);\n bite=bite.next;\n }\n }\n while(aite!=null){\n U.inlined_add(aite.elem());\n aite=aite.next;\n }\n while(bite!=null){\n V.inlined_add(bite.elem());\n bite=bite.next;\n }\n {\n while(!U.empty()){\n var x=U.pop_unsafe();\n {\n var cx_ite=B.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!V.empty()){\n var x=V.pop_unsafe();\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n }\n };\n {\n while(!W.empty()){\n var x=W.pop_unsafe();\n {\n lambda(x,x);\n {\n var cx_ite=W.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n lambda(x,y);\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n };\n }\n function with_uniquesets(fresh:Bool){\n var set;\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n set=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n set=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=set.next;\n set.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n set.alloc();\n };\n set.lt=ZPP_CbSetPair.setlt;\n CbTypeset(options1.includes,options2.includes,function(a:ZPP_CbType,b:ZPP_CbType):Void{\n CbSetset(a.cbsets,b.cbsets,function(a:ZPP_CbSet,b:ZPP_CbSet):Void{\n a.validate();\n b.validate();\n if(ZPP_CbSet.single_intersection(a,b,this)){\n set.try_insert(ZPP_CbSetPair.get(a,b));\n }\n });\n });\n set.clear_with(function(pair:ZPP_CbSetPair):Void{\n if(fresh)space.freshListenerType(pair.a,pair.b);\n else space.nullListenerType(pair.a,pair.b);\n {\n var o=pair;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSetPair\"+\", in obj: \"+\"pair\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT++;\n ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n });\n {\n var o=set;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"set\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n #if NAPE_NO_INLINE#else inline #end\n function with_union(lambda:ZPP_CbType->Void):Void{\n var ite1=options1.includes.begin();\n var ite2=options2.includes.begin();\n while(ite1!=null&&ite2!=null){\n var cb1=ite1.elem();\n var cb2=ite2.elem();\n if(cb1==cb2){\n lambda(cb1);\n ite1=ite1.next;\n ite2=ite2.next;\n }\n else if(ZPP_CbType.setlt(cb1,cb2)){\n lambda(cb1);\n ite1=ite1.next;\n }\n else{\n lambda(cb2);\n ite2=ite2.next;\n }\n }\n while(ite1!=null){\n lambda(ite1.elem());\n ite1=ite1.next;\n }\n while(ite2!=null){\n lambda(ite2.elem());\n ite2=ite2.next;\n }\n }\n public override function addedToSpace():Void{\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.addint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n options1.handler=cbtype_change1;\n options2.handler=cbtype_change2;\n with_uniquesets(true);\n }\n public override function removedFromSpace():Void{\n with_uniquesets(false);\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.removeint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n options1.handler=null;\n options2.handler=null;\n }\n public override function invalidate_precedence(){\n if(space!=null){\n var pre=type==ZPP_Flags.id_ListenerType_PRE;\n with_union(function(cb:ZPP_CbType):Void{\n cb.removeint(this);\n cb.addint(this);\n if(pre){\n {\n var cx_ite=cb.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n i.wake();\n cx_ite=cx_ite.next;\n }\n };\n }\n });\n }\n }\n function cbtype_change1(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n cbtype_change(options1,cb,included,added);\n }\n function cbtype_change2(cb:ZPP_CbType,included:Bool,added:Bool):Void{\n cbtype_change(options2,cb,included,added);\n }\n function cbtype_change(options:ZPP_OptionType,cb:ZPP_CbType,included:Bool,added:Bool):Void{\n space.revoke_listener(this);\n removedFromSpace();\n options.effect_change(cb,included,added);\n addedToSpace();\n space.unrevoke_listener(this);\n }\n public override function swapEvent(newev:Int){\n #if(!NAPE_RELEASE_BUILD)\n if(type==ZPP_Flags.id_ListenerType_PRE){\n throw \"Error: PreListener event can only be PRE\";\n }\n else if(newev!=ZPP_Flags.id_CbEvent_BEGIN&&newev!=ZPP_Flags.id_CbEvent_END&&newev!=ZPP_Flags.id_CbEvent_ONGOING){\n throw \"Error: InteractionListener event must be either BEGIN, END, ONGOING\";\n }\n #end\n removedFromSpace();\n event=newev;\n addedToSpace();\n }\n}\n","package zpp_nape.callbacks;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_OptionType{\n public var outer:OptionType=null;\n public var handler:NullBool->Bool->Void>=null;\n public var includes:ZNPList_ZPP_CbType=null;\n public var excludes:ZNPList_ZPP_CbType=null;\n public function new(){\n includes=new ZNPList_ZPP_CbType();\n excludes=new ZNPList_ZPP_CbType();\n }\n public var wrap_includes:CbTypeList=null;\n public var wrap_excludes:CbTypeList=null;\n public function setup_includes():Void{\n wrap_includes=ZPP_CbTypeList.get(includes,true);\n }\n public function setup_excludes():Void{\n wrap_excludes=ZPP_CbTypeList.get(excludes,true);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function excluded(xs:ZNPList_ZPP_CbType):Bool{\n return nonemptyintersection(xs,excludes);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function included(xs:ZNPList_ZPP_CbType):Bool{\n return nonemptyintersection(xs,includes);\n }\n public#if NAPE_NO_INLINE#else inline #end\n function compatible(xs:ZNPList_ZPP_CbType):Bool{\n return included(xs)&&!excluded(xs);\n }\n public function nonemptyintersection(xs:ZNPList_ZPP_CbType,ys:ZNPList_ZPP_CbType):Bool{\n var ret=false;\n var xite=xs.begin();\n var eite=ys.begin();\n while(eite!=null&&xite!=null){\n var ex=eite.elem();\n var xi=xite.elem();\n if(ex==xi){\n ret=true;\n break;\n }\n else if(ZPP_CbType.setlt(ex,xi)){\n eite=eite.next;\n }\n else{\n xite=xite.next;\n }\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function effect_change(val:ZPP_CbType,included:Bool,added:Bool):Void{\n if(included){\n if(added){\n var pre=null;\n {\n var cx_ite=includes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(val,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n includes.inlined_insert(pre,val);\n };\n else includes.remove(val);\n }\n else{\n if(added){\n var pre=null;\n {\n var cx_ite=excludes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(val,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n excludes.inlined_insert(pre,val);\n };\n else excludes.remove(val);\n }\n }\n function append_type(list:ZNPList_ZPP_CbType,val:ZPP_CbType){\n if(list==includes){\n if(!includes.has(val)){\n if(!excludes.has(val)){\n if(handler!=null)handler(val,true,true);\n else effect_change(val,true,true);\n }\n else{\n if(handler!=null)handler(val,false,false);\n else effect_change(val,false,false);\n }\n }\n }\n else{\n if(!excludes.has(val)){\n if(!includes.has(val)){\n if(handler!=null)handler(val,false,true);\n else effect_change(val,false,true);\n }\n else{\n if(handler!=null)handler(val,true,false);\n else effect_change(val,true,false);\n }\n }\n }\n }\n public function set(options:ZPP_OptionType){\n if(options!=this){\n while(!includes.empty())append_type(excludes,includes.front());\n while(!excludes.empty())append_type(includes,excludes.front());\n {\n var cx_ite=options.excludes.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n append_type(excludes,i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=options.includes.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n append_type(includes,i);\n cx_ite=cx_ite.next;\n }\n };\n }\n return this;\n }\n public function append(list:ZNPList_ZPP_CbType,val:Dynamic){\n #if(!NAPE_RELEASE_BUILD)\n if(val==null){\n throw \"Error: Cannot append null, only CbType and CbType list values\";\n }\n #end\n if(#if flash untyped __is__(val,CbType)#else Std.is(val,CbType)#end){\n var cb:CbType=val;\n append_type(list,cb.zpp_inner);\n }\n else if(#if flash untyped __is__(val,CbTypeList)#else Std.is(val,CbTypeList)#end){\n var cbs:CbTypeList=val;\n for(cb in cbs)append_type(list,cb.zpp_inner);\n }\n else if(#if flash10#if flash untyped __is__(val,ZPP_Const.cbtypevector)#else Std.is(val,ZPP_Const.cbtypevector)#end\n #else false #end){\n #if flash10 var cbs:flash.Vector=val;\n for(cb in cbs)append_type(list,cb.zpp_inner);\n #end\n }\n else if(#if flash untyped __is__(val,Array)#else Std.is(val,Array)#end){\n var cbs:Array=val;\n for(cb in cbs){\n #if(!NAPE_RELEASE_BUILD)\n if(!#if flash untyped __is__(cb,CbType)#else Std.is(cb,CbType)#end){\n throw \"Error: Cannot append non-CbType or CbType list value\";\n }\n #end\n var cbx:CbType=cb;\n append_type(list,cbx.zpp_inner);\n }\n }\n else{\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot append non-CbType or CbType list value\";\n #end\n }\n }\n public static function argument(val:Dynamic):OptionType{\n return if(val==null)new OptionType();\n else if(#if flash untyped __is__(val,OptionType)#else Std.is(val,OptionType)#end)val;\n else new OptionType().including(val);\n }\n}\n","package zpp_nape.constraint;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Constraint{\n public var outer:Constraint=null;\n public function clear(){}\n public var id:Int=0;\n public var userData:Dynamic=null;\n public var compound:ZPP_Compound=null;\n public var space:ZPP_Space=null;\n public var active:Bool=false;\n public var stiff:Bool=false;\n public var frequency:Float=0.0;\n public var damping:Float=0.0;\n public var maxForce:Float=0.0;\n public var maxError:Float=0.0;\n public var breakUnderForce:Bool=false;\n public var breakUnderError:Bool=false;\n public var removeOnBreak:Bool=false;\n public var component:ZPP_Component=null;\n public var ignore:Bool=false;\n public var __velocity:Bool=false;\n public function new(){\n __velocity=false;\n id=ZPP_ID.Constraint();\n stiff=true;\n active=true;\n ignore=false;\n frequency=10;\n damping=1;\n maxForce=ZPP_Const.POSINF();\n maxError=ZPP_Const.POSINF();\n breakUnderForce=false;\n removeOnBreak=true;\n pre_dt=-1.0;\n cbTypes=new ZNPList_ZPP_CbType();\n }\n public function immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: Constraint::\"+name+\" cannot be set during space step()\";\n #end\n }\n public var cbTypes:ZNPList_ZPP_CbType=null;\n public var cbSet:ZPP_CbSet=null;\n public var wrap_cbTypes:CbTypeList=null;\n public function setupcbTypes(){\n wrap_cbTypes=ZPP_CbTypeList.get(cbTypes);\n wrap_cbTypes.zpp_inner.adder=wrap_cbTypes_adder;\n wrap_cbTypes.zpp_inner.subber=wrap_cbTypes_subber;\n wrap_cbTypes.zpp_inner.dontremove=true;\n #if(!NAPE_RELEASE_BUILD)\n wrap_cbTypes.zpp_inner._modifiable=immutable_cbTypes;\n #end\n }\n #if(!NAPE_RELEASE_BUILD)\n function immutable_cbTypes(){\n immutable_midstep(\"Constraint::cbTypes\");\n }\n #end\n function wrap_cbTypes_subber(pcb:CbType):Void{\n var cb=pcb.zpp_inner;\n if(cbTypes.has(cb)){\n if(space!=null){\n dealloc_cbSet();\n cb.remConstraint(this);\n }\n cbTypes.remove(cb);\n if(space!=null){\n alloc_cbSet();\n wake();\n }\n }\n }\n function wrap_cbTypes_adder(cb:CbType):Bool{\n insert_cbtype(cb.zpp_inner);\n return false;\n }\n public function insert_cbtype(cb:ZPP_CbType){\n if(!cbTypes.has(cb)){\n if(space!=null){\n dealloc_cbSet();\n cb.addConstraint(this);\n }\n {\n var pre=null;\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if(ZPP_CbType.setlt(cb,j))break;\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n cbTypes.inlined_insert(pre,cb);\n };\n if(space!=null){\n alloc_cbSet();\n wake();\n }\n }\n }\n public function alloc_cbSet(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n space!=null;\n };\n if(!res)throw \"assert(\"+\"space!=null\"+\") :: \"+(\"space null in alloc_cbSet\");\n #end\n };\n if((cbSet=space.cbsets.get(cbTypes))!=null){\n cbSet.increment();\n cbSet.addConstraint(this);\n }\n }\n public function dealloc_cbSet(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n space!=null;\n };\n if(!res)throw \"assert(\"+\"space!=null\"+\") :: \"+(\"space null in dealloc_cbSet\");\n #end\n };\n if(cbSet!=null){\n cbSet.remConstraint(this);\n if(cbSet.decrement()){\n space.cbsets.remove(cbSet);\n {\n var o=cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSet\"+\", in obj: \"+\"cbSet\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT++;\n ZPP_CbSet.POOL_SUB++;\n #end\n };\n }\n cbSet=null;\n }\n }\n public function activate(){\n if(space!=null)activeInSpace();\n }\n public function deactivate(){\n if(space!=null)inactiveOrOutSpace();\n }\n public function addedToSpace(){\n if(active)activeInSpace();\n activeBodies();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.addConstraint(this);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function removedFromSpace(){\n if(active)inactiveOrOutSpace();\n inactiveBodies();\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.remConstraint(this);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function activeInSpace(){\n alloc_cbSet();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n component==null;\n };\n if(!res)throw \"assert(\"+\"component==null\"+\") :: \"+(\"already has a component?\");\n #end\n };\n {\n if(ZPP_Component.zpp_pool==null){\n component=new ZPP_Component();\n #if NAPE_POOL_STATS ZPP_Component.POOL_TOT++;\n ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n component=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=component.next;\n component.next=null;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT--;\n ZPP_Component.POOL_ADD++;\n #end\n }\n component.alloc();\n };\n component.isBody=false;\n component.constraint=this;\n }\n public function inactiveOrOutSpace(){\n dealloc_cbSet();\n {\n var o=component;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Component\"+\", in obj: \"+\"component\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT++;\n ZPP_Component.POOL_SUB++;\n #end\n };\n component=null;\n }\n #if nape_swc@:keep #end\n public function activeBodies(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"activeBodies not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function inactiveBodies(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"inactiveBodies not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function clearcache(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"clearcache not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function validate(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"validate not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function wake_connected(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"wake_connected not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function forest(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"forest not overriden\");\n #end\n };\n }\n #if nape_swc@:keep #end\n public function pair_exists(id:Int,di:Int){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"pair_exists not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function broken(){}\n #if nape_swc@:keep #end\n public function warmStart(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"warmStart not overriden\");\n #end\n };\n }\n public var pre_dt:Float=0.0;\n #if nape_swc@:keep #end\n public function preStep(dt:Float):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"preStep not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function applyImpulseVel(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"applyImpulseVel not overriden\");\n #end\n };\n return false;\n }\n #if nape_swc@:keep #end\n public function applyImpulsePos(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"applyImpulsePos not overriden\");\n #end\n };\n return false;\n }\n public function wake(){\n if(space!=null)space.wake_constraint(this);\n }\n public function draw(g:Debug){}\n public function copy(dict:Array=null,todo:Array=null):Constraint{\n return null;\n }\n public function copyto(ret:Constraint){\n var me=outer;\n for(cb in me.cbTypes)ret.cbTypes.add(cb);\n ret.removeOnBreak=me.removeOnBreak;\n ret.breakUnderError=me.breakUnderError;\n ret.breakUnderForce=me.breakUnderForce;\n ret.maxError=me.maxError;\n ret.maxForce=me.maxForce;\n ret.damping=me.damping;\n ret.frequency=me.frequency;\n ret.stiff=me.stiff;\n ret.ignore=me.ignore;\n ret.active=me.active;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CopyHelper{\n public var id:Int=0;\n public var bc:Body=null;\n public var cb:Body->Void=null;\n function new(){}\n public static function dict(id:Int,bc:Body){\n var ret=new ZPP_CopyHelper();\n ret.id=id;\n ret.bc=bc;\n return ret;\n }\n public static function todo(id:Int,cb:Body->Void){\n var ret=new ZPP_CopyHelper();\n ret.id=id;\n ret.cb=cb;\n return ret;\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Arbiter{\n public var outer:Arbiter=null;\n #if NAPE_POOL_STATS public var arbid:Int=0;\n static var nextarbid:Int=0;\n #end\n public static var internal=false;\n public function wrapper(){\n if(outer==null){\n internal=true;\n if(type==COL){\n colarb.outer_zn=new CollisionArbiter();\n outer=colarb.outer_zn;\n }\n else if(type==FLUID){\n fluidarb.outer_zn=new FluidArbiter();\n outer=fluidarb.outer_zn;\n }\n else outer=new Arbiter();\n outer.zpp_inner=this;\n internal=false;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inactiveme(){\n return!active;\n }\n public var hnext:ZPP_Arbiter=null;\n public function new(){\n #if NAPE_POOL_STATS arbid=nextarbid++;\n #end\n }\n public var id:Int=0;\n public var di:Int=0;\n public var stamp:Int=0;\n public var up_stamp:Int=0;\n public var sleep_stamp:Int=0;\n public var endGenerated:Int=0;\n public var active:Bool=false;\n public var cleared:Bool=false;\n public var sleeping:Bool=false;\n public var present:Int=0;\n public var intchange:Bool=false;\n public var presentable:Bool=false;\n public var continuous:Bool=false;\n public var fresh:Bool=false;\n public var immState:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function acting(){\n return active&&((immState&ZPP_Flags.id_ImmState_ACCEPT)!=0);\n }\n public var invalidated:Bool=false;\n public var b1:ZPP_Body=null;\n public var b2:ZPP_Body=null;\n public var ws1:ZPP_Shape=null;\n public var ws2:ZPP_Shape=null;\n public var pair:ZPP_AABBPair=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function swap_features(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n type==COL;\n };\n if(!res)throw \"assert(\"+\"type==COL\"+\") :: \"+(\"Arbiter::swap_features\");\n #end\n };\n {\n var t=b1;\n b1=b2;\n b2=t;\n };\n {\n var t=ws1;\n ws1=ws2;\n ws2=t;\n };\n {\n var t=colarb.s1;\n colarb.s1=colarb.s2;\n colarb.s2=t;\n };\n }\n public var type:Int=0;\n public static var COL=1;\n public static var FLUID=4;\n public static var SENSOR=2;\n static public var types:Array=[null,ArbiterType.COLLISION,ArbiterType.SENSOR,null,ArbiterType.FLUID];\n public var colarb:ZPP_ColArbiter=null;\n public var fluidarb:ZPP_FluidArbiter=null;\n public var sensorarb:ZPP_SensorArbiter=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function lazyRetire(s:ZPP_Space,b:ZPP_Body=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cleared;\n };\n if(!res)throw \"assert(\"+\"!cleared\"+\") :: \"+(\"Arbiter::lazyRetire\");\n #end\n };\n cleared=true;\n if(b==null||(b2==b))b1.arbiters.inlined_remove(this);\n if(b==null||(b1==b))b2.arbiters.inlined_remove(this);\n if(pair!=null){\n pair.arb=null;\n pair=null;\n }\n active=false;\n s.f_arbiters.modified=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sup_assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n b1=s1.body;\n ws1=s1;\n b2=s2.body;\n ws2=s2;\n this.id=id;\n this.di=di;\n b1.arbiters.inlined_add(this);\n b2.arbiters.inlined_add(this);\n active=true;\n present=0;\n cleared=false;\n sleeping=false;\n fresh=false;\n presentable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sup_retire(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b1!=null;\n };\n if(!res)throw \"assert(\"+\"b1!=null\"+\") :: \"+(\"Arbiter::sup_retire\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b2!=null;\n };\n if(!res)throw \"assert(\"+\"b2!=null\"+\") :: \"+(\"Arbiter::sup_retire\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n present==0;\n };\n if(!res)throw \"assert(\"+\"present==0\"+\") :: \"+(\"Arbiter::sup_retire cbsets present\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !intchange;\n };\n if(!res)throw \"assert(\"+\"!intchange\"+\") :: \"+(\"Arbiter::sup_retire intchange\");\n #end\n };\n if(!cleared){\n b1.arbiters.inlined_remove(this);\n b2.arbiters.inlined_remove(this);\n if(pair!=null){\n pair.arb=null;\n pair=null;\n }\n }\n b1=b2=null;\n active=false;\n intchange=false;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SensorArbiter extends ZPP_Arbiter{\n public var next:ZPP_SensorArbiter=null;\n static public var zpp_pool:ZPP_SensorArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going out of pool? (sensor)\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going into pool? (sensor)\");\n #end\n };\n }\n public function new(){\n super();\n type=ZPP_Arbiter.SENSOR;\n sensorarb=this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SensorArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT++;\n ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){}\n}\n#if nape_swc@:keep #end\nclass ZPP_FluidArbiter extends ZPP_Arbiter{\n public var outer_zn:FluidArbiter=null;\n public var next:ZPP_FluidArbiter=null;\n static public var zpp_pool:ZPP_FluidArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going out of pool? (fluid)\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode pair exists on arb going into pool? (fluid)\");\n #end\n };\n }\n public var centroidx:Float=0.0;\n public var centroidy:Float=0.0;\n public var overlap:Float=0.0;\n public var r1x:Float=0.0;\n public var r1y:Float=0.0;\n public var r2x:Float=0.0;\n public var r2y:Float=0.0;\n public var nodrag:Bool=false;\n public var wMass:Float=0.0;\n public var adamp:Float=0.0;\n public var agamma:Float=0.0;\n public var vMassa:Float=0.0;\n public var vMassb:Float=0.0;\n public var vMassc:Float=0.0;\n public var dampx:Float=0.0;\n public var dampy:Float=0.0;\n public var lgamma:Float=0.0;\n public var nx:Float=0.0;\n public var ny:Float=0.0;\n public var buoyx:Float=0.0;\n public var buoyy:Float=0.0;\n private function position_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(inactiveme())throw \"Error: Arbiter not currently in use\";\n #end\n {\n wrap_position.zpp_inner.x=centroidx;\n wrap_position.zpp_inner.y=centroidy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.x!=wrap_position.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"centroidx\"+\",in y: \"+\"centroidy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.y!=wrap_position.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"centroidx\"+\",in y: \"+\"centroidy\"+\")\");\n #end\n };\n };\n }\n private function position_invalidate(x:ZPP_Vec2){\n {\n centroidx=x.x;\n centroidy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidx!=centroidx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidx)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidy!=centroidy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidy)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n }\n public var wrap_position:Vec2=null;\n public function getposition(){\n wrap_position=Vec2.get();\n wrap_position.zpp_inner._inuse=true;\n wrap_position.zpp_inner._immutable=!mutable;\n wrap_position.zpp_inner._validate=position_validate;\n wrap_position.zpp_inner._invalidate=position_invalidate;\n }\n public function new(){\n super();\n type=ZPP_Arbiter.FLUID;\n fluidarb=this;\n {\n buoyx=0;\n buoyy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyx!=buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyx)\"+\") :: \"+(\"vec_set(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyy!=buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyy)\"+\") :: \"+(\"vec_set(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n pre_dt=-1.0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n {\n nx=0;\n ny=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n {\n dampx=0;\n dampy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampx!=dampx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampx)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampy!=dampy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampy)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n adamp=0.0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT++;\n ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n pre_dt=-1.0;\n }\n public var mutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){\n mutable=true;\n if(wrap_position!=null)wrap_position.zpp_inner._immutable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){\n mutable=false;\n if(wrap_position!=null)wrap_position.zpp_inner._immutable=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inject(area:Float,cx:Float,cy:Float){\n overlap=area;\n {\n centroidx=cx;\n centroidy=cy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidx!=centroidx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidx)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"cx\"+\",in y: \"+\"cy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((centroidy!=centroidy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(centroidy)\"+\") :: \"+(\"vec_set(in n: \"+\"centroid\"+\",in x: \"+\"cx\"+\",in y: \"+\"cy\"+\")\");\n #end\n };\n };\n }\n public var pre_dt:Float=0.0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function preStep(s:ZPP_Space,dt:Float){\n if(pre_dt==-1.0)pre_dt=dt;\n var dtratio=dt/pre_dt;\n pre_dt=dt;\n {\n r1x=centroidx-b1.posx;\n r1y=centroidy-b1.posy;\n };\n {\n r2x=centroidx-b2.posx;\n r2y=centroidy-b2.posy;\n };\n var g1x:Float=0.0;\n var g1y:Float=0.0;\n if(ws1.fluidEnabled&&ws1.fluidProperties.wrap_gravity!=null){\n g1x=ws1.fluidProperties.gravityx;\n g1y=ws1.fluidProperties.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1x!=g1x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1x)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"ws1.fluidProperties.gravityx\"+\",in y: \"+\"ws1.fluidProperties.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1y!=g1y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1y)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"ws1.fluidProperties.gravityx\"+\",in y: \"+\"ws1.fluidProperties.gravityy\"+\")\");\n #end\n };\n }\n else{\n g1x=s.gravityx;\n g1y=s.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1x!=g1x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1x)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g1y!=g1y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g1y)\"+\") :: \"+(\"vec_set(in n: \"+\"g1\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n };\n var g2x:Float=0.0;\n var g2y:Float=0.0;\n if(ws2.fluidEnabled&&ws2.fluidProperties.wrap_gravity!=null){\n g2x=ws2.fluidProperties.gravityx;\n g2y=ws2.fluidProperties.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2x!=g2x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2x)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"ws2.fluidProperties.gravityx\"+\",in y: \"+\"ws2.fluidProperties.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2y!=g2y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2y)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"ws2.fluidProperties.gravityx\"+\",in y: \"+\"ws2.fluidProperties.gravityy\"+\")\");\n #end\n };\n }\n else{\n g2x=s.gravityx;\n g2y=s.gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2x!=g2x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2x)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((g2y!=g2y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(g2y)\"+\") :: \"+(\"vec_set(in n: \"+\"g2\"+\",in x: \"+\"s.gravityx\"+\",in y: \"+\"s.gravityy\"+\")\");\n #end\n };\n };\n var buoyx:Float=0;\n var buoyy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyx!=buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyx)\"+\") :: \"+(\"vec_new(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((buoyy!=buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(buoyy)\"+\") :: \"+(\"vec_new(in n: \"+\"buoy\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n if(ws1.fluidEnabled&&ws2.fluidEnabled){\n var mass1=overlap*ws1.fluidProperties.density;\n var mass2=overlap*ws2.fluidProperties.density;\n if(mass1>mass2){\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g1\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx-=g1x*t;\n buoyy-=g1y*t;\n };\n else if(mass1(ws2.worldCOMx*gx+ws2.worldCOMy*gy)){\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx-=gx*t;\n buoyy-=gy*t;\n };\n else{\n var t=(mass1+mass2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"buoy\"+\",in b: \"+\"g\"+\",in s: \"+\"mass1+mass2\"+\")\");\n #end\n };\n buoyx+=gx*t;\n buoyy+=gy*t;\n };\n }\n }\n else if(ws1.fluidEnabled){\n var mass=overlap*ws1.fluidProperties.density;\n {\n var t=(mass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"buoy\"+\",in b: \"+\"g1\"+\",in s: \"+\"mass\"+\")\");\n #end\n };\n buoyx-=g1x*t;\n buoyy-=g1y*t;\n };\n }\n else if(ws2.fluidEnabled){\n var mass=overlap*ws2.fluidProperties.density;\n {\n var t=(mass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"buoy\"+\",in b: \"+\"g2\"+\",in s: \"+\"mass\"+\")\");\n #end\n };\n buoyx+=g2x*t;\n buoyy+=g2y*t;\n };\n }\n {\n var t=(dt);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"buoy\"+\",in s: \"+\"dt\"+\")\");\n #end\n };\n buoyx*=t;\n buoyy*=t;\n };\n {\n this.buoyx=buoyx;\n this.buoyy=buoyy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.buoyx!=this.buoyx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.buoyx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.buoy\"+\",in x: \"+\"buoyx\"+\",in y: \"+\"buoyy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.buoyy!=this.buoyy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.buoyy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.buoy\"+\",in x: \"+\"buoyx\"+\",in y: \"+\"buoyy\"+\")\");\n #end\n };\n };\n if(b1.isDynamic()){\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"buoy\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=buoyx*t;\n b1.vely-=buoyy*t;\n };\n b1.angvel-=(buoyy*r1x-buoyx*r1y)*b1.iinertia;\n }\n if(b2.isDynamic()){\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"buoy\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=buoyx*t;\n b2.vely+=buoyy*t;\n };\n b2.angvel+=(buoyy*r2x-buoyx*r2y)*b2.iinertia;\n }\n if((!ws1.fluidEnabled||ws1.fluidProperties.viscosity==0)&&(!ws2.fluidEnabled||ws2.fluidProperties.viscosity==0)){\n nodrag=true;\n {\n dampx=0;\n dampy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampx!=dampx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampx)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dampy!=dampy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dampy)\"+\") :: \"+(\"vec_set(in n: \"+\"damp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n adamp=0;\n }\n else{\n nodrag=false;\n var tViscosity=0.0;\n if(ws1.fluidEnabled){\n ws2.validate_angDrag();\n tViscosity+=ws1.fluidProperties.viscosity*ws2.angDrag*overlap/ws2.area;\n }\n if(ws2.fluidEnabled){\n ws1.validate_angDrag();\n tViscosity+=ws2.fluidProperties.viscosity*ws1.angDrag*overlap/ws1.area;\n }\n if(tViscosity!=0){\n var iSum=b1.sinertia+b2.sinertia;\n if(iSum!=0)wMass=1/iSum;\n else wMass=0.0;\n var biasCoef;\n tViscosity*=0.0004;\n wMass*={\n var omega=2*Math.PI*tViscosity;\n agamma=1/(dt*omega*(2*1+omega*dt));\n var ig=1/(1+agamma);\n biasCoef=dt*omega*omega*agamma;\n agamma*=ig;\n ig;\n };\n }\n else{\n wMass=0.0;\n agamma=0.0;\n }\n var vrnx:Float=(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel));\n var vrny:Float=(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vrnx!=vrnx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vrnx)\"+\") :: \"+(\"vec_new(in n: \"+\"vrn\"+\",in x: \"+\"(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel))\"+\",in y: \"+\"(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel))\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vrny!=vrny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vrny)\"+\") :: \"+(\"vec_new(in n: \"+\"vrn\"+\",in x: \"+\"(b2.velx+b2.kinvelx-r2y*(b2.angvel+b2.kinangvel))-(b1.velx+b1.kinvelx-r1y*(b2.angvel+b2.kinangvel))\"+\",in y: \"+\"(b2.vely+b2.kinvely+r2x*(b2.angvel+b2.kinangvel))-(b1.vely+b1.kinvely+r1x*(b1.angvel+b1.kinangvel))\"+\")\");\n #end\n };\n if((vrnx*vrnx+vrny*vrny)<(Config.epsilon*Config.epsilon)){}\n else{\n {\n var d=(vrnx*vrnx+vrny*vrny);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"vrn\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"vrn\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n vrnx*=t;\n vrny*=t;\n };\n };\n {\n nx=vrnx;\n ny=vrny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"vrnx\"+\",in y: \"+\"vrny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"vrnx\"+\",in y: \"+\"vrny\"+\")\");\n #end\n };\n };\n }\n var tViscosity=0.0;\n if(ws1.fluidEnabled){\n var f=-ws1.fluidProperties.viscosity*overlap/ws2.area;\n if(ws2.type==ZPP_Flags.id_ShapeType_CIRCLE)tViscosity-=f*ws2.circle.radius*Config.fluidLinearDrag/(2*ws2.circle.radius*Math.PI);\n else{\n var poly=ws2.polygon;\n var bord=0.0;\n var acc=0.0;\n {\n var cx_ite=poly.edges.begin();\n while(cx_ite!=null){\n var ex=cx_ite.elem();\n {\n bord+=ex.length;\n var fact=f*ex.length*(ex.gnormx*nx+ex.gnormy*ny);\n if(fact>0)fact=fact*=-Config.fluidVacuumDrag;\n acc-=fact*0.5*Config.fluidLinearDrag;\n };\n cx_ite=cx_ite.next;\n }\n };\n tViscosity+=acc/bord;\n }\n }\n if(ws2.fluidEnabled){\n var f=-ws2.fluidProperties.viscosity*overlap/ws1.area;\n if(ws1.type==ZPP_Flags.id_ShapeType_CIRCLE)tViscosity-=f*ws1.circle.radius*Config.fluidLinearDrag/(2*ws1.circle.radius*Math.PI);\n else{\n var poly=ws1.polygon;\n var bord=0.0;\n var acc=0.0;\n {\n var cx_ite=poly.edges.begin();\n while(cx_ite!=null){\n var ex=cx_ite.elem();\n {\n bord+=ex.length;\n var fact=f*ex.length*(ex.gnormx*nx+ex.gnormy*ny);\n if(fact>0)fact=fact*=-Config.fluidVacuumDrag;\n acc-=fact*0.5*Config.fluidLinearDrag;\n };\n cx_ite=cx_ite.next;\n }\n };\n tViscosity+=acc/bord;\n }\n }\n if(tViscosity!=0){\n var m=b1.smass+b2.smass;\n var Ka:Float=0.0;\n var Kb:Float=0.0;\n var Kc:Float=0.0;\n {\n Ka=m;\n Kb=0;\n Kc=m;\n };\n if(b1.sinertia!=0){\n var X=r1x*b1.sinertia;\n var Y=r1y*b1.sinertia;\n {\n Ka+=Y*r1y;\n Kb+=-Y*r1x;\n Kc+=X*r1x;\n };\n };\n if(b2.sinertia!=0){\n var X=r2x*b2.sinertia;\n var Y=r2y*b2.sinertia;\n {\n Ka+=Y*r2y;\n Kb+=-Y*r2x;\n Kc+=X*r2x;\n };\n };\n {\n var det=(Ka*Kc-Kb*Kb);\n if((det!=det)){\n Ka=Kb=Kc=0;\n 3;\n }\n else if(det==0){\n var flag=0;\n if(Ka!=0)Ka=1/Ka;\n else{\n Ka=0;\n flag|=1;\n }\n if(Kc!=0)Kc=1/Kc;\n else{\n Kc=0;\n flag|=2;\n }\n Kb=0;\n flag;\n }\n else{\n det=1/det;\n var t=Kc*det;\n Kc=Ka*det;\n Ka=t;\n Kb*=-det;\n 0;\n }\n };\n {\n vMassa=Ka;\n vMassb=Kb;\n vMassc=Kc;\n };\n var biasCoef;\n {\n var X=({\n var omega=2*Math.PI*tViscosity;\n lgamma=1/(dt*omega*(2*1+omega*dt));\n var ig=1/(1+lgamma);\n biasCoef=dt*omega*omega*lgamma;\n lgamma*=ig;\n ig;\n });\n vMassa*=X;\n vMassb*=X;\n vMassc*=X;\n };\n }\n else{\n {\n vMassa=0;\n vMassb=0;\n vMassc=0;\n };\n lgamma=0.0;\n }\n }\n {\n var t=(dtratio);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"damp\"+\",in s: \"+\"dtratio\"+\")\");\n #end\n };\n dampx*=t;\n dampy*=t;\n };\n adamp*=dtratio;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function warmStart(){\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"damp\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=dampx*t;\n b1.vely-=dampy*t;\n };\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"damp\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=dampx*t;\n b2.vely+=dampy*t;\n };\n b1.angvel-=b1.iinertia*(dampy*r1x-dampx*r1y);\n b2.angvel+=b2.iinertia*(dampy*r2x-dampx*r2y);\n b1.angvel-=adamp*b1.iinertia;\n b2.angvel+=adamp*b2.iinertia;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function applyImpulseVel(){\n if(!nodrag){\n var w1=b1.angvel+b1.kinangvel;\n var w2=b2.angvel+b2.kinangvel;\n var jx:Float=(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2);\n var jy:Float=(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jx!=jx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jx)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2)\"+\",in y: \"+\"(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2)\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((jy!=jy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(jy)\"+\") :: \"+(\"vec_new(in n: \"+\"j\"+\",in x: \"+\"(b1.velx+b1.kinvelx-r1y*w1)-(b2.velx+b2.kinvelx-r2y*w2)\"+\",in y: \"+\"(b1.vely+b1.kinvely+r1x*w1)-(b2.vely+b2.kinvely+r2x*w2)\"+\")\");\n #end\n };\n {\n var t=vMassa*jx+vMassb*jy;\n jy=vMassb*jx+vMassc*jy;\n jx=t;\n };\n {\n var t=(lgamma);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"j\"+\",in b: \"+\"damp\"+\",in s: \"+\"lgamma\"+\")\");\n #end\n };\n jx-=dampx*t;\n jy-=dampy*t;\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"damp\"+\",in b: \"+\"j\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n dampx+=jx*t;\n dampy+=jy*t;\n };\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.vel\"+\",in b: \"+\"j\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.velx-=jx*t;\n b1.vely-=jy*t;\n };\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.vel\"+\",in b: \"+\"j\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.velx+=jx*t;\n b2.vely+=jy*t;\n };\n b1.angvel-=b1.iinertia*(jy*r1x-jx*r1y);\n b2.angvel+=b2.iinertia*(jy*r2x-jx*r2y);\n var j_damp=(w1-w2)*wMass-adamp*agamma;\n adamp+=j_damp;\n b1.angvel-=j_damp*b1.iinertia;\n b2.angvel+=j_damp*b2.iinertia;\n }\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_ColArbiter extends ZPP_Arbiter{\n public var outer_zn:CollisionArbiter=null;\n public var dyn_fric:Float=0.0;\n public var stat_fric:Float=0.0;\n public var restitution:Float=0.0;\n public var rfric:Float=0.0;\n public var userdef_dyn_fric:Bool=false;\n public var userdef_stat_fric:Bool=false;\n public var userdef_restitution:Bool=false;\n public var userdef_rfric:Bool=false;\n public var s1:ZPP_Shape=null;\n public var s2:ZPP_Shape=null;\n public var contacts:ZPP_Contact=null;\n public var wrap_contacts:ContactList=null;\n public var innards:ZPP_IContact=null;\n public var nx:Float=0.0;\n public var ny:Float=0.0;\n private function normal_validate(){\n if(cleared)throw \"Error: Arbiter not currently in use\";\n {\n wrap_normal.zpp_inner.x=nx;\n wrap_normal.zpp_inner.y=ny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_normal.zpp_inner.x!=wrap_normal.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_normal.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_normal.zpp_inner.\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_normal.zpp_inner.y!=wrap_normal.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_normal.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_normal.zpp_inner.\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n };\n if(ws1.id>ws2.id){\n {\n wrap_normal.zpp_inner.x=-wrap_normal.zpp_inner.x;\n wrap_normal.zpp_inner.y=-wrap_normal.zpp_inner.y;\n };\n }\n }\n public var wrap_normal:Vec2=null;\n public function getnormal(){\n wrap_normal=Vec2.get(0,0);\n wrap_normal.zpp_inner._immutable=true;\n wrap_normal.zpp_inner._inuse=true;\n wrap_normal.zpp_inner._validate=normal_validate;\n }\n var kMassa:Float=0.0;\n var kMassb:Float=0.0;\n var kMassc:Float=0.0;\n var Ka:Float=0.0;\n var Kb:Float=0.0;\n var Kc:Float=0.0;\n public var rMass:Float=0.0;\n public var jrAcc:Float=0.0;\n var rn1a:Float=0.0;\n var rt1a:Float=0.0;\n var rn1b:Float=0.0;\n var rt1b:Float=0.0;\n var rn2a:Float=0.0;\n var rt2a:Float=0.0;\n var rn2b:Float=0.0;\n var rt2b:Float=0.0;\n var k1x:Float=0.0;\n var k1y:Float=0.0;\n var k2x:Float=0.0;\n var k2y:Float=0.0;\n public var surfacex:Float=0.0;\n public var surfacey:Float=0.0;\n public static inline var FACE1=0;\n public static inline var FACE2=1;\n public static inline var CIRCLE=2;\n public var ptype:Int;\n public var lnormx:Float=0.0;\n public var lnormy:Float=0.0;\n public var lproj:Float=0.0;\n public var radius:Float=0.0;\n public var rev:Bool=false;\n var biasCoef:Float=0.0;\n public var __ref_edge1:ZPP_Edge=null;\n public var __ref_edge2:ZPP_Edge=null;\n public var __ref_vertex:Int=0;\n public var c1:ZPP_IContact=null;\n public var oc1:ZPP_Contact=null;\n public var c2:ZPP_IContact=null;\n public var oc2:ZPP_Contact=null;\n public var hc2:Bool=false;\n public var hpc2:Bool=false;\n public var next:ZPP_ColArbiter=null;\n static public var zpp_pool:ZPP_ColArbiter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public function new(){\n super();\n pre_dt=-1.0;\n contacts=new ZPP_Contact();\n innards=new ZPP_IContact();\n type=ZPP_Arbiter.COL;\n colarb=this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode exists on col arbiter going out of pool?\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n contacts.empty();\n };\n if(!res)throw \"assert(\"+\"contacts.empty()\"+\") :: \"+(\"still has contacts on free?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n pair==null;\n };\n if(!res)throw \"assert(\"+\"pair==null\"+\") :: \"+(\"AABBNode exists on col arbiter going into pool?\");\n #end\n };\n userdef_dyn_fric=false;\n userdef_stat_fric=false;\n userdef_restitution=false;\n userdef_rfric=false;\n __ref_edge1=__ref_edge2=null;\n }\n public var stat:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function injectContact(px:Float,py:Float,nx:Float,ny:Float,dist:Float,hash:Int,posOnly=false){\n var c:ZPP_Contact=null;\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n if(hash==cur.hash){\n c=cur;\n break;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(c==null){\n {\n if(ZPP_Contact.zpp_pool==null){\n c=new ZPP_Contact();\n #if NAPE_POOL_STATS ZPP_Contact.POOL_TOT++;\n ZPP_Contact.POOL_ADDNEW++;\n #end\n }\n else{\n c=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=c.next;\n c.next=null;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT--;\n ZPP_Contact.POOL_ADD++;\n #end\n }\n c.alloc();\n };\n var ci=c.inner;\n ci.jnAcc=ci.jtAcc=0;\n c.hash=hash;\n c.fresh=true;\n c.arbiter=this;\n jrAcc=0;\n contacts.inlined_add(c);\n innards.add(ci);\n }\n else c.fresh=false;\n {\n c.px=px;\n c.py=py;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((c.px!=c.px));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(c.px)\"+\") :: \"+(\"vec_set(in n: \"+\"c.p\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((c.py!=c.py));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(c.py)\"+\") :: \"+(\"vec_set(in n: \"+\"c.p\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n };\n {\n this.nx=nx;\n this.ny=ny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.nx!=this.nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.nx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.n\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.ny!=this.ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.ny)\"+\") :: \"+(\"vec_set(in n: \"+\"this.n\"+\",in x: \"+\"nx\"+\",in y: \"+\"ny\"+\")\");\n #end\n };\n };\n c.dist=dist;\n c.stamp=stamp;\n c.posOnly=posOnly;\n return c;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function assign(s1:ZPP_Shape,s2:ZPP_Shape,id:Int,di:Int){\n sup_assign(s1,s2,id,di);\n this.s1=s1;\n this.s2=s2;\n calcProperties();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function calcProperties(){\n if(!userdef_restitution){\n if(s1.material.elasticity<=ZPP_Const.NEGINF()||s2.material.elasticity<=ZPP_Const.NEGINF())restitution=0;\n else if(s1.material.elasticity>=ZPP_Const.POSINF()||s2.material.elasticity>=ZPP_Const.POSINF())restitution=1;\n else restitution=(s1.material.elasticity+s2.material.elasticity)/2;\n if(restitution<0)restitution=0;\n if(restitution>1)restitution=1;\n }\n if(!userdef_dyn_fric){\n dyn_fric=ZPP_Math.sqrt(s1.material.dynamicFriction*s2.material.dynamicFriction);\n }\n if(!userdef_stat_fric){\n stat_fric=ZPP_Math.sqrt(s1.material.staticFriction*s2.material.staticFriction);\n }\n if(!userdef_rfric){\n rfric=ZPP_Math.sqrt(s1.material.rollingFriction*s2.material.rollingFriction);\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_props(){\n if(invalidated){\n invalidated=false;\n calcProperties();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function retire(){\n sup_retire();\n while(!contacts.empty()){\n {\n var o=contacts.inlined_pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Contact\"+\", in obj: \"+\"contacts.inlined_pop_unsafe()\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT++;\n ZPP_Contact.POOL_SUB++;\n #end\n };\n innards.inlined_pop();\n }\n {\n var o=this;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ColArbiter\"+\", in obj: \"+\"this\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT++;\n ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n pre_dt=-1.0;\n }\n public var mutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makemutable(){\n mutable=true;\n if(wrap_normal!=null)wrap_normal.zpp_inner._immutable=false;\n if(wrap_contacts!=null)wrap_contacts.zpp_inner.immutable=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function makeimmutable(){\n mutable=false;\n if(wrap_normal!=null)wrap_normal.zpp_inner._immutable=true;\n if(wrap_contacts!=null)wrap_contacts.zpp_inner.immutable=true;\n }\n private function contacts_adder(x:Contact){\n #if(!NAPE_RELEASE_BUILD)\n throw \"Error: Cannot add new contacts, information required is far too specific and detailed :)\";\n #end\n return false;\n }\n private function contacts_subber(x:Contact){\n var pre=null;\n var prei=null;\n var cx_itei=innards.begin();\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c==x.zpp_inner){\n contacts.erase(pre);\n innards.erase(prei);\n {\n var o=c;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Contact\"+\", in obj: \"+\"c\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Contact.zpp_pool;\n ZPP_Contact.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Contact.POOL_CNT++;\n ZPP_Contact.POOL_SUB++;\n #end\n };\n break;\n }\n pre=cx_ite;\n prei=cx_itei;\n cx_itei=cx_itei.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function setupcontacts(){\n wrap_contacts=ZPP_ContactList.get(contacts,true);\n wrap_contacts.zpp_inner.immutable=!mutable;\n wrap_contacts.zpp_inner.adder=contacts_adder;\n wrap_contacts.zpp_inner.dontremove=true;\n wrap_contacts.zpp_inner.subber=contacts_subber;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function cleanupContacts(){\n var fst=true;\n var pre=null;\n var prei=null;\n var cx_itei=innards.begin();\n hc2=false;\n {\n var cx_ite=contacts.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c.stamp+Config.arbiterExpirationDelay-Config.elasticThreshold){\n ci.bounce=0;\n }\n vdot=(vry*nx-vrx*ny);\n var thr=Config.staticFrictionThreshold;\n if(vdot*vdot>thr*thr){\n ci.friction=dyn_fric;\n }\n else{\n ci.friction=stat_fric;\n }\n ci.jnAcc*=dtratio;\n ci.jtAcc*=dtratio;\n }\n if(pact!=c.active)contacts.modified=true;\n pre=cx_ite;\n prei=cx_itei;\n cx_itei=cx_itei.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(hc2){\n hpc2=true;\n if(oc1.posOnly){\n var tmp=c1;\n c1=c2;\n c2=tmp;\n var tmp2=oc1;\n oc1=oc2;\n oc2=tmp2;\n hc2=false;\n }\n else if(oc2.posOnly){\n hc2=false;\n }\n if(oc1.posOnly){\n fst=true;\n }\n }\n else{\n hpc2=false;\n }\n jrAcc*=dtratio;\n if(!fst){\n rn1a=(ny*c1.r1x-nx*c1.r1y);\n rt1a=(c1.r1x*nx+c1.r1y*ny);\n rn1b=(ny*c1.r2x-nx*c1.r2y);\n rt1b=(c1.r2x*nx+c1.r2y*ny);\n k1x=b2.kinvelx-c1.r2y*b2.kinangvel-(b1.kinvelx-c1.r1y*b1.kinangvel);\n k1y=b2.kinvely+c1.r2x*b2.kinangvel-(b1.kinvely+c1.r1x*b1.kinangvel);\n }\n if(hc2){\n rn2a=(ny*c2.r1x-nx*c2.r1y);\n rt2a=(c2.r1x*nx+c2.r1y*ny);\n rn2b=(ny*c2.r2x-nx*c2.r2y);\n rt2b=(c2.r2x*nx+c2.r2y*ny);\n k2x=b2.kinvelx-c2.r2y*b2.kinangvel-(b1.kinvelx-c2.r1y*b1.kinangvel);\n k2y=b2.kinvely+c2.r2x*b2.kinangvel-(b1.kinvely+c2.r1x*b1.kinangvel);\n {\n kMassa=mass_sum+b1.sinertia*rn1a*rn1a+b2.sinertia*rn1b*rn1b;\n kMassb=mass_sum+b1.sinertia*rn1a*rn2a+b2.sinertia*rn1b*rn2b;\n kMassc=mass_sum+b1.sinertia*rn2a*rn2a+b2.sinertia*rn2b*rn2b;\n };\n var norm=(kMassa*kMassa+2*kMassb*kMassb+kMassc*kMassc);\n if(normjMax)cjAcc=jMax else if(cjAcc<-jMax)cjAcc=-jMax;\n j=cjAcc-jOld;\n c1.jtAcc=cjAcc;\n jx=-ny*j;\n jy=nx*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rt1b*j*b2.iinertia;\n b1.angvel-=rt1a*j*b1.iinertia;\n if(hc2){\n var v2x=k2x+b2.velx-c2.r2y*b2.angvel-(b1.velx-c2.r1y*b1.angvel);\n var v2y=k2y+b2.vely+c2.r2x*b2.angvel-(b1.vely+c2.r1x*b1.angvel);\n j=((v2y*nx-v2x*ny)+surfacex)*c2.tMass;\n jMax=c2.friction*c2.jnAcc;\n jOld=c2.jtAcc;\n cjAcc=jOld-j;\n if(cjAcc>jMax)cjAcc=jMax else if(cjAcc<-jMax)cjAcc=-jMax;\n j=cjAcc-jOld;\n c2.jtAcc=cjAcc;\n jx=-ny*j;\n jy=nx*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rt2b*j*b2.iinertia;\n b1.angvel-=rt2a*j*b1.iinertia;\n v1x=k1x+b2.velx-c1.r2y*b2.angvel-(b1.velx-c1.r1y*b1.angvel);\n v1y=k1y+b2.vely+c1.r2x*b2.angvel-(b1.vely+c1.r1x*b1.angvel);\n v2x=k2x+b2.velx-c2.r2y*b2.angvel-(b1.velx-c2.r1y*b1.angvel);\n v2y=k2y+b2.vely+c2.r2x*b2.angvel-(b1.vely+c2.r1x*b1.angvel);\n var ax:Float=c1.jnAcc;\n var ay:Float=c2.jnAcc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ax!=ax));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ax)\"+\") :: \"+(\"vec_new(in n: \"+\"a\"+\",in x: \"+\"c1.jnAcc\"+\",in y: \"+\"c2.jnAcc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ay!=ay));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ay)\"+\") :: \"+(\"vec_new(in n: \"+\"a\"+\",in x: \"+\"c1.jnAcc\"+\",in y: \"+\"c2.jnAcc\"+\")\");\n #end\n };\n var jnx=(v1x*nx+v1y*ny)+surfacey+(c1.bounce)-(Ka*ax+Kb*ay);\n var jny=(v2x*nx+v2y*ny)+surfacey+(c2.bounce)-(Kb*ax+Kc*ay);\n var xx=-(kMassa*jnx+kMassb*jny);\n var xy=-(kMassb*jnx+kMassc*jny);\n if(xx>=0&&xy>=0){\n {\n jnx=xx-ax;\n jny=xy-ay;\n };\n c1.jnAcc=xx;\n c2.jnAcc=xy;\n }\n else{\n xx=-c1.nMass*jnx;\n if(xx>=0&&(Kb*xx+jny)>=0){\n jnx=xx-ax;\n jny=-ay;\n c1.jnAcc=xx;\n c2.jnAcc=0;\n }\n else{\n xy=-c2.nMass*jny;\n if(xy>=0&&(Kb*xy+jnx)>=0){\n jnx=-ax;\n jny=xy-ay;\n c1.jnAcc=0;\n c2.jnAcc=xy;\n }\n else if(jnx>=0&&jny>=0){\n jnx=-ax;\n jny=-ay;\n c1.jnAcc=c2.jnAcc=0;\n }\n else{\n jnx=0;\n jny=0;\n }\n }\n }\n j=jnx+jny;\n jx=nx*j;\n jy=ny*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=(rn1b*jnx+rn2b*jny)*b2.iinertia;\n b1.angvel-=(rn1a*jnx+rn2a*jny)*b1.iinertia;\n }\n else{\n if(radius!=0.0){\n var dw=b2.angvel-b1.angvel;\n j=dw*rMass;\n jMax=rfric*c1.jnAcc;\n jOld=jrAcc;\n jrAcc-=j;\n if(jrAcc>jMax)jrAcc=jMax else if(jrAcc<-jMax)jrAcc=-jMax;\n j=jrAcc-jOld;\n b2.angvel+=j*b2.iinertia;\n b1.angvel-=j*b1.iinertia;\n }\n v1x=k1x+b2.velx-c1.r2y*b2.angvel-(b1.velx-c1.r1y*b1.angvel);\n v1y=k1y+b2.vely+c1.r2x*b2.angvel-(b1.vely+c1.r1x*b1.angvel);\n j=(c1.bounce+(nx*v1x+ny*v1y)+surfacey)*c1.nMass;\n jOld=c1.jnAcc;\n cjAcc=jOld-j;\n if(cjAcc<0.0)cjAcc=0.0;\n j=cjAcc-jOld;\n c1.jnAcc=cjAcc;\n jx=nx*j;\n jy=ny*j;\n b2.velx+=jx*b2.imass;\n b2.vely+=jy*b2.imass;\n b1.velx-=jx*b1.imass;\n b1.vely-=jy*b1.imass;\n b2.angvel+=rn1b*j*b2.iinertia;\n b1.angvel-=rn1a*j*b1.iinertia;\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function applyImpulsePos(){\n if(ptype==ZPP_ColArbiter.CIRCLE){\n var c=c1;\n var dx:Float=0.0;\n var dy:Float=0.0;\n var r2x:Float=0.0;\n var r2y:Float=0.0;\n {\n r2x=(b2.axisy*c.lr2x-b2.axisx*c.lr2y);\n r2y=(c.lr2x*b2.axisx+c.lr2y*b2.axisy);\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"r2\"+\",in b: \"+\"b2.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n r2x+=b2.posx*t;\n r2y+=b2.posy*t;\n };\n var r1x:Float=0.0;\n var r1y:Float=0.0;\n {\n r1x=(b1.axisy*c.lr1x-b1.axisx*c.lr1y);\n r1y=(c.lr1x*b1.axisx+c.lr1y*b1.axisy);\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"r1\"+\",in b: \"+\"b1.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n r1x+=b1.posx*t;\n r1y+=b1.posy*t;\n };\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=r2x-r1x;\n dy=r2y-r1y;\n };\n var dl=ZPP_Math.sqrt((dx*dx+dy*dy));\n var r=radius-Config.collisionSlop;\n var err=(dl-r);\n if((dx*nx+dy*ny)<0){\n {\n dx=-dx;\n dy=-dy;\n };\n err-=radius;\n }\n if(err<0){\n if(dl=0&&xy>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n {\n xx=-bx/Ka;\n xy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xx!=xx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xx)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"-bx/Ka\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xy!=xy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xy)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"-bx/Ka\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var vn2=Kb*xx+by;\n if(xx>=0&&vn2>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n {\n xx=0;\n xy=-by/Kc;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xx!=xx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xx)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"0\"+\",in y: \"+\"-by/Kc\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((xy!=xy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(xy)\"+\") :: \"+(\"vec_set(in n: \"+\"x\"+\",in x: \"+\"0\"+\",in y: \"+\"-by/Kc\"+\")\");\n #end\n };\n };\n var vn1=Kb*xy+bx;\n if(xy>=0&&vn1>=0){\n {\n var t=((xx+xy)*b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b1.imass\"+\")\");\n #end\n };\n b1.posx-=gnormx*t;\n b1.posy-=gnormy*t;\n };\n b1.delta_rot(-b1.iinertia*(rn1a*xx+rn2a*xy));\n {\n var t=((xx+xy)*b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"gnorm\"+\",in s: \"+\"(xx+xy)*b2.imass\"+\")\");\n #end\n };\n b2.posx+=gnormx*t;\n b2.posy+=gnormy*t;\n };\n b2.delta_rot(b2.iinertia*(rn1b*xx+rn2b*xy));\n break;\n };\n }\n while(false);\n }\n else{\n var rn1=(gnormy*c1r1x-gnormx*c1r1y);\n var rn2=(gnormy*c1r2x-gnormx*c1r2y);\n var K=b2.smass+rn2*rn2*b2.sinertia+b1.smass+rn1*rn1*b1.sinertia;\n if(K!=0){\n var jn=-biasCoef*err1/K;\n var Jx:Float=0.0;\n var Jy:Float=0.0;\n {\n var t=(jn);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"gnorm\"+\",in s: \"+\"jn\"+\",out r: \"+\"J\"+\")\");\n #end\n };\n Jx=gnormx*t;\n Jy=gnormy*t;\n };\n {\n var t=(b1.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"b1.pos\"+\",in b: \"+\"J\"+\",in s: \"+\"b1.imass\"+\")\");\n #end\n };\n b1.posx-=Jx*t;\n b1.posy-=Jy*t;\n };\n b1.delta_rot(-rn1*b1.iinertia*jn);\n {\n var t=(b2.imass);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"b2.pos\"+\",in b: \"+\"J\"+\",in s: \"+\"b2.imass\"+\")\");\n #end\n };\n b2.posx+=Jx*t;\n b2.posy+=Jy*t;\n };\n b2.delta_rot(rn2*b2.iinertia*jn);\n }\n }\n }\n }\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Contact{\n public var outer:Contact=null;\n public static var internal:Bool=false;\n public function wrapper(){\n if(outer==null){\n internal=true;\n outer=new Contact();\n internal=false;\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var px:Float=0.0;\n public var py:Float=0.0;\n private function position_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(inactiveme())throw \"Error: Contact not currently in use\";\n #end\n {\n wrap_position.zpp_inner.x=px;\n wrap_position.zpp_inner.y=py;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.x!=wrap_position.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_position.zpp_inner.y!=wrap_position.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_position.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_position.zpp_inner.\"+\",in x: \"+\"px\"+\",in y: \"+\"py\"+\")\");\n #end\n };\n };\n }\n public var wrap_position:Vec2=null;\n public function getposition(){\n var me=this;\n wrap_position=Vec2.get();\n wrap_position.zpp_inner._inuse=true;\n wrap_position.zpp_inner._immutable=true;\n wrap_position.zpp_inner._validate=position_validate;\n }\n public function inactiveme(){\n return!(active&&arbiter!=null&&!arbiter.inactiveme());\n }\n public var arbiter:ZPP_Arbiter=null;\n public var inner:ZPP_IContact=null;\n public var active:Bool=false;\n public var posOnly:Bool=false;\n public var stamp:Int=0;\n public var hash:Int=0;\n public var fresh:Bool=false;\n public var dist:Float=0.0;\n public var elasticity:Float=0.0;\n public function new(){\n inner=new ZPP_IContact();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n arbiter=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n static public var zpp_pool:ZPP_Contact=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var next:ZPP_Contact=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Contact{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_Contact{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_Contact):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Contact):ZPP_Contact{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Contact,o:ZPP_Contact):ZPP_Contact{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Contact,o:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Contact{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Contact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Contact):ZPP_Contact{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Contact):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Contact;\n var ret:ZPP_Contact;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Contact,n:Int):ZPP_Contact{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Contact):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Contact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Contact\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Contact{\n return begin().elem();\n }\n public function back():ZPP_Contact{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Contact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_IContact{\n public var r1x:Float=0.0;\n public var r1y:Float=0.0;\n public var r2x:Float=0.0;\n public var r2y:Float=0.0;\n public var nMass:Float=0.0;\n public var tMass:Float=0.0;\n public var bounce:Float=0.0;\n public var friction:Float=0.0;\n public var jnAcc:Float=0.0;\n public var jtAcc:Float=0.0;\n public var lr1x:Float=0.0;\n public var lr1y:Float=0.0;\n public var lr2x:Float=0.0;\n public var lr2y:Float=0.0;\n public function new(){}\n public var next:ZPP_IContact=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_IContact{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_IContact{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_IContact):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_IContact):ZPP_IContact{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_IContact,o:ZPP_IContact):ZPP_IContact{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_IContact,o:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_IContact{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_IContact):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_IContact):ZPP_IContact{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_IContact):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_IContact;\n var ret:ZPP_IContact;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_IContact,n:Int):ZPP_IContact{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_IContact):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_IContact):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_IContact\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_IContact{\n return begin().elem();\n }\n public function back():ZPP_IContact{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_IContact{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_InteractionFilter{\n public var next:ZPP_InteractionFilter=null;\n static public var zpp_pool:ZPP_InteractionFilter=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:InteractionFilter=null;\n public function wrapper(){\n if(outer==null){\n outer=new InteractionFilter();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_InteractionFilter\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT++;\n ZPP_InteractionFilter.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public function new(){\n feature_cons();\n collisionGroup=sensorGroup=fluidGroup=1;\n collisionMask=sensorMask=fluidMask=-1;\n }\n public function copy(){\n var ret;\n {\n if(ZPP_InteractionFilter.zpp_pool==null){\n ret=new ZPP_InteractionFilter();\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_TOT++;\n ZPP_InteractionFilter.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT--;\n ZPP_InteractionFilter.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.collisionGroup=collisionGroup;\n ret.collisionMask=collisionMask;\n ret.sensorGroup=sensorGroup;\n ret.sensorMask=sensorMask;\n ret.fluidGroup=fluidGroup;\n ret.fluidMask=fluidMask;\n return ret;\n }\n public var collisionGroup:Int=0;\n public var collisionMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldCollide(x:ZPP_InteractionFilter){\n return(collisionMask&x.collisionGroup)!=0&&(x.collisionMask&collisionGroup)!=0;\n }\n public var sensorGroup:Int=0;\n public var sensorMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldSense(x:ZPP_InteractionFilter){\n return(sensorMask&x.sensorGroup)!=0&&(x.sensorMask&sensorGroup)!=0;\n }\n public var fluidGroup:Int=0;\n public var fluidMask:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function shouldFlow(x:ZPP_InteractionFilter){\n return(fluidMask&x.fluidGroup)!=0&&(x.fluidMask&fluidGroup)!=0;\n }\n public function invalidate(){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.invalidate_filter();\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.dynamics;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_InteractionGroup{\n public var outer:InteractionGroup=null;\n public var ignore:Bool=false;\n public var group:ZPP_InteractionGroup=null;\n public function setGroup(group:ZPP_InteractionGroup){\n if(this.group!=group){\n if(this.group!=null){\n this.group.remGroup(this);\n this.group.invalidate(true);\n }\n this.group=group;\n if(group!=null){\n group.addGroup(this);\n group.invalidate(true);\n }\n else this.invalidate(true);\n }\n }\n public var groups:ZNPList_ZPP_InteractionGroup=null;\n public var wrap_groups:InteractionGroupList=null;\n public var interactors:ZNPList_ZPP_Interactor=null;\n public var wrap_interactors:InteractorList=null;\n public var depth:Int=0;\n public function invalidate(force=false){\n if(!(force||ignore))return;\n {\n var cx_ite=interactors.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(b.isBody())b.ibody.wake();\n else if(b.isShape())b.ishape.body.wake();\n else b.icompound.wake();\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=groups.begin();\n while(cx_ite!=null){\n var g=cx_ite.elem();\n g.invalidate(force);\n cx_ite=cx_ite.next;\n }\n };\n }\n public static var SHAPE=1;\n public static var BODY=2;\n public function new(){\n depth=0;\n groups=new ZNPList_ZPP_InteractionGroup();\n interactors=new ZNPList_ZPP_Interactor();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addGroup(group:ZPP_InteractionGroup){\n groups.add(group);\n group.depth=depth+1;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remGroup(group:ZPP_InteractionGroup){\n groups.remove(group);\n group.depth=0;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addInteractor(intx:ZPP_Interactor){\n interactors.add(intx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remInteractor(intx:ZPP_Interactor,flag:Int=-1){\n interactors.remove(intx);\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_AABB{\n public var _invalidate:NullVoid>=null;\n public var _validate:NullVoid>=null;\n public var _immutable:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n if(_invalidate!=null){\n _invalidate(this);\n }\n }\n public var outer:Null=null;\n public function wrapper():AABB{\n if(outer==null){\n outer=new AABB();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var next:ZPP_AABB=null;\n static public var zpp_pool:ZPP_AABB=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(outer!=null){\n outer.zpp_inner=null;\n outer=null;\n }\n wrap_min=wrap_max=null;\n _invalidate=null;\n _validate=null;\n }\n public function new(){}\n public static#if NAPE_NO_INLINE#else inline #end\n function get(minx:Float,miny:Float,maxx:Float,maxy:Float):ZPP_AABB{\n var ret;\n {\n if(ZPP_AABB.zpp_pool==null){\n ret=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n ret.minx=minx;\n ret.miny=miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.minx!=ret.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.min\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.miny!=ret.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.min\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n };\n {\n ret.maxx=maxx;\n ret.maxy=maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.maxx!=ret.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.max\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.maxy!=ret.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.max\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function copy():ZPP_AABB{\n return ZPP_AABB.get(minx,miny,maxx,maxy);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function width():Float{\n return maxx-minx;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function height():Float{\n return maxy-miny;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function perimeter():Float{\n return(width()+height())*2;\n }\n public var minx:Float=0.0;\n public var miny:Float=0.0;\n public var wrap_min:Null=null;\n public function getmin():Vec2{\n if(wrap_min==null){\n wrap_min=Vec2.get(minx,miny);\n wrap_min.zpp_inner._inuse=true;\n if(_immutable){\n wrap_min.zpp_inner._immutable=true;\n }\n else{\n wrap_min.zpp_inner._invalidate=mod_min;\n }\n wrap_min.zpp_inner._validate=dom_min;\n }\n return wrap_min;\n }\n public function dom_min():Void{\n validate();\n {\n wrap_min.zpp_inner.x=minx;\n wrap_min.zpp_inner.y=miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_min.zpp_inner.x!=wrap_min.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_min.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_min.zpp_inner.\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_min.zpp_inner.y!=wrap_min.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_min.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_min.zpp_inner.\"+\",in x: \"+\"minx\"+\",in y: \"+\"miny\"+\")\");\n #end\n };\n };\n }\n public function mod_min(min:ZPP_Vec2):Void{\n if(min.x!=minx||min.y!=miny){\n {\n minx=min.x;\n miny=min.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minx!=minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minx)\"+\") :: \"+(\"vec_set(in n: \"+\"min\"+\",in x: \"+\"min.x\"+\",in y: \"+\"min.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((miny!=miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(miny)\"+\") :: \"+(\"vec_set(in n: \"+\"min\"+\",in x: \"+\"min.x\"+\",in y: \"+\"min.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n }\n public var maxx:Float=0.0;\n public var maxy:Float=0.0;\n public var wrap_max:Null=null;\n public function getmax():Vec2{\n if(wrap_max==null){\n wrap_max=Vec2.get(maxx,maxy);\n wrap_max.zpp_inner._inuse=true;\n if(_immutable){\n wrap_max.zpp_inner._immutable=true;\n }\n else{\n wrap_max.zpp_inner._invalidate=mod_max;\n }\n wrap_max.zpp_inner._validate=dom_max;\n }\n return wrap_max;\n }\n public function dom_max():Void{\n validate();\n {\n wrap_max.zpp_inner.x=maxx;\n wrap_max.zpp_inner.y=maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_max.zpp_inner.x!=wrap_max.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_max.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_max.zpp_inner.\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_max.zpp_inner.y!=wrap_max.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_max.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_max.zpp_inner.\"+\",in x: \"+\"maxx\"+\",in y: \"+\"maxy\"+\")\");\n #end\n };\n };\n }\n public function mod_max(max:ZPP_Vec2):Void{\n if(max.x!=maxx||max.y!=maxy){\n {\n maxx=max.x;\n maxy=max.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxx!=maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"max\"+\",in x: \"+\"max.x\"+\",in y: \"+\"max.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((maxy!=maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"max\"+\",in x: \"+\"max.x\"+\",in y: \"+\"max.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersectX(x:ZPP_AABB):Bool{\n return!(x.minx>maxx||minx>x.maxx);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersectY(x:ZPP_AABB):Bool{\n return!(x.miny>maxy||miny>x.maxy);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function intersect(x:ZPP_AABB):Bool{\n return x.miny<=maxy&&miny<=x.maxy&&x.minx<=maxx&&minx<=x.maxx;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function combine(x:ZPP_AABB):Void{\n if(x.minxmaxx)maxx=x.maxx;\n if(x.minymaxy)maxy=x.maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function contains(x:ZPP_AABB):Bool{\n return x.minx>=minx&&x.miny>=miny&&x.maxx<=maxx&&x.maxy<=maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function containsPoint(v:ZPP_Vec2):Bool{\n return v.x>=minx&&v.x<=maxx&&v.y>=miny&&v.y<=maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setCombine(a:ZPP_AABB,b:ZPP_AABB):Void{\n minx=if(a.minxb.maxx)a.maxx else b.maxx;\n maxy=if(a.maxy>b.maxy)a.maxy else b.maxy;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setExpand(a:ZPP_AABB,fatten:Float):Void{\n minx=a.minx-fatten;\n miny=a.miny-fatten;\n maxx=a.maxx+fatten;\n maxy=a.maxy+fatten;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setExpandPoint(x:Float,y:Float):Void{\n if(xmaxx)maxx=x;\n if(ymaxy)maxy=y;\n }\n public function toString(){\n return \"{ x: \"+minx+\" y: \"+miny+\" w: \"+width()+\" h: \"+height()+\" }\";\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Collide{\n public static function circleContains(c:ZPP_Circle,p:ZPP_Vec2){\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=p.x-c.worldCOMx;\n dy=p.y-c.worldCOMy;\n };\n return(dx*dx+dy*dy)max)max=k;\n };\n cx_ite=cx_ite.next;\n }\n };\n max<=a.gprojection;\n }){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n retvar=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n retvar;\n });\n };\n }\n else return false;\n }\n public static function contactCollide(s1:ZPP_Shape,s2:ZPP_Shape,arb:ZPP_ColArbiter,rev:Bool){\n if(s2.isPolygon()){\n if(s1.isPolygon()){\n var cont=true;\n var max=-ZPP_Const.FMAX;\n var maxmin=-ZPP_Const.FMAX;\n var maxi=-1;\n var axis1:ZPP_Edge=null;\n var axis2:ZPP_Edge=null;\n {\n var cx_ite=s1.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=0){\n cont=false;\n break;\n }\n if(min>max){\n max=min;\n axis1=ax;\n maxi=1;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=0){\n cont=false;\n break;\n }\n if(min>max){\n max=min;\n axis2=ax;\n maxi=2;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(!cont)return false;\n else{\n var q1,q2,ax,scale;\n if(maxi==1){\n q1=s1.polygon;\n q2=s2.polygon;\n ax=axis1;\n scale=1.0;\n }\n else{\n q1=s2.polygon;\n q2=s1.polygon;\n ax=axis2;\n scale=-1.0;\n }\n var ay:ZPP_Edge=null;\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=q2.edges.begin();\n while(cx_ite!=null){\n var axis=cx_ite.elem();\n {\n var k=(ax.gnormx*axis.gnormx+ax.gnormy*axis.gnormy);\n if(kConfig.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c0\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c0x+=dvx*t;\n c0y+=dvy*t;\n };\n var t=(-ax.tp0-d1)*den;\n if(t<-Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c1\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c1x+=dvx*t;\n c1y+=dvy*t;\n };\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n var t=(scale);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"ax.gnorm\"+\",in s: \"+\"scale\"+\",out r: \"+\"n\"+\")\");\n #end\n };\n nx=ax.gnormx*t;\n ny=ax.gnormy*t;\n };\n {\n arb.lnormx=ax.lnormx;\n arb.lnormy=ax.lnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((arb.lnormx!=arb.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(arb.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"arb.lnorm\"+\",in x: \"+\"ax.lnormx\"+\",in y: \"+\"ax.lnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((arb.lnormy!=arb.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(arb.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"arb.lnorm\"+\",in x: \"+\"ax.lnormx\"+\",in y: \"+\"ax.lnormy\"+\")\");\n #end\n };\n };\n arb.lproj=ax.lprojection;\n arb.radius=0;\n arb.rev=rev!=(scale==-1);\n arb.ptype=arb.rev?ZPP_ColArbiter.FACE2:ZPP_ColArbiter.FACE1;\n var c0d=(c0x*ax.gnormx+c0y*ax.gnormy)-ax.gprojection;\n var c1d=(c1x*ax.gnormx+c1y*ax.gnormy)-ax.gprojection;\n if(c0d>0&&c1d>0){\n return false;\n }\n else{\n if(rev){\n nx=-nx;\n ny=-ny;\n }\n var con=arb.injectContact(c0x-(ax.gnormx*c0d*0.5),c0y-(ax.gnormy*c0d*0.5),nx,ny,c0d,arb.rev?1:0,c0d>0);\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c0\"+\",in b: \"+\"q2.body.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n c0x-=q2.body.posx*t;\n c0y-=q2.body.posy*t;\n };\n {\n con.inner.lr1x=c0x*q2.body.axisy+c0y*q2.body.axisx;\n con.inner.lr1y=c0y*q2.body.axisy-c0x*q2.body.axisx;\n };\n con=arb.injectContact(c1x-(ax.gnormx*c1d*0.5),c1y-(ax.gnormy*c1d*0.5),nx,ny,c1d,arb.rev?0:1,c1d>0);\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c1\"+\",in b: \"+\"q2.body.pos\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n c1x-=q2.body.posx*t;\n c1y-=q2.body.posy*t;\n };\n {\n con.inner.lr1x=c1x*q2.body.axisy+c1y*q2.body.axisx;\n con.inner.lr1y=c1y*q2.body.axisy-c1x*q2.body.axisx;\n };\n if(maxi==1){\n arb.__ref_edge1=ax;\n arb.__ref_edge2=ay;\n }\n else{\n arb.__ref_edge2=ax;\n arb.__ref_edge1=ay;\n }\n return true;\n }\n }\n }\n else return false;\n };\n else{\n var max=-ZPP_Const.FMAX;\n var minmax=-ZPP_Const.FMAX;\n var cont=true;\n var a0=null,vi=null;\n var vite=s2.polygon.gverts.begin();\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy)-a.gprojection-s1.circle.radius;\n if(dist>0){\n cont=false;\n break;\n }\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var co={\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n if(distSqr>minDist*minDist)null;\n else if(distSqr=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var co={\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n if(distSqr>minDist*minDist)null;\n else if(distSqrminDist*minDist)null;\n else if(distSqr0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n cont;\n }\n else false;\n };\n else{\n var a0=null,vi=null;\n var cont=true;\n var max=-ZPP_Const.FMAX;\n var vite=s2.polygon.gverts.begin();\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy)-a.gprojection-s1.circle.radius;\n if(dist>0){\n cont=false;\n break;\n }\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n else if(dt>=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n else true;\n }\n else false;\n };\n }\n else return{\n var minDist=s1.circle.radius+s2.circle.radius;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=s2.circle.worldCOMx-s1.circle.worldCOMx;\n py=s2.circle.worldCOMy-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n };\n }\n public static function flowCollide(s1:ZPP_Shape,s2:ZPP_Shape,arb:ZPP_FluidArbiter){\n if(s2.isPolygon()){\n return if(s1.isPolygon()){\n var out1=new Array();\n var out2=new Array();\n var cont=true;\n var total=true;\n {\n var cx_ite=s1.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n var ind=0;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=ax.gprojection+Config.epsilon){\n out2[ind]=true;\n total=false;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n min-=ax.gprojection;\n if(min>0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s2.polygon.validate_worldCOM();\n arb.inject(s2.polygon.area,s2.polygon.worldCOMx,s2.polygon.worldCOMy);\n true;\n }\n else if(cont){\n total=true;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var ax=cx_ite.elem();\n {\n var min=ZPP_Const.FMAX;\n var ind=0;\n {\n var cx_ite=s1.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var k=(ax.gnormx*v.x+ax.gnormy*v.y);\n if(k=ax.gprojection+Config.epsilon){\n out1[ind]=true;\n total=false;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n min-=ax.gprojection;\n if(min>0){\n cont=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s1.polygon.validate_worldCOM();\n arb.inject(s1.polygon.area,s1.polygon.worldCOMx,s1.polygon.worldCOMy);\n true;\n }\n else if(cont){\n while(!flowpoly.empty()){\n var p=flowpoly.pop_unsafe();\n if(!p._inuse){\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"p\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n var fst_vert=null;\n var poly1=false;\n var ite1=s1.polygon.gverts.begin();\n var ind1=0;\n var ite2=s2.polygon.gverts.begin();\n var ind2=0;\n for(i in 0...s2.polygon.edgeCnt)if(!out2[i]){\n ind2=i;\n break;\n }\n else ite2=ite2.next;\n if(ite2==null){\n ite2=s2.polygon.gverts.begin();\n poly1=true;\n for(i in 0...s1.polygon.edgeCnt)if(!out1[i]){\n ind1=i;\n break;\n }\n else ite1=ite1.next;\n if(ite1==null)ite1=s1.polygon.gverts.begin();\n else{\n flowpoly.add(ite1.elem());\n fst_vert=flowpoly.front();\n }\n }\n else{\n flowpoly.add(ite2.elem());\n fst_vert=flowpoly.front();\n }\n var cnt=1;\n if(flowpoly.empty()){\n {\n var cx_cont=true;\n var cx_itei=s1.polygon.gverts.begin();\n var u=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var v=cx_itej.elem();\n {\n var min=2.0;\n {\n var cx_cont=true;\n var cx_itei=s2.polygon.gverts.begin();\n var a=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var b=cx_itej.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(tConfig.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"min\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n fst_vert=ZPP_Vec2.get(cx,cy);\n flowpoly.add(fst_vert);\n poly1=true;\n ite1=cx_itei;\n {\n cx_cont=false;\n break;\n };\n }\n };\n {\n cx_itei=cx_itej;\n u=v;\n cx_itej=cx_itej.next;\n };\n }\n if(cx_cont){\n do{\n cx_itej=s1.polygon.gverts.begin();\n var v=cx_itej.elem();\n {\n var min=2.0;\n {\n var cx_cont=true;\n var cx_itei=s2.polygon.gverts.begin();\n var a=cx_itei.elem();\n var cx_itej=cx_itei.next;\n while(cx_itej!=null){\n var b=cx_itej.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(tConfig.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"min\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n fst_vert=ZPP_Vec2.get(cx,cy);\n flowpoly.add(fst_vert);\n poly1=true;\n ite1=cx_itei;\n break;\n }\n };\n }\n while(false);\n }\n };\n cnt=2;\n }\n while(true){\n if(poly1){\n ite1=ite1.next;\n ind1++;\n if(ite1==null){\n ite1=s1.polygon.gverts.begin();\n ind1=0;\n }\n if(!out1[ind1]){\n var ex=ite1.elem();\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(ex.x,ex.y,fst_vert.x,fst_vert.y)Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite2;\n indo=ind2;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite2=cx_ite;\n ind2++;\n if(ind2>=s2.polygon.edgeCnt)ind2=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite2;\n indo=ind2;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite2=cx_ite;\n ind2++;\n if(ind2>=s2.polygon.edgeCnt)ind2=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n };\n if(itmo==null)break;\n var u=itmo.elem();\n var itm2=itmo.next;\n if(itm2==null)itm2=s2.polygon.gverts.begin();\n var v=itm2.elem();\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(max);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"max\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(cx,cy,fst_vert.x,fst_vert.y)Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite1;\n indo=ind1;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite1=cx_ite;\n ind1++;\n if(ind1>=s1.polygon.edgeCnt)ind1=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s1.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var t=0.0;\n if({\n var _sx:Float=0.0;\n var _sy:Float=0.0;\n {\n _sx=u.x-a.x;\n _sy=u.y-a.y;\n };\n var _vx:Float=0.0;\n var _vy:Float=0.0;\n {\n _vx=v.x-u.x;\n _vy=v.y-u.y;\n };\n var _qx:Float=0.0;\n var _qy:Float=0.0;\n {\n _qx=b.x-a.x;\n _qy=b.y-a.y;\n };\n var den=(_vy*_qx-_vx*_qy);\n if(den*den>Config.epsilon*Config.epsilon){\n den=1/den;\n var txx=(_qy*_sx-_qx*_sy)*den;\n if(txx>Config.epsilon&&txx<1-Config.epsilon){\n var sxx=(_vy*_sx-_vx*_sy)*den;\n if(sxx>Config.epsilon&&sxx<1-Config.epsilon){\n t=txx;\n true;\n }\n else false;\n }\n else false;\n }\n else false;\n }){\n if(t>=max){\n itmo=ite1;\n indo=ind1;\n if(++icnt==cnt){\n max=t;\n {\n cx_ite=beg_ite;\n break;\n };\n }\n else max=t;\n }\n }\n u=v;\n ite1=cx_ite;\n ind1++;\n if(ind1>=s1.polygon.edgeCnt)ind1=0;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s1.polygon.gverts.begin();\n }\n };\n if(itmo==null)break;\n var u=itmo.elem();\n var itm2=itmo.next;\n if(itm2==null)itm2=s1.polygon.gverts.begin();\n var v=itm2.elem();\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(max);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"max\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(cx,cy,fst_vert.x,fst_vert.y)();\n var total=true;\n var a0=null,vi=null;\n var max=-ZPP_Const.FMAX;\n var cont=true;\n var vite=s2.polygon.gverts.begin();\n var ind=0;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var a=cx_ite.elem();\n {\n var dist=(a.gnormx*s1.circle.worldCOMx+a.gnormy*s1.circle.worldCOMy);\n if(dist>a.gprojection+s1.circle.radius){\n cont=false;\n break;\n }\n else if(dist+s1.circle.radius>a.gprojection+Config.epsilon){\n total=false;\n inte[ind]=true;\n }\n dist-=a.gprojection+s1.circle.radius;\n if(dist>max){\n max=dist;\n a0=a;\n vi=vite;\n }\n vite=vite.next;\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(cont){\n if(total){\n arb.inject(s1.circle.area,s1.circle.worldCOMx,s1.circle.worldCOMy);\n true;\n }\n else{\n var v0=vi.elem();\n var v1=if(vi.next==null)s2.polygon.gverts.front()else vi.next.elem();\n var dt=(s1.circle.worldCOMy*a0.gnormx-s1.circle.worldCOMx*a0.gnormy);\n if(if(dt<=(v0.y*a0.gnormx-v0.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v0.x-s1.circle.worldCOMx;\n py=v0.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n }\n else if(dt>=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n var minDist=s1.circle.radius+0;\n var px:Float=0.0;\n var py:Float=0.0;\n {\n px=v1.x-s1.circle.worldCOMx;\n py=v1.y-s1.circle.worldCOMy;\n };\n var distSqr=(px*px+py*py);\n distSqr<=minDist*minDist;\n }\n else true){\n var ins=new Array();\n var ind=0;\n var total=true;\n var vi=null;\n var vind=0;\n {\n var cx_ite=s2.polygon.gverts.begin();\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var dist=ZPP_VecMath.vec_dsq(v.x,v.y,s1.circle.worldCOMx,s1.circle.worldCOMy);\n if(!(ins[ind]=(dist<=s1.circle.radius*s1.circle.radius)))total=false;\n else{\n vind=ind;\n vi=cx_ite;\n }\n ind++;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(total){\n s2.polygon.validate_worldCOM();\n arb.inject(s2.polygon.area,s2.polygon.worldCOMx,s2.polygon.worldCOMy);\n true;\n }\n else{\n while(!flowpoly.empty()){\n var p=flowpoly.pop_unsafe();\n if(!p._inuse){\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"p\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n }\n flowsegs.clear();\n var fst_vert=null;\n var state=1;\n if(vi==null){\n vi=s2.polygon.gverts.begin();\n state=2;\n }\n else flowpoly.add(fst_vert=vi.elem());\n while(state!=0){\n if(state==1){\n vi=vi.next;\n if(vi==null)vi=s2.polygon.gverts.begin();\n vind++;\n if(vind>=s2.polygon.edgeCnt)vind=0;\n if(ins[vind]){\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,vi.elem().x,vi.elem().y)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)Config.epsilon){\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(t0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t0\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t1\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n flowpoly.add(ZPP_Vec2.get(cx,cy));\n }\n }\n }\n }\n u=v;\n vi=cx_ite;\n vind=vind2;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n while(false);\n while(cx_ite!=beg_ite){\n var v=cx_ite.elem();\n {\n var vind2=vind+1;\n if(vind2==s2.polygon.edgeCnt)vind2=0;\n if(inte[vind]){\n if(ins[vind2]){\n var tval={\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=u.x-s1.circle.worldCOMx;\n qy=u.y-s1.circle.worldCOMy;\n };\n var A=(vx*vx+vy*vy);\n var B=2*(qx*vx+qy*vy);\n var C=(qx*qx+qy*qy)-s1.circle.radius*s1.circle.radius;\n var D=Math.sqrt(B*B-4*A*C);\n A=1/(2*A);\n var t=(-B-D)*A;\n if(t1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"tval\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)Config.epsilon){\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n var T=(t0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(((T!=T))||T<0.0||T>1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t0\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n if(fst_vert!=null&&ZPP_VecMath.vec_dsq(fst_vert.x,fst_vert.y,cx,cy)1.0);\n };\n if(!res)throw \"assert(\"+\"!(assert_isNaN(T)||T<0.0||T>1.0)\"+\") :: \"+(\"vec_interp(in a: \"+\"u.\"+\",in b: \"+\"v.\"+\",in t: \"+\"t1\"+\",out c: \"+\"c\"+\")\");\n #end\n };\n cx=u.x+(v.x-u.x)*T;\n cy=u.y+(v.y-u.y)*T;\n };\n flowpoly.add(ZPP_Vec2.get(cx,cy));\n }\n }\n }\n }\n u=v;\n vi=cx_ite;\n vind=vind2;\n };\n cx_ite=cx_ite.next;\n if(cx_ite==null)cx_ite=s2.polygon.gverts.begin();\n }\n };\n }\n }\n if(flowpoly.begin()==null){\n false;\n }\n else if(flowpoly.begin().next==null){\n var all=true;\n {\n var cx_ite=s2.polygon.edges.begin();\n while(cx_ite!=null){\n var e=cx_ite.elem();\n {\n var dist=(e.gnormx*s1.circle.worldCOMx+e.gnormy*s1.circle.worldCOMy);\n if(dist>e.gprojection){\n all=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(all){\n arb.inject(s1.circle.area,s1.circle.worldCOMx,s1.circle.worldCOMy);\n true;\n }\n else false;\n }\n else{\n var COMx:Float=0;\n var COMy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((COMx!=COMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(COMx)\"+\") :: \"+(\"vec_new(in n: \"+\"COM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((COMy!=COMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(COMy)\"+\") :: \"+(\"vec_new(in n: \"+\"COM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var area=0.0;\n if(flowpoly.begin().next.next!=null){\n var parea=0.0;\n var pCOMx:Float=0.0;\n var pCOMy:Float=0.0;\n {\n {\n pCOMx=0;\n pCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pCOMx!=pCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"pCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pCOMy!=pCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"pCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n parea=0.0;\n {\n var cx_ite=flowpoly.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n var v=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n }\n cx_ite=flowpoly.begin();\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n var w=cx_ite.elem();\n {\n parea+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n pCOMx+=(v.x+w.x)*cf;\n pCOMy+=(v.y+w.y)*cf;\n };\n };\n parea*=0.5;\n var ia=1/(6*parea);\n {\n var t=(ia);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"pCOM\"+\",in s: \"+\"ia\"+\")\");\n #end\n };\n pCOMx*=t;\n pCOMy*=t;\n };\n };\n {\n var t=(-parea);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"COM\"+\",in b: \"+\"pCOM\"+\",in s: \"+\"-parea\"+\")\");\n #end\n };\n COMx+=pCOMx*t;\n COMy+=pCOMy*t;\n };\n area-=parea;\n }\n else{\n flowsegs.add(flowpoly.front());\n flowsegs.add(flowpoly.begin().next.elem());\n }\n while(!flowsegs.empty()){\n var u=flowsegs.pop_unsafe();\n var v=flowsegs.pop_unsafe();\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=v.x-u.x;\n dy=v.y-u.y;\n };\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n nx=dx;\n ny=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((nx!=nx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(nx)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ny!=ny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ny)\"+\") :: \"+(\"vec_set(in n: \"+\"n\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n {\n {\n var d=(nx*nx+ny*ny);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n d!=0.0;\n };\n if(!res)throw \"assert(\"+\"d!=0.0\"+\") :: \"+(\"vec_normalise(in n: \"+\"n\"+\")\");\n #end\n };\n var imag=ZPP_Math.invsqrt(d);\n {\n var t=(imag);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"n\"+\",in s: \"+\"imag\"+\")\");\n #end\n };\n nx*=t;\n ny*=t;\n };\n };\n {\n var t=nx;\n nx=-ny;\n ny=t;\n };\n };\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x+v.x;\n cy=u.y+v.y;\n };\n {\n var t=(1.0/(2));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"c\"+\",in s: \"+\"1.0/(2)\"+\")\");\n #end\n };\n cx*=t;\n cy*=t;\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_subeq(in a: \"+\"c\"+\",in b: \"+\"s1.circle.worldCOM\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n cx-=s1.circle.worldCOMx*t;\n cy-=s1.circle.worldCOMy*t;\n };\n var xd=(nx*cx+ny*cy);\n var carea=0.0;\n var ccom=0.0;\n {\n var X=xd;\n var cos=X/s1.circle.radius;\n var sin=Math.sqrt(1-cos*cos);\n var theta=Math.acos(cos);\n carea=s1.circle.radius*(s1.circle.radius*theta-X*sin);\n ccom=(2/3)*s1.circle.radius*sin*sin*sin/(theta-cos*sin);\n };\n {\n cx=s1.circle.worldCOMx;\n cy=s1.circle.worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"s1.circle.worldCOMx\"+\",in y: \"+\"s1.circle.worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"s1.circle.worldCOMx\"+\",in y: \"+\"s1.circle.worldCOMy\"+\")\");\n #end\n };\n };\n {\n var t=(ccom);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"n\"+\",in s: \"+\"ccom\"+\")\");\n #end\n };\n cx+=nx*t;\n cy+=ny*t;\n };\n {\n var t=(carea);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"COM\"+\",in b: \"+\"c\"+\",in s: \"+\"carea\"+\")\");\n #end\n };\n COMx+=cx*t;\n COMy+=cy*t;\n };\n area+=carea;\n }\n {\n var t=(1.0/(area));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"COM\"+\",in s: \"+\"1.0/(area)\"+\")\");\n #end\n };\n COMx*=t;\n COMy*=t;\n };\n arb.inject(area,COMx,COMy);\n true;\n }\n }\n }\n else false;\n }\n }\n else false;\n };\n }\n else return{\n var c1=s1.circle;\n var c2=s2.circle;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=c2.worldCOMx-c1.worldCOMx;\n deltay=c2.worldCOMy-c1.worldCOMy;\n };\n var cr=c1.radius+c2.radius;\n var ds=(deltax*deltax+deltay*deltay);\n if(ds>cr*cr)false;\n else if(ds=null;\n public var forced:Bool=false;\n static public var zpp_pool:ZPP_GeomVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(wrap!=null){\n wrap.zpp_inner._inuse=false;\n wrap.dispose();\n wrap=null;\n }\n prev=next=null;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n forced=false;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function wrapper():Vec2{\n if(wrap==null){\n wrap=Vec2.get(x,y);\n wrap.zpp_inner._inuse=true;\n wrap.zpp_inner._invalidate=modwrap;\n wrap.zpp_inner._validate=getwrap;\n }\n return wrap;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function modwrap(n:ZPP_Vec2):Void{\n {\n this.x=n.x;\n this.y=n.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.x!=this.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.x)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"n.x\"+\",in y: \"+\"n.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.y!=this.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.y)\"+\") :: \"+(\"vec_set(in n: \"+\"this.\"+\",in x: \"+\"n.x\"+\",in y: \"+\"n.y\"+\")\");\n #end\n };\n };\n }\n public#if NAPE_NO_INLINE#else inline #end\n function getwrap():Void{\n {\n wrap.zpp_inner.x=this.x;\n wrap.zpp_inner.y=this.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap.zpp_inner.x!=wrap.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap.zpp_inner.\"+\",in x: \"+\"this.x\"+\",in y: \"+\"this.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap.zpp_inner.y!=wrap.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap.zpp_inner.\"+\",in x: \"+\"this.x\"+\",in y: \"+\"this.y\"+\")\");\n #end\n };\n };\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float,y:Float):ZPP_GeomVert{\n var ret;\n {\n if(ZPP_GeomVert.zpp_pool==null){\n ret=new ZPP_GeomVert();\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_TOT++;\n ZPP_GeomVert.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_GeomVert.zpp_pool;\n ZPP_GeomVert.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_GeomVert.POOL_CNT--;\n ZPP_GeomVert.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n ret.x=x;\n ret.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.x!=ret.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.x)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.y!=ret.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.y)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n return ret;\n }\n public function new(){}\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomPoly{\n public var outer:GeomPoly=null;\n public var vertices:Null=null;\n public function new(outer:GeomPoly){\n this.outer=outer;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_GeomVertexIterator{\n public var ptr:ZPP_GeomVert=null;\n public var start:ZPP_GeomVert=null;\n public var first:Bool=false;\n public var forward:Bool=false;\n public var outer:GeomVertexIterator=null;\n public var next:ZPP_GeomVertexIterator=null;\n static public var zpp_pool:ZPP_GeomVertexIterator=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n outer.zpp_inner=null;\n ptr=start=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n #if(!NAPE_RELEASE_BUILD)\n public static var internal=false;\n #end\n function new(){\n #if(!NAPE_RELEASE_BUILD)\n internal=true;\n #end\n outer=new GeomVertexIterator();\n #if(!NAPE_RELEASE_BUILD)\n internal=false;\n #end\n }\n public static function get(poly:ZPP_GeomVert,forward:Bool){\n var ret;\n {\n if(ZPP_GeomVertexIterator.zpp_pool==null){\n ret=new ZPP_GeomVertexIterator();\n #if NAPE_POOL_STATS ZPP_GeomVertexIterator.POOL_TOT++;\n ZPP_GeomVertexIterator.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_GeomVertexIterator.zpp_pool;\n ZPP_GeomVertexIterator.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_GeomVertexIterator.POOL_CNT--;\n ZPP_GeomVertexIterator.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.outer.zpp_inner=ret;\n ret.ptr=poly;\n ret.forward=forward;\n ret.start=poly;\n ret.first=poly!=null;\n return ret.outer;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Mat23{\n public var outer:Null=null;\n public function wrapper():Mat23{\n if(outer==null){\n outer=new Mat23();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Mat23\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Mat23.zpp_pool;\n ZPP_Mat23.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_CNT++;\n ZPP_Mat23.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var a:Float=0.0;\n public var b:Float=0.0;\n public var c:Float=0.0;\n public var d:Float=0.0;\n public var tx:Float=0.0;\n public var ty:Float=0.0;\n public var _invalidate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate(){\n if(_invalidate!=null){\n _invalidate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function set(m:ZPP_Mat23):Void{\n setas(m.a,m.b,m.c,m.d,m.tx,m.ty);\n }\n public function setas(a:Float,b:Float,c:Float,d:Float,tx:Float,ty:Float):Void{\n {\n this.tx=tx;\n this.ty=ty;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.tx!=this.tx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.tx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.t\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.ty!=this.ty));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.ty)\"+\") :: \"+(\"vec_set(in n: \"+\"this.t\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n };\n {\n this.a=a;\n this.b=b;\n this.c=c;\n this.d=d;\n };\n }\n public var next:ZPP_Mat23=null;\n static public var zpp_pool:ZPP_Mat23=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{}\n public function new(){}\n public static function get():ZPP_Mat23{\n var ret;\n {\n if(ZPP_Mat23.zpp_pool==null){\n ret=new ZPP_Mat23();\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_TOT++;\n ZPP_Mat23.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_Mat23.zpp_pool;\n ZPP_Mat23.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_Mat23.POOL_CNT--;\n ZPP_Mat23.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n return ret;\n }\n public static function identity():ZPP_Mat23{\n var ret=ZPP_Mat23.get();\n ret.setas(1,0,0,1,0,0);\n return ret;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_MatMN{\n public var outer:MatMN=null;\n public var m:Int=0;\n public var n:Int=0;\n public var x:TArray=null;\n public function new(m:Int,n:Int){\n this.m=m;\n this.n=n;\n #if flash10 x=new flash.Vector(m*n,true);\n #else x=new Array();\n for(i in 0...(m*n)){\n x.push(0.0);\n }\n #end\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_ToiEvent{\n public var next:ZPP_ToiEvent=null;\n static public var zpp_pool:ZPP_ToiEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n failed=false;\n s1=s2=null;\n arbiter=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){}\n public var toi:Float=0.0;\n public var s1:ZPP_Shape=null;\n public var s2:ZPP_Shape=null;\n public var arbiter:ZPP_ColArbiter=null;\n public var frozen1:Bool=false;\n public var frozen2:Bool=false;\n public var c1:ZPP_Vec2=null;\n public var c2:ZPP_Vec2=null;\n public var axis:ZPP_Vec2=null;\n public var slipped:Bool=false;\n public var failed:Bool=false;\n public var kinematic:Bool=false;\n public function new(){\n c1=new ZPP_Vec2();\n c2=new ZPP_Vec2();\n axis=new ZPP_Vec2();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SweepDistance{\n static public function dynamicSweep(toi:ZPP_ToiEvent,timeStep:Float,lowerBound:Float,negRadius:Float,userAPI:Bool=false){\n var s1:ZPP_Shape=toi.s1;\n var s2:ZPP_Shape=toi.s2;\n var b1:ZPP_Body=s1.body;\n var b2:ZPP_Body=s2.body;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=b2.velx-b1.velx;\n deltay=b2.vely-b1.vely;\n };\n var ang1=b1.angvel;\n if(ang1<0)ang1=-ang1;\n var ang2=b2.angvel;\n if(ang2<0)ang2=-ang2;\n var angBias=(s1.sweepCoef*ang1)+(s2.sweepCoef*ang2);\n if(!userAPI&&!toi.kinematic&&(deltax*deltax+deltay*deltay)<(Config.dynamicSweepLinearThreshold*Config.dynamicSweepLinearThreshold)&&angBias0){\n toi.slipped=true;\n }\n if(proj<=0||sep=1){\n curTOI=1;\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n b2.sweepIntegrate(curTOI*timeStep);\n b2.sweepValidate(s2);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=40){\n if(sep>negRadius){\n toi.failed=true;\n }\n break;\n }\n }\n toi.toi=curTOI;\n }\n static public function staticSweep(toi:ZPP_ToiEvent,timeStep:Float,lowerBound:Float,negRadius:Float){\n var s1:ZPP_Shape=toi.s1;\n var s2:ZPP_Shape=toi.s2;\n var b1:ZPP_Body=s1.body;\n var b2:ZPP_Body=s2.body;\n var deltax:Float=0.0;\n var deltay:Float=0.0;\n {\n deltax=-b1.velx;\n deltay=-b1.vely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((deltax!=deltax));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(deltax)\"+\") :: \"+(\"vec_set(in n: \"+\"delta\"+\",in x: \"+\"-b1.velx\"+\",in y: \"+\"-b1.vely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((deltay!=deltay));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(deltay)\"+\") :: \"+(\"vec_set(in n: \"+\"delta\"+\",in x: \"+\"-b1.velx\"+\",in y: \"+\"-b1.vely\"+\")\");\n #end\n };\n };\n var ang1=b1.sweep_angvel;\n if(ang1<0)ang1=-ang1;\n var angBias=(s1.sweepCoef*ang1);\n var c1=toi.c1;\n var c2=toi.c2;\n var axis=toi.axis;\n var curTOI=lowerBound;\n var curIter=0;\n while(true){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(curTOI*timeStep!=curTOI*timeStep);\n };\n if(!res)throw \"assert(\"+\"!(curTOI*timeStep!=curTOI*timeStep)\"+\") :: \"+(curTOI+\" \"+timeStep);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(b1.sweepTime!=b1.sweepTime);\n };\n if(!res)throw \"assert(\"+\"!(b1.sweepTime!=b1.sweepTime)\"+\") :: \"+(\"sweeeeep\");\n #end\n };\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=1){\n curTOI=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(curTOI*timeStep!=curTOI*timeStep);\n };\n if(!res)throw \"assert(\"+\"!(curTOI*timeStep!=curTOI*timeStep)\"+\") :: \"+(curTOI+\" \"+timeStep);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(b1.sweepTime!=b1.sweepTime);\n };\n if(!res)throw \"assert(\"+\"!(b1.sweepTime!=b1.sweepTime)\"+\") :: \"+(\"sweeeeep\");\n #end\n };\n b1.sweepIntegrate(curTOI*timeStep);\n b1.sweepValidate(s1);\n var sep=distance(s1,s2,c1,c2,axis)+negRadius;\n var dot=(deltax*axis.x+deltay*axis.y);\n if(sep0){\n toi.slipped=true;\n }\n if(proj<=0||sep=40){\n if(sep>negRadius){\n toi.failed=true;\n }\n break;\n }\n }\n toi.toi=curTOI;\n }\n static public function distanceBody(b1:ZPP_Body,b2:ZPP_Body,w1:ZPP_Vec2,w2:ZPP_Vec2):Float{\n var t1;\n {\n if(ZPP_Vec2.zpp_pool==null){\n t1=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n t1=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=t1.next;\n t1.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n t1.alloc();\n };\n var t2;\n {\n if(ZPP_Vec2.zpp_pool==null){\n t2=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n t2=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=t2.next;\n t2.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n t2.alloc();\n };\n var ax;\n {\n if(ZPP_Vec2.zpp_pool==null){\n ax=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ax=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=ax.next;\n ax.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n ax.alloc();\n };\n var min=ZPP_Const.FMAX;\n {\n var cx_ite=b1.shapes.begin();\n while(cx_ite!=null){\n var s1=cx_ite.elem();\n {\n {\n var cx_ite=b2.shapes.begin();\n while(cx_ite!=null){\n var s2=cx_ite.elem();\n {\n var dist=distance(s1,s2,t1,t2,ax,min);\n if(distupperBound){\n best=dist;\n break;\n }\n if(dist>0){\n if(dist>best){\n best=dist;\n a0=a;\n }\n }\n else if(best<0&&dist>best){\n best=dist;\n a0=a;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(best=(v1.y*a0.gnormx-v1.x*a0.gnormy)){\n {\n var nx:Float=0.0;\n var ny:Float=0.0;\n {\n nx=circle.worldCOMx-v1.x;\n ny=circle.worldCOMy-v1.y;\n };\n var len=ZPP_Math.sqrt((nx*nx+ny*ny));\n best=len-(0+circle.radius);\n if(bestupperBound){\n best=min;\n break;\n }\n if(min>0){\n if(min>best){\n best=min;\n a1=a;\n besti=1;\n }\n }\n else if(best<0&&min>best){\n best=min;\n a1=a;\n besti=1;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(bestupperBound){\n best=min;\n break;\n }\n if(min>0){\n if(min>best){\n best=min;\n a2=a;\n besti=2;\n }\n }\n else if(best<0&&min>best){\n best=min;\n a2=a;\n besti=2;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(best=0){\n var v0=ax.gp0;\n var v1=ax.gp1;\n var q0=ay.gp0;\n var q1=ay.gp1;\n var vx:Float=0.0;\n var vy:Float=0.0;\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n vx=v1.x-v0.x;\n vy=v1.y-v0.y;\n };\n {\n qx=q1.x-q0.x;\n qy=q1.y-q0.y;\n };\n var vdot=1/(vx*vx+vy*vy);\n var qdot=1/(qx*qx+qy*qy);\n var t1=-(vx*(v0.x-q0.x)+vy*(v0.y-q0.y))*vdot;\n var t2=-(vx*(v0.x-q1.x)+vy*(v0.y-q1.y))*vdot;\n var s1=-(qx*(q0.x-v0.x)+qy*(q0.y-v0.y))*qdot;\n var s2=-(qx*(q0.x-v1.x)+qy*(q0.y-v1.y))*qdot;\n if(t1<0)t1=0;\n else if(t1>1)t1=1;\n if(t2<0)t2=0;\n else if(t2>1)t2=1;\n if(s1<0)s1=0;\n else if(s1>1)s1=1;\n if(s2<0)s2=0;\n else if(s2>1)s2=1;\n var f1x:Float=0.0;\n var f1y:Float=0.0;\n {\n var t=(t1);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n f1x=v0.x+(vx*t);\n f1y=v0.y+(vy*t);\n };\n var f2x:Float=0.0;\n var f2y:Float=0.0;\n {\n var t=(t2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n f2x=v0.x+(vx*t);\n f2y=v0.y+(vy*t);\n };\n var g1x:Float=0.0;\n var g1y:Float=0.0;\n {\n var t=(s1);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n g1x=q0.x+(qx*t);\n g1y=q0.y+(qy*t);\n };\n var g2x:Float=0.0;\n var g2y:Float=0.0;\n {\n var t=(s2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addmul()\");\n #end\n };\n g2x=q0.x+(qx*t);\n g2y=q0.y+(qy*t);\n };\n var d1=ZPP_VecMath.vec_dsq(f1x,f1y,q0.x,q0.y);\n var d2=ZPP_VecMath.vec_dsq(f2x,f2y,q1.x,q1.y);\n var e1=ZPP_VecMath.vec_dsq(g1x,g1y,v0.x,v0.y);\n var e2=ZPP_VecMath.vec_dsq(g2x,g2y,v1.x,v1.y);\n var minfx:Float=0.0;\n var minfy:Float=0.0;\n var minq=null;\n if(d1Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c0\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c0x+=dvx*t;\n c0y+=dvy*t;\n };\n var t=(-ax.tp0-d1)*den;\n if(t<-Config.epsilon){\n var t=(t);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c1\"+\",in b: \"+\"dv\"+\",in s: \"+\"t\"+\")\");\n #end\n };\n c1x+=dvx*t;\n c1y+=dvy*t;\n };\n var c0d=(c0x*ax.gnormx+c0y*ax.gnormy)-ax.gprojection;\n var c1d=(c1x*ax.gnormx+c1y*ax.gnormy)-ax.gprojection;\n if(c0dVoid>=null;\n public var _validate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate():Void{\n if(_invalidate!=null){\n _invalidate(this);\n }\n }\n public var _immutable:Bool=false;\n public var _isimmutable:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function immutable():Void{\n #if(!NAPE_RELEASE_BUILD)\n if(_immutable){\n throw \"Error: Vec2 is immutable\";\n }\n if(_isimmutable!=null){\n _isimmutable();\n }\n #end\n }\n public var outer:Null=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function wrapper():Vec2{\n if(outer==null){\n outer=new Vec2();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var weak:Bool=false;\n static public var zpp_pool:ZPP_Vec2=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free():Void{\n if(outer!=null){\n outer.zpp_inner=null;\n outer=null;\n }\n _isimmutable=null;\n _validate=null;\n _invalidate=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc():Void{\n weak=false;\n }\n public var next:ZPP_Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function elem():ZPP_Vec2{\n return this;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function begin():ZPP_Vec2{\n return next;\n }\n public var _inuse:Bool=false;\n public var modified:Bool=false;\n public var pushmod:Bool=false;\n public var length:Int=0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function setbegin(i:ZPP_Vec2):Void{\n next=i;\n modified=true;\n pushmod=true;\n }\n public function add(o:ZPP_Vec2):ZPP_Vec2{\n return inlined_add(o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_add(o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] add -> o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Vec2,o:ZPP_Vec2):ZPP_Vec2{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Vec2,o:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Vec2{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Vec2):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Vec2):ZPP_Vec2{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Vec2):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Vec2;\n var ret:ZPP_Vec2;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Vec2,n:Int):ZPP_Vec2{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Vec2):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Vec2):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Vec2\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Vec2{\n return begin().elem();\n }\n public function back():ZPP_Vec2{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Vec2{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n public var x:Float=0.0;\n public var y:Float=0.0;\n public function new(){}\n public static#if NAPE_NO_INLINE#else inline #end\n function get(x:Float,y:Float,immutable:Bool=false):ZPP_Vec2{\n var ret;\n {\n if(ZPP_Vec2.zpp_pool==null){\n ret=new ZPP_Vec2();\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_TOT++;\n ZPP_Vec2.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT--;\n ZPP_Vec2.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret._immutable=immutable;\n {\n ret.x=x;\n ret.y=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.x!=ret.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.x)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.y!=ret.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.y)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.\"+\",in x: \"+\"x\"+\",in y: \"+\"y\"+\")\");\n #end\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function copy():ZPP_Vec2{\n return get(x,y);\n }\n public function toString():String{\n return \"{ x: \"+x+\" y: \"+y+\" }\";\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Vec3{\n public var outer:Vec3=null;\n public var x:Float=0.0;\n public var y:Float=0.0;\n public var z:Float=0.0;\n public var immutable:Bool=false;\n public var _validate:NullVoid>=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate():Void{\n if(_validate!=null){\n _validate();\n }\n }\n public function new(){\n immutable=false;\n _validate=null;\n }\n}\n","package zpp_nape.geom;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_VecMath{\n public static#if NAPE_NO_INLINE#else inline #end\n function vec_dsq(ax:Float,ay:Float,bx:Float,by:Float):Float{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=ax-bx;\n dy=ay-by;\n };\n return(dx*dx+dy*dy);\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function vec_distance(ax:Float,ay:Float,bx:Float,by:Float):Float{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=ax-bx;\n dy=ay-by;\n };\n return ZPP_Math.sqrt((dx*dx+dy*dy));\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Interactor{\n public var outer_i:Interactor=null;\n public var id:Int=0;\n public var userData:Dynamic=null;\n public var ishape:ZPP_Shape=null;\n public var ibody:ZPP_Body=null;\n public var icompound:ZPP_Compound=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isShape(){\n return ishape!=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isBody(){\n return ibody!=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isCompound(){\n return icompound!=null;\n }\n public function __iaddedToSpace(){\n if(group!=null)group.addInteractor(this);\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.addInteractor(this);\n cx_ite=cx_ite.next;\n }\n };\n alloc_cbSet();\n }\n public function __iremovedFromSpace(){\n if(group!=null)group.remInteractor(this);\n {\n var cx_ite=cbTypes.begin();\n while(cx_ite!=null){\n var cb=cx_ite.elem();\n cb.remInteractor(this);\n cx_ite=cx_ite.next;\n }\n };\n dealloc_cbSet();\n }\n public function wake(){\n if(isShape()){\n var body=ishape.body;\n if(body!=null&&body.space!=null)body.space.non_inlined_wake(body);\n true;\n }\n else if(isBody()){\n if(ibody.space!=null)ibody.space.non_inlined_wake(ibody)else false;\n }\n else{\n if(icompound.space!=null)icompound.space.wakeCompound(icompound);\n true;\n }\n }\n public var cbsets:ZNPList_ZPP_CallbackSet=null;\n public static function get(i1:ZPP_Interactor,i2:ZPP_Interactor){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i1!=i2;\n };\n if(!res)throw \"assert(\"+\"i1!=i2\"+\") :: \"+(\"trying to get cbset between interactor and itself?\");\n #end\n };\n var id=if(i1.id=[null,BodyType.STATIC,BodyType.DYNAMIC,BodyType.KINEMATIC];\n public function invalidate_type(){\n invalidate_mass();\n invalidate_inertia();\n }\n public var compound:ZPP_Compound=null;\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n public function invalidate_shapes(){\n invalidate_aabb();\n invalidate_localCOM();\n invalidate_mass();\n invalidate_inertia();\n }\n public var space:ZPP_Space=null;\n public var arbiters:ZNPList_ZPP_Arbiter=null;\n public var wrap_arbiters:ArbiterList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n public var component:ZPP_Component=null;\n static var bodystack:ZNPList_ZPP_Body=null;\n static var bodyset:ZPP_Set_ZPP_Body=null;\n static function bodysetlt(a:ZPP_Body,b:ZPP_Body){\n return a.idlinSq)false;\n else if(ZPP_VecMath.vec_dsq(posx,posy,pre_posx,pre_posy)>0.25*linSq*dt*dt)false else{\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=aabb.maxx-aabb.minx;\n dy=aabb.maxy-aabb.miny;\n };\n var idl=(dx*dx+dy*dy);\n var angSq=Config.angularSleepThreshold;\n angSq*=angSq;\n if(4*angvel*angvel*idl>angSq)false else{\n var dr=rot-pre_rot;\n if(dr*dr*idl>angSq*dt*dt)false else true;\n }\n }\n if(!cansleep)component.waket=space.stamp;\n return component.waket+Config.sleepDelay0.0001)quick_validate_axis();\n else{\n var d2=dr*dr;\n var p=1-0.5*d2;\n var m=1-d2*d2/8;\n var nx=(p*axisx+dr*axisy)*m;\n axisy=(p*axisy-dr*axisx)*m;\n axisx=nx;\n }\n }\n public var kinematicDelaySleep:Bool;\n public var mass:Float=0.0;\n public var zip_mass:Bool=false;\n public var massMode:Int=0;\n public var imass:Float=0.0;\n public var smass:Float=0.0;\n public var cmass:Float=0.0;\n public var nomove:Bool=false;\n public function invalidate_mass(){\n zip_mass=true;\n invalidate_gravMass();\n }\n public function validate_mass(){\n var exist=false;\n if(zip_mass||(massMode==ZPP_Flags.id_MassMode_DEFAULT&&exist)){\n zip_mass=false;\n if(massMode==ZPP_Flags.id_MassMode_DEFAULT){\n cmass=0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.refmaterial.density=s.material.density;\n s.validate_area_inertia();\n cmass+=s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n if(isDynamic()&&!nomove){\n mass=cmass;\n imass=smass=1.0/mass;\n }\n else{\n mass=ZPP_Const.POSINF();\n imass=smass=0.0;\n }\n if(exist)invalidate_inertia();\n }\n }\n public var gravMass:Float=0.0;\n public var zip_gravMass:Bool=false;\n public var gravMassMode:Int=0;\n public var gravMassScale:Float=0.0;\n public var zip_gravMassScale:Bool=false;\n public function invalidate_gravMass(){\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_FIXED)zip_gravMass=true;\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)zip_gravMassScale=true;\n wake();\n }\n public function validate_gravMass(){\n if(zip_gravMass){\n zip_gravMass=false;\n validate_mass();\n if(gravMassMode==ZPP_Flags.id_GravMassMode_DEFAULT){\n validate_mass();\n gravMass=cmass;\n }\n else if(gravMassMode==ZPP_Flags.id_GravMassMode_SCALED){\n validate_mass();\n gravMass=cmass*gravMassScale;\n }\n }\n }\n public function invalidate_gravMassScale(){\n if(gravMassMode!=ZPP_Flags.id_GravMassMode_SCALED)zip_gravMassScale=true;\n else invalidate_gravMass();\n }\n public function validate_gravMassScale(){\n if(zip_gravMassScale){\n zip_gravMassScale=false;\n if(gravMassMode==ZPP_Flags.id_GravMassMode_DEFAULT)gravMassScale=1.0;\n else if(gravMassMode==ZPP_Flags.id_GravMassMode_FIXED){\n validate_mass();\n gravMassScale=gravMass/cmass;\n }\n }\n }\n public var inertiaMode:Int=0;\n public var inertia:Float=0.0;\n public var zip_inertia:Bool=false;\n public var cinertia:Float=0.0;\n public var iinertia:Float=0.0;\n public var sinertia:Float=0.0;\n public var norotate:Bool=false;\n public function invalidate_inertia(){\n zip_inertia=true;\n wake();\n }\n public function validate_inertia(){\n var exist=false;\n if(zip_inertia||(inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT&&exist)){\n zip_inertia=false;\n if(inertiaMode==ZPP_Flags.id_InertiaMode_DEFAULT){\n cinertia=0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.refmaterial.density=s.material.density;\n s.validate_area_inertia();\n cinertia+=s.inertia*s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n if(isDynamic()&&!norotate){\n inertia=cinertia;\n sinertia=iinertia=1.0/inertia;\n }\n else{\n inertia=ZPP_Const.POSINF();\n sinertia=iinertia=0;\n }\n if(exist)invalidate_inertia();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_wake(){\n wake();\n }\n public var aabb:ZPP_AABB=null;\n public var zip_aabb:Bool=false;\n public#if NAPE_NO_INLINE#else inline #end\n function validate_aabb(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: Body bounds only makes sense if it contains shapes\";\n #end\n if(zip_aabb){\n zip_aabb=false;\n {\n aabb.minx=ZPP_Const.POSINF();\n aabb.miny=ZPP_Const.POSINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=ZPP_Const.NEGINF();\n aabb.maxy=ZPP_Const.NEGINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"ZPP_Const.NEGINF()\"+\",in y: \"+\"ZPP_Const.NEGINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"ZPP_Const.NEGINF()\"+\",in y: \"+\"ZPP_Const.NEGINF()\"+\")\");\n #end\n };\n };\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.validate_aabb();\n aabb.combine(s.aabb);\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_aabb(){\n zip_aabb=true;\n }\n public var localCOMx:Float=0.0;\n public var localCOMy:Float=0.0;\n public var zip_localCOM:Bool=false;\n public var worldCOMx:Float=0.0;\n public var worldCOMy:Float=0.0;\n public var zip_worldCOM:Bool=false;\n public var wrap_localCOM:Vec2=null;\n public var wrap_worldCOM:Vec2=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_localCOM(){\n zip_localCOM=true;\n invalidate_worldCOM();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_worldCOM(){\n zip_worldCOM=true;\n }\n public function validate_localCOM(){\n if(zip_localCOM){\n zip_localCOM=false;\n var tempx:Float=0;\n var tempy:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((tempx!=tempx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(tempx)\"+\") :: \"+(\"vec_new(in n: \"+\"temp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((tempy!=tempy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(tempy)\"+\") :: \"+(\"vec_new(in n: \"+\"temp\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n var msum=0.0;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n s.validate_localCOM();\n s.validate_area_inertia();\n {\n var t=(s.area*s.material.density);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"temp\"+\",in b: \"+\"s.localCOM\"+\",in s: \"+\"s.area*s.material.density\"+\")\");\n #end\n };\n tempx+=s.localCOMx*t;\n tempy+=s.localCOMy*t;\n };\n msum+=s.area*s.material.density;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(msum!=0){\n {\n var t=(1.0/(msum));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_mul(in a: \"+\"temp\"+\",in s: \"+\"1.0/(msum)\"+\",out r: \"+\"localCOM\"+\")\");\n #end\n };\n localCOMx=tempx*t;\n localCOMy=tempy*t;\n };\n }\n if(wrap_localCOM!=null){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n if(zip_mass&&massMode==ZPP_Flags.id_MassMode_DEFAULT){\n zip_mass=false;\n cmass=msum;\n if(isDynamic()){\n mass=cmass;\n imass=smass=1.0/mass;\n }\n else{\n mass=ZPP_Const.POSINF();\n imass=smass=0.0;\n }\n }\n }\n }\n public function validate_worldCOM(){\n if(zip_worldCOM){\n zip_worldCOM=false;\n validate_localCOM();\n validate_axis();\n {\n worldCOMx=posx+(axisy*localCOMx-axisx*localCOMy);\n worldCOMy=posy+(localCOMx*axisx+localCOMy*axisy);\n };\n if(wrap_worldCOM!=null){\n wrap_worldCOM.zpp_inner.x=worldCOMx;\n wrap_worldCOM.zpp_inner.y=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.x!=wrap_worldCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.y!=wrap_worldCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n }\n }\n public function getlocalCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: localCOM only makes sense when Body has Shapes\";\n #end\n validate_localCOM();\n }\n public function getworldCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: worldCOM only makes sense when Body has Shapes\";\n #end\n validate_worldCOM();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: \"+name+\" cannot be set during a space step()\";\n #end\n }\n public function clear(){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null)throw \"Error: Cannot clear a Body if it is currently being used by a Space!\";\n #end\n #if(!NAPE_RELEASE_BUILD)\n if(!constraints.empty())throw \"Error: Cannot clear a Body if it is currently being used by a constraint!\";\n #end\n {\n while(!shapes.empty()){\n var s=shapes.pop_unsafe();\n {\n s.removedFromBody();\n s.body=null;\n };\n }\n };\n invalidate_shapes();\n {\n pre_posx=0;\n pre_posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posx!=pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posy!=pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n posx=0;\n posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posx!=posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posy!=posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n velx=0;\n vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((velx!=velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(velx)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vely!=vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vely)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n forcex=0;\n forcey=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcex!=forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcey!=forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n kinvelx=0;\n kinvely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvelx!=kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvely!=kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n svelx=0;\n svely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svelx!=svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svely!=svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svely)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n angvel=torque=kinangvel=pre_rot=rot=0;\n invalidate_pos();\n invalidate_rot();\n {\n axisx=0;\n axisy=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisx!=axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisy!=axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n zip_axis=false;\n massMode=ZPP_Flags.id_MassMode_DEFAULT;\n gravMassMode=ZPP_Flags.id_GravMassMode_DEFAULT;\n gravMassScale=1.0;\n inertiaMode=ZPP_Flags.id_InertiaMode_DEFAULT;\n norotate=false;\n nomove=false;\n }\n public static function __static():Body{\n var ret=new Body(BodyType.STATIC);\n var si=ret.zpp_inner;\n si.world=true;\n si.wrap_shapes.zpp_inner.immutable=true;\n si.smass=si.imass=si.cmass=si.mass=si.gravMass=0.0;\n si.sinertia=si.iinertia=si.cinertia=si.inertia=0.0;\n si.cbTypes.clear();\n return ret;\n }\n private function aabb_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(shapes.empty())throw \"Error: bounds only makes sense when Body has shapes\";\n #end\n validate_aabb();\n }\n private function shapes_adder(s:Shape){\n if(s.zpp_inner.body!=this){\n if(s.zpp_inner.body!=null)s.zpp_inner.body.wrap_shapes.remove(s);\n s.zpp_inner.body=this;\n s.zpp_inner.addedToBody();\n if(space!=null)space.added_shape(s.zpp_inner);\n if(s.zpp_inner.isPolygon()){\n s.zpp_inner.polygon.invalidate_gaxi();\n s.zpp_inner.polygon.invalidate_gverts();\n }\n return true;\n }\n else return false;\n }\n private function shapes_subber(s:Shape){\n if(space!=null)space.removed_shape(s.zpp_inner);\n s.zpp_inner.body=null;\n s.zpp_inner.removedFromBody();\n }\n private function shapes_invalidate(_){\n invalidate_shapes();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function shapes_modifiable(){\n immutable_midstep(\"Body::shapes\");\n if(isStatic()&&space!=null)throw \"Error: Cannot modifiy shapes of static object once added to Space\";\n }\n #end\n public function new(){\n super();\n ibody=this;\n world=false;\n bulletEnabled=false;\n sweepTime=0;\n sweep_angvel=0;\n norotate=nomove=false;\n disableCCD=false;\n {\n posx=0;\n posy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posx!=posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((posy!=posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n rot=0;\n {\n axisx=0;\n axisy=1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisx!=axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((axisy!=axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"axis\"+\",in x: \"+\"0\"+\",in y: \"+\"1\"+\")\");\n #end\n };\n };\n {\n svelx=0;\n svely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svelx!=svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((svely!=svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(svely)\"+\") :: \"+(\"vec_set(in n: \"+\"svel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n velx=0;\n vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((velx!=velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(velx)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((vely!=vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(vely)\"+\") :: \"+(\"vec_set(in n: \"+\"vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n kinvelx=0;\n kinvely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvelx!=kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((kinvely!=kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"kinvel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n forcex=0;\n forcey=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcex!=forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((forcey!=forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"force\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n torque=angvel=kinangvel=0;\n {\n pre_posx=ZPP_Const.POSINF();\n pre_posy=ZPP_Const.POSINF();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posx!=pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((pre_posy!=pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"pre_pos\"+\",in x: \"+\"ZPP_Const.POSINF()\"+\",in y: \"+\"ZPP_Const.POSINF()\"+\")\");\n #end\n };\n };\n pre_rot=ZPP_Const.POSINF();\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n worldCOMx=0;\n worldCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMx!=worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMy!=worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n zip_aabb=true;\n aabb=ZPP_AABB.get(0,0,0,0);\n aabb._immutable=true;\n var me=this;\n aabb._validate=aabb_validate;\n massMode=ZPP_Flags.id_MassMode_DEFAULT;\n gravMassMode=ZPP_Flags.id_GravMassMode_DEFAULT;\n gravMassScale=1.0;\n inertiaMode=ZPP_Flags.id_InertiaMode_DEFAULT;\n arbiters=new ZNPList_ZPP_Arbiter();\n constraints=new ZNPList_ZPP_Constraint();\n shapes=new ZNPList_ZPP_Shape();\n wrap_shapes=ZPP_ShapeList.get(shapes);\n wrap_shapes.zpp_inner.adder=shapes_adder;\n wrap_shapes.zpp_inner.subber=shapes_subber;\n wrap_shapes.zpp_inner._invalidate=shapes_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_shapes.zpp_inner._modifiable=shapes_modifiable;\n #end\n kinematicDelaySleep=false;\n }\n public function addedToSpace(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n component==null;\n };\n if(!res)throw \"assert(\"+\"component==null\"+\") :: \"+(\"already has a component?\");\n #end\n };\n {\n if(ZPP_Component.zpp_pool==null){\n component=new ZPP_Component();\n #if NAPE_POOL_STATS ZPP_Component.POOL_TOT++;\n ZPP_Component.POOL_ADDNEW++;\n #end\n }\n else{\n component=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=component.next;\n component.next=null;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT--;\n ZPP_Component.POOL_ADD++;\n #end\n }\n component.alloc();\n };\n component.isBody=true;\n component.body=this;\n __iaddedToSpace();\n }\n public function removedFromSpace(){\n while(!arbiters.empty()){\n var arb=arbiters.pop_unsafe();\n arb.lazyRetire(space,this);\n }\n {\n var o=component;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Component\"+\", in obj: \"+\"component\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Component.zpp_pool;\n ZPP_Component.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Component.POOL_CNT++;\n ZPP_Component.POOL_SUB++;\n #end\n };\n component=null;\n __iremovedFromSpace();\n }\n public function copy(){\n var ret=new Body().zpp_inner;\n ret.type=type;\n ret.bulletEnabled=bulletEnabled;\n ret.disableCCD=disableCCD;\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n ret.outer.shapes.add(s.outer.copy());\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n ret.posx=posx;\n ret.posy=posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.posx!=ret.posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.posx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.pos\"+\",in x: \"+\"posx\"+\",in y: \"+\"posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.posy!=ret.posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.posy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.pos\"+\",in x: \"+\"posx\"+\",in y: \"+\"posy\"+\")\");\n #end\n };\n };\n {\n ret.velx=velx;\n ret.vely=vely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.velx!=ret.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.vel\"+\",in x: \"+\"velx\"+\",in y: \"+\"vely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.vely!=ret.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.vel\"+\",in x: \"+\"velx\"+\",in y: \"+\"vely\"+\")\");\n #end\n };\n };\n {\n ret.forcex=forcex;\n ret.forcey=forcey;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.forcex!=ret.forcex));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.forcex)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.force\"+\",in x: \"+\"forcex\"+\",in y: \"+\"forcey\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.forcey!=ret.forcey));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.forcey)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.force\"+\",in x: \"+\"forcex\"+\",in y: \"+\"forcey\"+\")\");\n #end\n };\n };\n ret.rot=rot;\n ret.angvel=angvel;\n ret.torque=torque;\n {\n ret.kinvelx=kinvelx;\n ret.kinvely=kinvely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.kinvelx!=ret.kinvelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.kinvelx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.kinvel\"+\",in x: \"+\"kinvelx\"+\",in y: \"+\"kinvely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.kinvely!=ret.kinvely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.kinvely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.kinvel\"+\",in x: \"+\"kinvelx\"+\",in y: \"+\"kinvely\"+\")\");\n #end\n };\n };\n ret.kinangvel=kinangvel;\n {\n ret.svelx=svelx;\n ret.svely=svely;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.svelx!=ret.svelx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.svelx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.svel\"+\",in x: \"+\"svelx\"+\",in y: \"+\"svely\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.svely!=ret.svely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.svely)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.svel\"+\",in x: \"+\"svelx\"+\",in y: \"+\"svely\"+\")\");\n #end\n };\n };\n if(!zip_axis){\n ret.axisx=axisx;\n ret.axisy=axisy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.axisx!=ret.axisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.axisx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.axis\"+\",in x: \"+\"axisx\"+\",in y: \"+\"axisy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.axisy!=ret.axisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.axisy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.axis\"+\",in x: \"+\"axisx\"+\",in y: \"+\"axisy\"+\")\");\n #end\n };\n };\n else ret.invalidate_rot();\n ret.rot=rot;\n ret.massMode=massMode;\n ret.gravMassMode=gravMassMode;\n ret.inertiaMode=inertiaMode;\n ret.norotate=norotate;\n ret.nomove=nomove;\n ret.cmass=cmass;\n ret.cinertia=cinertia;\n if(!zip_mass)ret.mass=mass;\n else ret.invalidate_mass();\n if(!zip_gravMass)ret.gravMass=gravMass;\n else ret.invalidate_gravMass();\n if(!zip_gravMassScale)ret.gravMassScale=gravMassScale;\n else ret.invalidate_gravMassScale();\n if(!zip_inertia)ret.inertia=inertia;\n else ret.invalidate_inertia();\n if(!zip_aabb){\n {\n ret.aabb.minx=aabb.minx;\n ret.aabb.miny=aabb.miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.minx!=ret.aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.miny!=ret.aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n };\n {\n ret.aabb.maxx=aabb.maxx;\n ret.aabb.maxy=aabb.maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxx!=ret.aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxy!=ret.aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n };\n }\n else ret.invalidate_aabb();\n if(!zip_localCOM){\n ret.localCOMx=localCOMx;\n ret.localCOMy=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMx!=ret.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMy!=ret.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n else ret.invalidate_localCOM();\n if(!zip_worldCOM){\n ret.worldCOMx=worldCOMx;\n ret.worldCOMy=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.worldCOMx!=ret.worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.worldCOM\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.worldCOMy!=ret.worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.worldCOM\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n else ret.invalidate_worldCOM();\n copyto(ret.outer);\n return ret.outer;\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Compound extends ZPP_Interactor{\n public var outer:Compound=null;\n public var bodies:ZNPList_ZPP_Body=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var compounds:ZNPList_ZPP_Compound=null;\n public var wrap_bodies:BodyList=null;\n public var wrap_constraints:ConstraintList=null;\n public var wrap_compounds:CompoundList=null;\n public var depth:Int=0;\n public var compound:ZPP_Compound=null;\n public var space:ZPP_Space=null;\n public function __imutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(space!=null&&space.midstep)throw \"Error: \"+name+\" cannot be set during space step()\";\n #end\n }\n public function addedToSpace(){\n __iaddedToSpace();\n }\n public function removedFromSpace(){\n __iremovedFromSpace();\n }\n public function breakApart(){\n if(space!=null){\n __iremovedFromSpace();\n space.nullInteractorType(this);\n }\n if(compound!=null)compound.compounds.remove(this);\n else if(space!=null)space.compounds.remove(this);\n {\n while(!bodies.empty()){\n var b=bodies.pop_unsafe();\n {\n if((b.compound=compound)!=null)compound.bodies.add(b);\n else if(space!=null)space.bodies.add(b);\n if(space!=null)space.freshInteractorType(b);\n };\n }\n };\n {\n while(!constraints.empty()){\n var c=constraints.pop_unsafe();\n {\n if((c.compound=compound)!=null)compound.constraints.add(c);\n else if(space!=null)space.constraints.add(c);\n };\n }\n };\n {\n while(!compounds.empty()){\n var c=compounds.pop_unsafe();\n {\n if((c.compound=compound)!=null)compound.compounds.add(c);\n else if(space!=null)space.compounds.add(c);\n if(space!=null)space.freshInteractorType(c);\n };\n }\n };\n compound=null;\n space=null;\n }\n \n private function bodies_adder(x:Body){\n {}\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_bodies.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_bodies.remove(x);\n x.zpp_inner.compound=this;\n {};\n if(space!=null)space.addBody(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function bodies_subber(x:Body){\n x.zpp_inner.compound=null;\n {};\n if(space!=null)space.remBody(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function bodies_modifiable(){\n immutable_midstep(\"Compound::\"+\"bodies\");\n }\n #end\n private function constraints_adder(x:Constraint){\n {}\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_constraints.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_constraints.remove(x);\n x.zpp_inner.compound=this;\n {};\n if(space!=null)space.addConstraint(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function constraints_subber(x:Constraint){\n x.zpp_inner.compound=null;\n {};\n if(space!=null)space.remConstraint(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function constraints_modifiable(){\n immutable_midstep(\"Compound::\"+\"constraints\");\n }\n #end\n private function compounds_adder(x:Compound){\n #if(!NAPE_RELEASE_BUILD)\n var cur=this;\n while(cur!=null&&cur!=x.zpp_inner)cur=cur.compound;\n if(cur==x.zpp_inner){\n throw \"Error: Assignment would cause a cycle in the Compound tree: assigning \"+x.toString()+\".compound = \"+outer.toString();\n return false;\n }\n #end\n if(x.zpp_inner.compound!=this){\n if(x.zpp_inner.compound!=null)x.zpp_inner.compound.wrap_compounds.remove(x);\n else if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_compounds.remove(x);\n x.zpp_inner.compound=this;\n x.zpp_inner.depth=depth+1;\n if(space!=null)space.addCompound(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function compounds_subber(x:Compound){\n x.zpp_inner.compound=null;\n x.zpp_inner.depth=1;\n if(space!=null)space.remCompound(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function compounds_modifiable(){\n immutable_midstep(\"Compound::\"+\"compounds\");\n }\n #end\n public function new(){\n super();\n icompound=this;\n depth=1;\n var me=this;\n bodies=new ZNPList_ZPP_Body();\n wrap_bodies=ZPP_BodyList.get(bodies);\n wrap_bodies.zpp_inner.adder=bodies_adder;\n wrap_bodies.zpp_inner.subber=bodies_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_bodies.zpp_inner._modifiable=bodies_modifiable;\n #end\n constraints=new ZNPList_ZPP_Constraint();\n wrap_constraints=ZPP_ConstraintList.get(constraints);\n wrap_constraints.zpp_inner.adder=constraints_adder;\n wrap_constraints.zpp_inner.subber=constraints_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_constraints.zpp_inner._modifiable=constraints_modifiable;\n #end\n compounds=new ZNPList_ZPP_Compound();\n wrap_compounds=ZPP_CompoundList.get(compounds);\n wrap_compounds.zpp_inner.adder=compounds_adder;\n wrap_compounds.zpp_inner.subber=compounds_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_compounds.zpp_inner._modifiable=compounds_modifiable;\n #end\n }\n public function copy(dict:Array=null,todo:Array=null):Compound{\n var root=dict==null;\n if(dict==null)dict=new Array();\n if(todo==null)todo=new Array();\n var ret=new Compound();\n {\n var cx_ite=compounds.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n var cc=c.copy(dict,todo);\n cc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=bodies.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n var bc=b.outer.copy();\n dict.push(ZPP_CopyHelper.dict(b.id,bc));\n bc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=constraints.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n var cc=c.copy(dict,todo);\n cc.compound=ret;\n };\n cx_ite=cx_ite.next;\n }\n };\n if(root){\n while(todo.length>0){\n var xcb=todo.pop();\n for(idc in dict){\n if(idc.id==xcb.id){\n xcb.cb(idc.bc);\n break;\n }\n }\n }\n }\n copyto(ret);\n return ret;\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_FluidProperties{\n public var next:ZPP_FluidProperties=null;\n static public var zpp_pool:ZPP_FluidProperties=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:FluidProperties=null;\n public function wrapper(){\n if(outer==null){\n outer=new FluidProperties();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidProperties\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT++;\n ZPP_FluidProperties.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public function copy(){\n var ret;\n {\n if(ZPP_FluidProperties.zpp_pool==null){\n ret=new ZPP_FluidProperties();\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_TOT++;\n ZPP_FluidProperties.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_FluidProperties.zpp_pool;\n ZPP_FluidProperties.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_FluidProperties.POOL_CNT--;\n ZPP_FluidProperties.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n ret.viscosity=viscosity;\n ret.density=density;\n return ret;\n }\n public function new(){\n feature_cons();\n density=viscosity=1;\n wrap_gravity=null;\n {\n gravityx=0;\n gravityy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n }\n public var viscosity:Float=0.0;\n public var density:Float=0.0;\n public var gravityx:Float=0.0;\n public var gravityy:Float=0.0;\n public var wrap_gravity:Vec2=null;\n private function gravity_invalidate(x:ZPP_Vec2){\n {\n gravityx=x.x;\n gravityy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n invalidate();\n }\n private function gravity_validate(){\n {\n wrap_gravity.zpp_inner.x=gravityx;\n wrap_gravity.zpp_inner.y=gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.x!=wrap_gravity.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.y!=wrap_gravity.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n };\n }\n public function getgravity(){\n wrap_gravity=Vec2.get(gravityx,gravityy);\n wrap_gravity.zpp_inner._inuse=true;\n wrap_gravity.zpp_inner._invalidate=gravity_invalidate;\n wrap_gravity.zpp_inner._validate=gravity_validate;\n }\n public function invalidate(){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n shape.invalidate_fluidprops();\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.phys;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Material{\n public var next:ZPP_Material=null;\n static public var zpp_pool:ZPP_Material=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var userData:Dynamic=null;\n public var outer:Material=null;\n public function wrapper(){\n if(outer==null){\n outer=new Material();\n {\n var o=outer.zpp_inner;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Material\"+\", in obj: \"+\"outer.zpp_inner\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT++;\n ZPP_Material.POOL_SUB++;\n #end\n };\n outer.zpp_inner=this;\n }\n return outer;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n outer=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var shapes:ZNPList_ZPP_Shape=null;\n public var wrap_shapes:ShapeList=null;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function feature_cons(){\n shapes=new ZNPList_ZPP_Shape();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function addShape(shape:ZPP_Shape){\n shapes.add(shape);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function remShape(shape:ZPP_Shape){\n shapes.remove(shape);\n }\n public var dynamicFriction:Float=0.0;\n public var staticFriction:Float=0.0;\n public var density:Float=0.0;\n public var elasticity:Float=0.0;\n public var rollingFriction:Float=0.0;\n public function new(){\n feature_cons();\n elasticity=0;\n dynamicFriction=1;\n staticFriction=2;\n density=0.001;\n rollingFriction=0.01;\n }\n public function copy(){\n var ret=new ZPP_Material();\n ret.dynamicFriction=dynamicFriction;\n ret.staticFriction=staticFriction;\n ret.density=density;\n ret.elasticity=elasticity;\n ret.rollingFriction=rollingFriction;\n return ret;\n }\n public function set(x:ZPP_Material){\n dynamicFriction=x.dynamicFriction;\n staticFriction=x.staticFriction;\n density=x.density;\n elasticity=x.elasticity;\n rollingFriction=x.rollingFriction;\n }\n public static var WAKE=1;\n public static var PROPS=2;\n public static var ANGDRAG=4;\n public static var ARBITERS=8;\n public function invalidate(x:Int){\n {\n var cx_ite=shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n s.invalidate_material(x);\n cx_ite=cx_ite.next;\n }\n };\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Shape extends ZPP_Interactor{\n public var outer:Shape=null;\n public var body:ZPP_Body=null;\n public var type:Int=0;\n public static var types:Array=[ShapeType.CIRCLE,ShapeType.POLYGON];\n public#if NAPE_NO_INLINE#else inline #end\n function isCircle(){\n return type==ZPP_Flags.id_ShapeType_CIRCLE;\n }\n public#if NAPE_NO_INLINE#else inline #end\n function isPolygon(){\n return type==ZPP_Flags.id_ShapeType_POLYGON;\n }\n public var area:Float=0.0;\n public var zip_area_inertia:Bool=false;\n public var inertia:Float=0.0;\n public var angDrag:Float=0.0;\n public var zip_angDrag:Bool=false;\n public var localCOMx:Float=0.0;\n public var localCOMy:Float=0.0;\n public var zip_localCOM:Bool=false;\n public var worldCOMx:Float=0.0;\n public var worldCOMy:Float=0.0;\n public var zip_worldCOM:Bool=false;\n public var wrap_localCOM:Vec2=null;\n public var wrap_worldCOM:Vec2=null;\n public var sweepRadius:Float=0.0;\n public var zip_sweepRadius:Bool=false;\n public var sweepCoef:Float=0.0;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_sweepRadius(){\n zip_sweepRadius=true;\n }\n public function validate_sweepRadius(){\n if(zip_sweepRadius){\n zip_sweepRadius=false;\n if(isCircle())circle.__validate_sweepRadius();\n else polygon.__validate_sweepRadius();\n }\n }\n public var circle:ZPP_Circle=null;\n public var polygon:ZPP_Polygon=null;\n public var refmaterial:ZPP_Material=null;\n public var material:ZPP_Material=null;\n public var filter:ZPP_InteractionFilter=null;\n public var fluidProperties:ZPP_FluidProperties=null;\n public var fluidEnabled:Bool=false;\n public var sensorEnabled:Bool=false;\n public var sweep:ZPP_SweepData=null;\n public var node:ZPP_AABBNode=null;\n public var pairs:ZNPList_ZPP_AABBPair=null;\n public function clear(){\n if(isCircle())circle.__clear();\n else polygon.__clear();\n }\n public var aabb:ZPP_AABB=null;\n public var zip_aabb:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_aabb(){\n if(zip_aabb){\n if(body!=null){\n zip_aabb=false;\n if(isCircle())circle.__validate_aabb();\n else polygon.__validate_aabb();\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function force_validate_aabb(){\n if(isCircle())circle._force_validate_aabb();\n else polygon._force_validate_aabb();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function invalidate_aabb(){\n zip_aabb=true;\n if(body!=null)body.invalidate_aabb();\n }\n public function validate_area_inertia(){\n if(zip_area_inertia){\n zip_area_inertia=false;\n if(isCircle())circle.__validate_area_inertia();\n else polygon.__validate_area_inertia();\n }\n }\n public function validate_angDrag(){\n if(zip_angDrag||refmaterial.dynamicFriction!=material.dynamicFriction){\n zip_angDrag=false;\n refmaterial.dynamicFriction=material.dynamicFriction;\n if(isCircle())circle.__validate_angDrag();\n else polygon.__validate_angDrag();\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_localCOM(){\n if(zip_localCOM){\n zip_localCOM=false;\n if(isPolygon())polygon.__validate_localCOM();\n if(wrap_localCOM!=null){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_worldCOM(){\n if(zip_worldCOM){\n if(body!=null){\n zip_worldCOM=false;\n validate_localCOM();\n body.validate_axis();\n {\n worldCOMx=body.posx+(body.axisy*localCOMx-body.axisx*localCOMy);\n worldCOMy=body.posy+(localCOMx*body.axisx+localCOMy*body.axisy);\n };\n }\n }\n }\n public function getworldCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: worldCOM only makes sense when Shape belongs to a Body\";\n #end\n validate_worldCOM();\n {\n wrap_worldCOM.zpp_inner.x=worldCOMx;\n wrap_worldCOM.zpp_inner.y=worldCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.x!=wrap_worldCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_worldCOM.zpp_inner.y!=wrap_worldCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_worldCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_worldCOM.zpp_inner.\"+\",in x: \"+\"worldCOMx\"+\",in y: \"+\"worldCOMy\"+\")\");\n #end\n };\n };\n }\n public function invalidate_area_inertia(){\n zip_area_inertia=true;\n if(body!=null){\n body.invalidate_localCOM();\n body.invalidate_mass();\n body.invalidate_inertia();\n }\n }\n public function invalidate_angDrag(){\n zip_angDrag=true;\n }\n public function invalidate_localCOM(){\n zip_localCOM=true;\n invalidate_area_inertia();\n if(isCircle())invalidate_sweepRadius();\n invalidate_angDrag();\n invalidate_worldCOM();\n if(body!=null)body.invalidate_localCOM();\n }\n public function invalidate_worldCOM(){\n zip_worldCOM=true;\n invalidate_aabb();\n }\n public function invalidate_material(flags:Int){\n if((flags&ZPP_Material.WAKE)!=0)wake();\n if((flags&ZPP_Material.ARBITERS)!=0){\n if(body!=null)body.refreshArbiters();\n }\n if((flags&ZPP_Material.PROPS)!=0){\n if(body!=null){\n body.invalidate_localCOM();\n body.invalidate_mass();\n body.invalidate_inertia();\n }\n }\n if((flags&ZPP_Material.ANGDRAG)!=0){\n invalidate_angDrag();\n }\n refmaterial.set(material);\n }\n public function invalidate_filter(){\n wake();\n }\n public function invalidate_fluidprops(){\n if(fluidEnabled)wake();\n }\n private function aabb_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: bounds only makes sense when Shape belongs to a Body\";\n #end\n validate_aabb();\n }\n function new(type:Int){\n super();\n pairs=new ZNPList_ZPP_AABBPair();\n ishape=this;\n this.type=type;\n aabb=ZPP_AABB.get(0,0,0,0);\n aabb._immutable=true;\n var me=this;\n aabb._validate=aabb_validate;\n zip_area_inertia=zip_angDrag=zip_localCOM=zip_sweepRadius=true;\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n worldCOMx=0;\n worldCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMx!=worldCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((worldCOMy!=worldCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(worldCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"worldCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n fluidEnabled=false;\n sensorEnabled=false;\n fluidProperties=null;\n body=null;\n refmaterial=new ZPP_Material();\n sweepRadius=sweepCoef=0;\n }\n public function setMaterial(material:ZPP_Material){\n if(this.material!=material){\n if(body!=null&&body.space!=null){\n if(this.material!=null)this.material.remShape(this);\n }\n this.material=material;\n if(body!=null&&body.space!=null)material.addShape(this);\n wake();\n if(body!=null)body.refreshArbiters();\n }\n }\n public function setFilter(filter:ZPP_InteractionFilter){\n if(this.filter!=filter){\n if(body!=null&&body.space!=null){\n if(this.filter!=null)this.filter.remShape(this);\n }\n this.filter=filter;\n if(body!=null&&body.space!=null)filter.addShape(this);\n wake();\n }\n }\n public function setFluid(fluid:ZPP_FluidProperties){\n if(fluidProperties!=fluid){\n if(body!=null&&body.space!=null){\n if(fluidProperties!=null)fluidProperties.remShape(this);\n }\n fluidProperties=fluid;\n if(body!=null&&body.space!=null)fluid.addShape(this);\n if(fluidEnabled)wake();\n }\n }\n public function __immutable_midstep(name:String){\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body.space!=null&&body.space.midstep)throw \"Error: \"+name+\" cannot be set during a space step()\";\n #end\n }\n public function addedToBody(){\n invalidate_worldCOM();\n invalidate_aabb();\n }\n public function removedFromBody(){}\n public function addedToSpace(){\n __iaddedToSpace();\n material.addShape(this);\n filter.addShape(this);\n if(fluidProperties!=null)fluidProperties.addShape(this);\n }\n public function removedFromSpace(){\n __iremovedFromSpace();\n material.remShape(this);\n filter.remShape(this);\n if(fluidProperties!=null)fluidProperties.remShape(this);\n }\n public function copy(){\n var ret:ZPP_Shape=null;\n if(isCircle())ret=circle.__copy();\n else ret=polygon.__copy();\n if(!zip_area_inertia){\n ret.area=area;\n ret.inertia=inertia;\n }\n else ret.invalidate_area_inertia();\n if(!zip_sweepRadius){\n ret.sweepRadius=sweepRadius;\n ret.sweepCoef=sweepCoef;\n }\n else ret.invalidate_sweepRadius();\n if(!zip_angDrag)ret.angDrag=angDrag;\n else ret.invalidate_angDrag();\n if(!zip_aabb){\n {\n ret.aabb.minx=aabb.minx;\n ret.aabb.miny=aabb.miny;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.minx!=ret.aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.miny!=ret.aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.min\"+\",in x: \"+\"aabb.minx\"+\",in y: \"+\"aabb.miny\"+\")\");\n #end\n };\n };\n {\n ret.aabb.maxx=aabb.maxx;\n ret.aabb.maxy=aabb.maxy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxx!=ret.aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.aabb.maxy!=ret.aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.aabb.max\"+\",in x: \"+\"aabb.maxx\"+\",in y: \"+\"aabb.maxy\"+\")\");\n #end\n };\n };\n }\n else ret.invalidate_aabb();\n {\n var o=ret.material;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Material\"+\", in obj: \"+\"ret.material\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Material.zpp_pool;\n ZPP_Material.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Material.POOL_CNT++;\n ZPP_Material.POOL_SUB++;\n #end\n };\n {\n var o=ret.filter;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_InteractionFilter\"+\", in obj: \"+\"ret.filter\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_InteractionFilter.zpp_pool;\n ZPP_InteractionFilter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_InteractionFilter.POOL_CNT++;\n ZPP_InteractionFilter.POOL_SUB++;\n #end\n };\n ret.material=material;\n ret.filter=filter;\n if(fluidProperties!=null)ret.fluidProperties=fluidProperties;\n ret.fluidEnabled=fluidEnabled;\n ret.sensorEnabled=sensorEnabled;\n if(userData!=null)ret.userData=Reflect.copy(userData);\n copyto(ret.outer);\n return ret.outer;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Circle extends ZPP_Shape{\n public var outer_zn:Circle=null;\n public var radius:Float=0.0;\n public function new(){\n super(ZPP_Flags.id_ShapeType_CIRCLE);\n circle=this;\n zip_localCOM=false;\n }\n public function __clear(){}\n public function invalidate_radius(){\n invalidate_area_inertia();\n invalidate_angDrag();\n invalidate_aabb();\n if(body!=null)body.wake();\n }\n private function localCOM_validate(){\n wrap_localCOM.zpp_inner.x=localCOMx;\n wrap_localCOM.zpp_inner.y=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.x!=wrap_localCOM.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_localCOM.zpp_inner.y!=wrap_localCOM.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_localCOM.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_localCOM.zpp_inner.\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n }\n private function localCOM_invalidate(x:ZPP_Vec2){\n {\n localCOMx=x.x;\n localCOMy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n invalidate_localCOM();\n if(body!=null)body.wake();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function localCOM_immutable(){\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modify localCOM of Circle added to a static Body whilst within a Space\";\n }\n #end\n public function setupLocalCOM(){\n var me=this;\n wrap_localCOM=Vec2.get(localCOMx,localCOMy);\n wrap_localCOM.zpp_inner._inuse=true;\n wrap_localCOM.zpp_inner._validate=localCOM_validate;\n wrap_localCOM.zpp_inner._invalidate=localCOM_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_localCOM.zpp_inner._isimmutable=localCOM_immutable;\n #end\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_aabb(){\n validate_worldCOM();\n var rx:Float=radius;\n var ry:Float=radius;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((rx!=rx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(rx)\"+\") :: \"+(\"vec_new(in n: \"+\"r\"+\",in x: \"+\"radius\"+\",in y: \"+\"radius\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ry!=ry));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ry)\"+\") :: \"+(\"vec_new(in n: \"+\"r\"+\",in x: \"+\"radius\"+\",in y: \"+\"radius\"+\")\");\n #end\n };\n {\n aabb.minx=worldCOMx-rx;\n aabb.miny=worldCOMy-ry;\n };\n {\n aabb.maxx=worldCOMx+rx;\n aabb.maxy=worldCOMy+ry;\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function _force_validate_aabb(){\n {\n worldCOMx=body.posx+(body.axisy*localCOMx-body.axisx*localCOMy);\n worldCOMy=body.posy+(localCOMx*body.axisx+localCOMy*body.axisy);\n };\n aabb.minx=worldCOMx-radius;\n aabb.miny=worldCOMy-radius;\n aabb.maxx=worldCOMx+radius;\n aabb.maxy=worldCOMy+radius;\n }\n public function __validate_sweepRadius(){\n sweepCoef=Math.sqrt((localCOMx*localCOMx+localCOMy*localCOMy));\n sweepRadius=sweepCoef+radius;\n }\n public function __validate_area_inertia(){\n var r2=radius*radius;\n area=r2*Math.PI;\n inertia=r2*0.5+(localCOMx*localCOMx+localCOMy*localCOMy);\n }\n public function __validate_angDrag(){\n var lc=(localCOMx*localCOMx+localCOMy*localCOMy);\n var r2=radius*radius;\n var skin=material.dynamicFriction*Config.fluidAngularDragFriction;\n angDrag=(lc+2*r2)*skin+0.5*Config.fluidAngularDrag*(1+Config.fluidVacuumDrag)*lc;\n angDrag/=(2*(lc+0.5*r2));\n }\n public function __scale(sx:Float,sy:Float){\n var factor=((sx<0?-sx:sx)+(sy<0?-sy:sy))/2;\n radius*=factor<0?-factor:factor;\n invalidate_radius();\n if((localCOMx*localCOMx+localCOMy*localCOMy)>0){\n localCOMx*=sx;\n localCOMy*=sy;\n invalidate_localCOM();\n }\n }\n public function __translate(x:Float,y:Float){\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"localCOM\"+\",in b: \"+\"\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n localCOMx+=x*t;\n localCOMy+=y*t;\n };\n invalidate_localCOM();\n }\n public function __rotate(x:Float,y:Float){\n if((localCOMx*localCOMx+localCOMy*localCOMy)>0){\n var tx:Float=0.0;\n var ty:Float=0.0;\n {\n tx=(y*localCOMx-x*localCOMy);\n ty=(localCOMx*x+localCOMy*y);\n };\n {\n localCOMx=tx;\n localCOMy=ty;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"tx\"+\",in y: \"+\"ty\"+\")\");\n #end\n };\n };\n invalidate_localCOM();\n }\n }\n public function __transform(m:Mat23){\n var det=(m.a*m.d-m.b*m.c);\n if(det<0)det=-det;\n radius*=Math.sqrt(det);\n {\n var t=m.a*localCOMx+m.b*localCOMy+m.tx;\n localCOMy=m.c*localCOMx+m.d*localCOMy+m.ty;\n localCOMx=t;\n };\n invalidate_radius();\n invalidate_localCOM();\n }\n public function __copy(){\n var ret=new Circle(radius).zpp_inner_zn;\n {\n ret.localCOMx=localCOMx;\n ret.localCOMy=localCOMy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMx!=ret.localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((ret.localCOMy!=ret.localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(ret.localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"ret.localCOM\"+\",in x: \"+\"localCOMx\"+\",in y: \"+\"localCOMy\"+\")\");\n #end\n };\n };\n ret.zip_localCOM=false;\n return ret;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Edge{\n public var next:ZPP_Edge=null;\n static public var zpp_pool:ZPP_Edge=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n polygon=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var polygon:ZPP_Polygon=null;\n static public var internal:Bool=false;\n public var outer:Edge=null;\n public function wrapper(){\n if(outer==null){\n internal=true;\n outer=new Edge();\n internal=false;\n outer.zpp_inner=this;\n }\n return outer;\n }\n public var lnormx:Float=0.0;\n public var lnormy:Float=0.0;\n public var wrap_lnorm:Vec2=null;\n public var gnormx:Float=0.0;\n public var gnormy:Float=0.0;\n public var wrap_gnorm:Vec2=null;\n public var length:Float=0.0;\n public var lprojection:Float=0.0;\n public var gprojection:Float=0.0;\n public var lp0:ZPP_Vec2=null;\n public var gp0:ZPP_Vec2=null;\n public var lp1:ZPP_Vec2=null;\n public var gp1:ZPP_Vec2=null;\n public var tp0:Float=0.0;\n public var tp1:Float=0.0;\n private function lnorm_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(polygon==null)throw \"Error: Edge not currently in use\";\n #end\n polygon.validate_laxi();\n {\n wrap_lnorm.zpp_inner.x=lnormx;\n wrap_lnorm.zpp_inner.y=lnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_lnorm.zpp_inner.x!=wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_lnorm.zpp_inner.\"+\",in x: \"+\"lnormx\"+\",in y: \"+\"lnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_lnorm.zpp_inner.y!=wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_lnorm.zpp_inner.\"+\",in x: \"+\"lnormx\"+\",in y: \"+\"lnormy\"+\")\");\n #end\n };\n };\n }\n private function gnorm_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(polygon==null)throw \"Error: Edge not currently in use\";\n if(polygon.body==null)throw \"Error: Edge worldNormal only makes sense if the parent Polygon is contained within a rigid body\";\n #end\n polygon.validate_gaxi();\n {\n wrap_gnorm.zpp_inner.x=gnormx;\n wrap_gnorm.zpp_inner.y=gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gnorm.zpp_inner.x!=wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gnorm.zpp_inner.\"+\",in x: \"+\"gnormx\"+\",in y: \"+\"gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gnorm.zpp_inner.y!=wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gnorm.zpp_inner.\"+\",in x: \"+\"gnormx\"+\",in y: \"+\"gnormy\"+\")\");\n #end\n };\n };\n }\n public function getlnorm(){\n wrap_lnorm=Vec2.get(lnormx,lnormy);\n wrap_lnorm.zpp_inner._immutable=true;\n wrap_lnorm.zpp_inner._validate=lnorm_validate;\n }\n public function getgnorm(){\n wrap_gnorm=Vec2.get(gnormx,gnormy);\n wrap_gnorm.zpp_inner._immutable=true;\n wrap_gnorm.zpp_inner._validate=gnorm_validate;\n }\n public function new(){\n {\n lnormx=0;\n lnormy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((lnormx!=lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"lnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((lnormy!=lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"lnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n {\n gnormx=0;\n gnormy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gnormx!=gnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"gnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gnormy!=gnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"gnorm\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n length=0;\n lprojection=0;\n gprojection=0;\n }\n}\n","package zpp_nape.shape;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Polygon extends ZPP_Shape{\n public var outer_zn:Polygon=null;\n public var lverts:ZPP_Vec2=null;\n public var wrap_lverts:Vec2List=null;\n public var gverts:ZPP_Vec2=null;\n public var wrap_gverts:Vec2List=null;\n public var edges:ZNPList_ZPP_Edge=null;\n public var wrap_edges:EdgeList=null;\n public var edgeCnt:Int=0;\n public var reverse_flag:Bool=false;\n public function __clear(){}\n private function lverts_pa_invalidate(x:ZPP_Vec2){\n invalidate_lverts();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function lverts_pa_immutable(){\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modify local vertex of Polygon added to a static body whilst within a Space\";\n }\n #end\n private function gverts_pa_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(body==null)throw \"Error: World vertex only makes sense when Polygon is contained in a rigid body\";\n #end\n validate_gverts();\n }\n private function lverts_post_adder(x:Vec2){\n x.zpp_inner._invalidate=lverts_pa_invalidate;\n #if(!NAPE_RELEASE_BUILD)\n x.zpp_inner._isimmutable=lverts_pa_immutable;\n #end\n var ite:ZPP_Vec2=null;\n var ite2:ZNPNode_ZPP_Edge=null;\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i==x.zpp_inner)break;\n else{\n ite=ite==null?gverts.begin():ite.next;\n ite2=ite2==null?edges.begin():ite2.next;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n var vec=ZPP_Vec2.get(0,0,true);\n gverts.insert(ite,vec);\n if(lverts.begin().next!=null){\n if(lverts.begin().next.next==null){\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.add(ed);\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.add(ed);\n edgeCnt+=2;\n }\n else{\n var ed:ZPP_Edge;\n {\n if(ZPP_Edge.zpp_pool==null){\n ed=new ZPP_Edge();\n #if NAPE_POOL_STATS ZPP_Edge.POOL_TOT++;\n ZPP_Edge.POOL_ADDNEW++;\n #end\n }\n else{\n ed=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=ed.next;\n ed.next=null;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT--;\n ZPP_Edge.POOL_ADD++;\n #end\n }\n ed.alloc();\n };\n ed.polygon=this;\n edges.insert(ite2,ed);\n edgeCnt++;\n }\n }\n vec._validate=gverts_pa_validate;\n }\n private function lverts_subber(x:Vec2){\n cleanup_lvert(x.zpp_inner);\n }\n private function lverts_invalidate(_){\n invalidate_lverts();\n }\n private function lverts_validate(){\n validate_lverts();\n }\n #if(!NAPE_RELEASE_BUILD)\n private function lverts_modifiable(){\n immutable_midstep(\"Polygon::localVerts\");\n #if(!NAPE_RELEASE_BUILD)\n if(body!=null&&body.isStatic()&&body.space!=null)throw \"Error: Cannot modifiy shapes of static object once added to Space\";\n #end\n }\n #end\n private function gverts_validate(){\n validate_gverts();\n }\n private function edges_validate(){\n validate_lverts();\n }\n #if nape_swc@:keep #end\n public function getlverts(){\n var me=this;\n wrap_lverts=ZPP_MixVec2List.get(lverts);\n wrap_lverts.zpp_inner.post_adder=lverts_post_adder;\n wrap_lverts.zpp_inner.subber=lverts_subber;\n wrap_lverts.zpp_inner._invalidate=lverts_invalidate;\n wrap_lverts.zpp_inner._validate=lverts_validate;\n #if(!NAPE_RELEASE_BUILD)\n wrap_lverts.zpp_inner._modifiable=lverts_modifiable;\n #end\n wrap_lverts.zpp_inner.reverse_flag=reverse_flag;\n }\n public function getgverts(){\n var me=this;\n wrap_gverts=ZPP_MixVec2List.get(gverts,true);\n wrap_gverts.zpp_inner.reverse_flag=reverse_flag;\n wrap_gverts.zpp_inner._validate=gverts_validate;\n }\n public function getedges(){\n var me=this;\n wrap_edges=ZPP_EdgeList.get(edges,true);\n wrap_edges.zpp_inner.reverse_flag=reverse_flag;\n wrap_edges.zpp_inner._validate=edges_validate;\n }\n public var zip_lverts:Bool=false;\n public function invalidate_lverts(){\n invalidate_laxi();\n invalidate_area_inertia();\n invalidate_angDrag();\n invalidate_localCOM();\n invalidate_gverts();\n zip_lverts=true;\n zip_valid=true;\n zip_sanitation=true;\n if(body!=null)body.wake();\n }\n public var zip_laxi:Bool=false;\n public function invalidate_laxi(){\n invalidate_gaxi();\n invalidate_sweepRadius();\n zip_laxi=true;\n }\n public var zip_gverts:Bool=false;\n public function invalidate_gverts(){\n invalidate_aabb();\n zip_gverts=true;\n }\n public var zip_gaxi:Bool=false;\n public function invalidate_gaxi(){\n zip_gaxi=true;\n }\n public var zip_valid:Bool=false;\n public var validation:ValidationResult;\n public function valid(){\n if(zip_valid){\n zip_valid=false;\n splice_collinear();\n if(lverts.size()<3)return validation=ValidationResult.DEGENERATE;\n else{\n validate_lverts();\n validate_area_inertia();\n if(areaConfig.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg){\n cx_cont=false;\n break;\n };\n };\n {\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n cx_ite=lverts.begin();\n var w=cx_ite.elem();\n do{\n {\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>Config.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg){\n cx_cont=false;\n break;\n };\n };\n }\n while(false);\n if(cx_cont){\n {\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n };\n var w=cx_ite.elem();\n do{\n {\n var ax:Float=0.0;\n var ay:Float=0.0;\n {\n ax=w.x-v.x;\n ay=w.y-v.y;\n };\n var bx:Float=0.0;\n var by:Float=0.0;\n {\n bx=v.x-u.x;\n by=v.y-u.y;\n };\n var dot=(by*ax-bx*ay);\n if(dot>Config.epsilon)pos=true;\n else if(dot<-Config.epsilon)neg=true;\n if(pos&&neg)break;\n };\n }\n while(false);\n }\n }\n };\n if(pos&&neg)return validation=ValidationResult.CONCAVE;\n else{\n var cont=true;\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n if(!cont){\n cx_cont=false;\n break;\n };\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var a=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(u==a||u==b||v==a||v==b){\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n continue;\n };\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n {\n cx_cont=false;\n break;\n };\n }\n }\n }\n };\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var b=lverts.front();\n {\n if(u==a||u==b||v==a||v==b)break;\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n break;\n }\n }\n }\n };\n }\n while(false);\n }\n };\n };\n {\n u=v;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var v=lverts.front();\n {\n if(!cont)break;\n {\n var cx_cont=true;\n var cx_ite=lverts.begin();\n var a=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n if(u==a||u==b||v==a||v==b){\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n continue;\n };\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n {\n cx_cont=false;\n break;\n };\n }\n }\n }\n };\n {\n a=b;\n cx_ite=cx_ite.next;\n };\n }\n if(cx_cont){\n do{\n var b=lverts.front();\n {\n if(u==a||u==b||v==a||v==b)break;\n var sx:Float=0.0;\n var sy:Float=0.0;\n {\n sx=u.x-a.x;\n sy=u.y-a.y;\n };\n var vx:Float=0.0;\n var vy:Float=0.0;\n {\n vx=v.x-u.x;\n vy=v.y-u.y;\n };\n var qx:Float=0.0;\n var qy:Float=0.0;\n {\n qx=b.x-a.x;\n qy=b.y-a.y;\n };\n var den=(vy*qx-vx*qy);\n if(den*den>Config.epsilon){\n den=1/den;\n var t=(qy*sx-qx*sy)*den;\n if(t>Config.epsilon&&t<1-Config.epsilon){\n var s=(vy*sx-vx*sy)*den;\n if(s>Config.epsilon&&s<1-Config.epsilon){\n cont=false;\n break;\n }\n }\n }\n };\n }\n while(false);\n }\n };\n };\n }\n while(false);\n }\n };\n if(!cont)return validation=ValidationResult.SELF_INTERSECTING;\n else return validation=ValidationResult.VALID;\n }\n }\n }\n }\n else return validation;\n }\n public function validate_lverts(){\n if(zip_lverts){\n zip_lverts=false;\n if(lverts.size()>2){\n validate_area_inertia();\n if(area<0){\n reverse_vertices();\n area=-area;\n }\n }\n }\n }\n public function cleanup_lvert(x:ZPP_Vec2){\n var ite:ZPP_Vec2=null;\n var ite2:ZNPNode_ZPP_Edge=null;\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i==x)break;\n else{\n ite=ite==null?gverts.begin():ite.next;\n ite2=ite2==null?edges.begin():ite2.next;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n var rem=(ite==null?gverts.front():ite.next.elem());\n gverts.erase(ite);\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n if(edgeCnt==2){\n var rem=edges.pop_unsafe();\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n rem=edges.pop_unsafe();\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n edgeCnt=0;\n }\n else if(edgeCnt!=0){\n var rem=(ite2==null?edges.front():ite2.next.elem());\n edges.erase(ite2);\n {\n var o=rem;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Edge\"+\", in obj: \"+\"rem\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Edge.zpp_pool;\n ZPP_Edge.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Edge.POOL_CNT++;\n ZPP_Edge.POOL_SUB++;\n #end\n };\n edgeCnt--;\n }\n }\n public var zip_sanitation:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function splice_collinear(){\n if(zip_sanitation){\n zip_sanitation=false;\n splice_collinear_real();\n }\n }\n public function splice_collinear_real(){\n if(lverts.begin()==null)return;\n if(lverts.begin().next==null)return;\n if(lverts.begin().next.next==null)return;\n var pre=null;\n var cur=lverts.begin();\n while(cur!=null){\n var nxt=if(cur.next==null)lverts.begin()else cur.next;\n var u=cur.elem();\n var v=nxt.elem();\n if(ZPP_VecMath.vec_dsq(u.x,u.y,v.x,v.y)=Config.epsilon*Config.epsilon){\n pre=pre.next;\n }\n else{\n cleanup_lvert(cur.elem());\n lverts.erase(pre.next==null?null:pre);\n removed=true;\n pre=pre.next;\n }\n }\n }\n while(removed);\n }\n public function reverse_vertices(){\n lverts.reverse();\n gverts.reverse();\n edges.reverse();\n var ite=edges.iterator_at(edgeCnt-1);\n var elem=edges.pop_unsafe();\n edges.insert(ite,elem);\n reverse_flag=!reverse_flag;\n if(wrap_lverts!=null)wrap_lverts.zpp_inner.reverse_flag=reverse_flag;\n if(wrap_gverts!=null)wrap_gverts.zpp_inner.reverse_flag=reverse_flag;\n if(wrap_edges!=null)wrap_edges.zpp_inner.reverse_flag=reverse_flag;\n }\n public function validate_laxi(){\n if(zip_laxi){\n zip_laxi=false;\n validate_lverts();\n var ite=edges.begin();\n {\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var edge=ite.elem();\n ite=ite.next;\n edge.lp0=u;\n edge.lp1=v;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=u.x-v.x;\n dy=u.y-v.y;\n };\n var l=Math.sqrt((dx*dx+dy*dy));\n edge.length=l;\n {\n var t=(1.0/(l));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"d\"+\",in s: \"+\"1.0/(l)\"+\")\");\n #end\n };\n dx*=t;\n dy*=t;\n };\n {\n var t=dx;\n dx=-dy;\n dy=t;\n };\n edge.lprojection=(dx*u.x+dy*u.y);\n {\n edge.lnormx=dx;\n edge.lnormy=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormx!=edge.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormy!=edge.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n if(edge.wrap_lnorm!=null){\n edge.wrap_lnorm.zpp_inner.x=dx;\n edge.wrap_lnorm.zpp_inner.y=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.x!=edge.wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.y!=edge.wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n };\n u=v;\n cx_ite=cx_ite.next;\n }\n var v=lverts.front();\n {\n var edge=ite.elem();\n ite=ite.next;\n edge.lp0=u;\n edge.lp1=v;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=u.x-v.x;\n dy=u.y-v.y;\n };\n var l=Math.sqrt((dx*dx+dy*dy));\n edge.length=l;\n {\n var t=(1.0/(l));\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"d\"+\",in s: \"+\"1.0/(l)\"+\")\");\n #end\n };\n dx*=t;\n dy*=t;\n };\n {\n var t=dx;\n dx=-dy;\n dy=t;\n };\n edge.lprojection=(dx*u.x+dy*u.y);\n {\n edge.lnormx=dx;\n edge.lnormy=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormx!=edge.lnormx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormx)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.lnormy!=edge.lnormy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.lnormy)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.lnorm\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n if(edge.wrap_lnorm!=null){\n edge.wrap_lnorm.zpp_inner.x=dx;\n edge.wrap_lnorm.zpp_inner.y=dy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.x!=edge.wrap_lnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((edge.wrap_lnorm.zpp_inner.y!=edge.wrap_lnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(edge.wrap_lnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"edge.wrap_lnorm.zpp_inner.\"+\",in x: \"+\"dx\"+\",in y: \"+\"dy\"+\")\");\n #end\n };\n };\n };\n };\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate_gverts(){\n if(zip_gverts){\n if(body!=null){\n zip_gverts=false;\n validate_lverts();\n body.validate_axis();\n var li=lverts.begin();\n {\n var cx_ite=gverts.begin();\n while(cx_ite!=null){\n var g=cx_ite.elem();\n {\n var l=li.elem();\n li=li.next;\n {\n g.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n g.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public#if NAPE_NO_INLINE#else inline #end\n function validate_gaxi(){\n if(zip_gaxi){\n if(body!=null){\n zip_gaxi=false;\n validate_laxi();\n body.validate_axis();\n validate_gverts();\n var ite=edges.begin();\n {\n var cx_ite=gverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var v=cx_ite.elem();\n {\n var e=ite.elem();\n ite=ite.next;\n e.gp0=u;\n e.gp1=v;\n {\n e.gnormx=(body.axisy*e.lnormx-body.axisx*e.lnormy);\n e.gnormy=(e.lnormx*body.axisx+e.lnormy*body.axisy);\n };\n e.gprojection=(body.posx*e.gnormx+body.posy*e.gnormy)+e.lprojection;\n if(e.wrap_gnorm!=null){\n e.wrap_gnorm.zpp_inner.x=e.gnormx;\n e.wrap_gnorm.zpp_inner.y=e.gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.x!=e.wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.y!=e.wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n };\n e.tp0=(e.gp0.y*e.gnormx-e.gp0.x*e.gnormy);\n e.tp1=(e.gp1.y*e.gnormx-e.gp1.x*e.gnormy);\n };\n u=v;\n cx_ite=cx_ite.next;\n }\n var v=gverts.front();\n {\n var e=ite.elem();\n ite=ite.next;\n e.gp0=u;\n e.gp1=v;\n {\n e.gnormx=(body.axisy*e.lnormx-body.axisx*e.lnormy);\n e.gnormy=(e.lnormx*body.axisx+e.lnormy*body.axisy);\n };\n e.gprojection=(body.posx*e.gnormx+body.posy*e.gnormy)+e.lprojection;\n if(e.wrap_gnorm!=null){\n e.wrap_gnorm.zpp_inner.x=e.gnormx;\n e.wrap_gnorm.zpp_inner.y=e.gnormy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.x!=e.wrap_gnorm.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((e.wrap_gnorm.zpp_inner.y!=e.wrap_gnorm.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(e.wrap_gnorm.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"e.wrap_gnorm.zpp_inner.\"+\",in x: \"+\"e.gnormx\"+\",in y: \"+\"e.gnormy\"+\")\");\n #end\n };\n };\n e.tp0=(e.gp0.y*e.gnormx-e.gp0.x*e.gnormy);\n e.tp1=(e.gp1.y*e.gnormx-e.gp1.x*e.gnormy);\n };\n };\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_aabb(){\n validate_gverts();\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon has no meaningful bounds\";\n #end\n var p0=gverts.front();\n {\n aabb.minx=p0.x;\n aabb.miny=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=p0.x;\n aabb.maxy=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n var cx_ite=gverts.begin().next;\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n if(p.xaabb.maxx)aabb.maxx=p.x;\n if(p.yaabb.maxy)aabb.maxy=p.y;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function _force_validate_aabb(){\n var li=lverts.begin();\n var p0=gverts.front();\n var l=li.elem();\n li=li.next;\n {\n p0.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n p0.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n {\n aabb.minx=p0.x;\n aabb.miny=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.minx!=aabb.minx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.minx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.miny!=aabb.miny));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.miny)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.min\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n aabb.maxx=p0.x;\n aabb.maxy=p0.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxx!=aabb.maxx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxx)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((aabb.maxy!=aabb.maxy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(aabb.maxy)\"+\") :: \"+(\"vec_set(in n: \"+\"aabb.max\"+\",in x: \"+\"p0.x\"+\",in y: \"+\"p0.y\"+\")\");\n #end\n };\n };\n {\n var cx_ite=gverts.begin().next;\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var l=li.elem();\n li=li.next;\n {\n p.x=body.posx+(body.axisy*l.x-body.axisx*l.y);\n p.y=body.posy+(l.x*body.axisx+l.y*body.axisy);\n };\n if(p.xaabb.maxx)aabb.maxx=p.x;\n if(p.yaabb.maxy)aabb.maxy=p.y;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function __validate_sweepRadius(){\n var maxRadius=0.0;\n var minRadius=0.0;\n validate_laxi();\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var r=(x.x*x.x+x.y*x.y);\n if(r>maxRadius){\n maxRadius=r;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=edges.begin();\n while(cx_ite!=null){\n var e=cx_ite.elem();\n {\n if(e.lprojection0){\n var ta=if(t>1)1 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(ta);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"ta\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*u.x-edge.lnormx*u.y);\n var dotb=(edge.lnormy*cx-edge.lnormx*cy);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*ta*edge.length*Config.fluidAngularDrag;\n }\n if(t<1){\n var tb=if(t<0)0 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(tb);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"tb\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*cx-edge.lnormx*cy);\n var dotb=(edge.lnormy*v.x-edge.lnormx*v.y);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*Config.fluidVacuumDrag*(1-tb)*edge.length*Config.fluidAngularDrag;\n }\n };\n {\n cx_itei=cx_itej;\n u=v;\n cx_itej=cx_itej.next;\n };\n }\n if(cx_cont){\n do{\n cx_itej=lverts.begin();\n var v=cx_itej.elem();\n {\n var edge=ei.elem();\n ei=ei.next;\n perim+=edge.length;\n var dx:Float=0.0;\n var dy:Float=0.0;\n {\n dx=v.x-u.x;\n dy=v.y-u.y;\n };\n accum+=edge.length*Config.fluidAngularDragFriction*material.dynamicFriction*edge.lprojection*edge.lprojection;\n var t=-(u.y*edge.lnormx-u.x*edge.lnormy)/(dy*edge.lnormx-dx*edge.lnormy);\n if(t>0){\n var ta=if(t>1)1 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(ta);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"ta\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*u.x-edge.lnormx*u.y);\n var dotb=(edge.lnormy*cx-edge.lnormx*cy);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*ta*edge.length*Config.fluidAngularDrag;\n }\n if(t<1){\n var tb=if(t<0)0 else t;\n var cx:Float=0.0;\n var cy:Float=0.0;\n {\n cx=u.x;\n cy=u.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cx!=cx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cx)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cy!=cy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cy)\"+\") :: \"+(\"vec_set(in n: \"+\"c\"+\",in x: \"+\"u.x\"+\",in y: \"+\"u.y\"+\")\");\n #end\n };\n };\n {\n var t=(tb);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"c\"+\",in b: \"+\"d\"+\",in s: \"+\"tb\"+\")\");\n #end\n };\n cx+=dx*t;\n cy+=dy*t;\n };\n var dota=(edge.lnormy*cx-edge.lnormx*cy);\n var dotb=(edge.lnormy*v.x-edge.lnormx*v.y);\n var dots=(dotb*dotb*dotb-dota*dota*dota)/(3*(dotb-dota));\n accum+=dots*Config.fluidVacuumDrag*(1-tb)*edge.length*Config.fluidAngularDrag;\n }\n };\n }\n while(false);\n }\n };\n angDrag=accum/(inertia*perim);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __validate_localCOM(){\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon has no meaningful localCOM\";\n #end\n if(lverts.begin().next==null){\n localCOMx=lverts.front().x;\n localCOMy=lverts.front().y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n };\n else if(lverts.begin().next.next==null){\n {\n localCOMx=lverts.front().x;\n localCOMy=lverts.front().y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"lverts.front().x\"+\",in y: \"+\"lverts.front().y\"+\")\");\n #end\n };\n };\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"localCOM\"+\",in b: \"+\"lverts.begin().next.elem().\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n localCOMx+=lverts.begin().next.elem().x*t;\n localCOMy+=lverts.begin().next.elem().y*t;\n };\n {\n var t=(0.5);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"localCOM\"+\",in s: \"+\"0.5\"+\")\");\n #end\n };\n localCOMx*=t;\n localCOMy*=t;\n };\n }\n else{\n {\n localCOMx=0;\n localCOMy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMx!=localCOMx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMx)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((localCOMy!=localCOMy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(localCOMy)\"+\") :: \"+(\"vec_set(in n: \"+\"localCOM\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var area=0.0;\n {\n var cx_ite=lverts.begin();\n var u=cx_ite.elem();\n cx_ite=cx_ite.next;\n var v=cx_ite.elem();\n cx_ite=cx_ite.next;\n while(cx_ite!=null){\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n }\n cx_ite=lverts.begin();\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n u=v;\n v=w;\n cx_ite=cx_ite.next;\n var w=cx_ite.elem();\n {\n area+=v.x*(w.y-u.y);\n var cf=(w.y*v.x-w.x*v.y);\n localCOMx+=(v.x+w.x)*cf;\n localCOMy+=(v.y+w.y)*cf;\n };\n };\n area=1/(3*area);\n {\n var t=(area);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_muleq(in a: \"+\"localCOM\"+\",in s: \"+\"area\"+\")\");\n #end\n };\n localCOMx*=t;\n localCOMy*=t;\n };\n }\n }\n private function localCOM_validate(){\n #if(!NAPE_RELEASE_BUILD)\n if(lverts.empty())throw \"Error: An empty polygon does not have any meaningful localCOM\";\n #end\n validate_localCOM();\n }\n private function localCOM_invalidate(x:ZPP_Vec2){\n validate_localCOM();\n var delx:Float=0;\n var dely:Float=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((delx!=delx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(delx)\"+\") :: \"+(\"vec_new(in n: \"+\"del\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((dely!=dely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(dely)\"+\") :: \"+(\"vec_new(in n: \"+\"del\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n delx=x.x-localCOMx;\n dely=x.y-localCOMy;\n };\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p.\"+\",in b: \"+\"del\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n p.x+=delx*t;\n p.y+=dely*t;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function setupLocalCOM(){\n wrap_localCOM=Vec2.get(localCOMx,localCOMy);\n wrap_localCOM.zpp_inner._inuse=true;\n wrap_localCOM.zpp_inner._validate=localCOM_validate;\n wrap_localCOM.zpp_inner._invalidate=localCOM_invalidate;\n }\n public function new(){\n super(ZPP_Flags.id_ShapeType_POLYGON);\n polygon=this;\n lverts=new ZPP_Vec2();\n gverts=new ZPP_Vec2();\n edges=new ZNPList_ZPP_Edge();\n edgeCnt=0;\n }\n public function __translate(dx:Float,dy:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var t=(1.0);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((t!=t));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(t)\"+\") :: \"+(\"vec_addeq(in a: \"+\"p.\"+\",in b: \"+\"d\"+\",in s: \"+\"1.0\"+\")\");\n #end\n };\n p.x+=dx*t;\n p.y+=dy*t;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __scale(sx:Float,sy:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n p.x*=sx;\n p.y*=sy;\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __rotate(ax:Float,ay:Float){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n var tempx:Float=0.0;\n var tempy:Float=0.0;\n {\n tempx=(ay*p.x-ax*p.y);\n tempy=(p.x*ax+p.y*ay);\n };\n {\n p.x=tempx;\n p.y=tempy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((p.x!=p.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(p.x)\"+\") :: \"+(\"vec_set(in n: \"+\"p.\"+\",in x: \"+\"tempx\"+\",in y: \"+\"tempy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((p.y!=p.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(p.y)\"+\") :: \"+(\"vec_set(in n: \"+\"p.\"+\",in x: \"+\"tempx\"+\",in y: \"+\"tempy\"+\")\");\n #end\n };\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __transform(mat:Mat23){\n {\n var cx_ite=lverts.begin();\n while(cx_ite!=null){\n var p=cx_ite.elem();\n {\n {\n var t=mat.a*p.x+mat.b*p.y+mat.tx;\n p.y=mat.c*p.x+mat.d*p.y+mat.ty;\n p.x=t;\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n invalidate_lverts();\n }\n public function __copy(){\n var ret=new Polygon(outer_zn.localVerts).zpp_inner_zn;\n return ret;\n }\n}\n","package zpp_nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Broadphase{\n public var space:ZPP_Space=null;\n public var is_sweep:Bool=false;\n public var sweep:ZPP_SweepPhase=null;\n public var dynab:ZPP_DynAABBPhase=null;\n public function insert(shape:ZPP_Shape){\n if(is_sweep)sweep.__insert(shape);\n else dynab.__insert(shape);\n }\n public function remove(shape:ZPP_Shape){\n if(is_sweep)sweep.__remove(shape);\n else dynab.__remove(shape);\n }\n public function sync(shape:ZPP_Shape){\n if(is_sweep)sweep.__sync(shape);\n else dynab.__sync(shape);\n }\n public function broadphase(space:ZPP_Space,discrete:Bool){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"not implemented\");\n #end\n };\n }\n public function clear(){}\n public function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public var aabbShape:Shape=null;\n public var matrix:Mat23=null;\n public function updateAABBShape(aabb:ZPP_AABB){\n if(aabbShape==null){\n var body=new Body(BodyType.STATIC);\n body.shapes.add(aabbShape=new Polygon(Polygon.rect(aabb.minx,aabb.miny,aabb.width(),aabb.height())));\n }\n else{\n var ab=aabbShape.zpp_inner.aabb;\n var sx=aabb.width()/ab.width();\n var sy=aabb.height()/ab.height();\n if(matrix==null)matrix=new Mat23();\n matrix.a=sx;\n matrix.b=matrix.c=0;\n matrix.d=sy;\n matrix.tx=aabb.minx-sx*ab.minx;\n matrix.ty=aabb.miny-sy*ab.miny;\n aabbShape.transform(matrix);\n }\n aabbShape.zpp_inner.validate_aabb();\n aabbShape.zpp_inner.polygon.validate_gaxi();\n }\n public function shapesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public var circShape:Shape=null;\n public function updateCircShape(x:Float,y:Float,r:Float){\n if(circShape==null){\n var body=new Body(BodyType.STATIC);\n body.shapes.add(circShape=new Circle(r,Vec2.get(x,y)));\n }\n else{\n var ci=circShape.zpp_inner.circle;\n var ss=r/ci.radius;\n if(matrix==null)matrix=new Mat23();\n matrix.a=matrix.d=ss;\n matrix.b=matrix.c=0;\n matrix.tx=x-ss*ci.localCOMx;\n matrix.ty=y-ss*ci.localCOMy;\n circShape.transform(matrix);\n }\n circShape.zpp_inner.validate_aabb();\n }\n public function shapesInCircle(x:Float,y:Float,r:Float,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInCircle(x:Float,y:Float,r:Float,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public function validateShape(s:ZPP_Shape){\n if(s.isPolygon())s.polygon.validate_gaxi();\n s.validate_aabb();\n s.validate_worldCOM();\n }\n public function shapesInShape(shape:ZPP_Shape,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList):ShapeList{\n return null;\n }\n public function bodiesInShape(shape:ZPP_Shape,containment:Bool,filter:ZPP_InteractionFilter,output:BodyList):BodyList{\n return null;\n }\n public function rayCast(ray:ZPP_Ray,inner:Bool,filter:ZPP_InteractionFilter):RayResult{\n return null;\n }\n public function rayMultiCast(ray:ZPP_Ray,inner:Bool,filter:ZPP_InteractionFilter,output:RayResultList):RayResultList{\n return null;\n }\n}\n","package zpp_nape.space;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_AABBNode{\n public var aabb:ZPP_AABB=null;\n public var shape:ZPP_Shape=null;\n public var dyn:Bool=false;\n public var parent:ZPP_AABBNode=null;\n public var child1:ZPP_AABBNode=null;\n public var child2:ZPP_AABBNode=null;\n public var height:Int=0;\n public var rayt:Float=0.0;\n public function new(){\n height=-1;\n }\n public var next:ZPP_AABBNode=null;\n static public var zpp_pool:ZPP_AABBNode=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n if(ZPP_AABB.zpp_pool==null){\n aabb=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n aabb=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=aabb.next;\n aabb.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n aabb.alloc();\n };\n moved=false;\n synced=false;\n first_sync=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n height=-1;\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n child1=child2=parent=null;\n next=null;\n snext=null;\n mnext=null;\n }\n public var mnext:ZPP_AABBNode=null;\n public var moved:Bool=false;\n public var snext:ZPP_AABBNode=null;\n public var synced:Bool=false;\n public var first_sync:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function isLeaf(){\n return child1==null;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_AABBPair{\n public var n1:ZPP_AABBNode=null;\n public var n2:ZPP_AABBNode=null;\n public var first:Bool=false;\n public var sleeping:Bool=false;\n public var id:Int=0;\n public var di:Int=0;\n public var arb:ZPP_Arbiter=null;\n public var next:ZPP_AABBPair=null;\n static public var zpp_pool:ZPP_AABBPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public function new(){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb==null;\n };\n if(!res)throw \"assert(\"+\"arb==null\"+\") :: \"+(\"node still has an arbiter when going into pool??\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb==null;\n };\n if(!res)throw \"assert(\"+\"arb==null\"+\") :: \"+(\"node still has an arbiter when going into pool??\");\n #end\n };\n n1=n2=null;\n sleeping=false;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_AABBTree{\n public var root:ZPP_AABBNode=null;\n public function new(){}\n public function clear(){\n if(root==null)return;\n var stack:ZPP_AABBNode=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n root.next==null;\n };\n if(!res)throw \"assert(\"+\"root.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n root.next=stack;\n stack=root;\n };\n while(stack!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n stack!=null;\n };\n if(!res)throw \"assert(\"+\"stack!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=stack;\n stack=ret.next;\n ret.next=null;\n ret;\n });\n if(node.isLeaf()){\n node.shape.node=null;\n node.shape.removedFromSpace();\n node.shape=null;\n }\n else{\n if(node.child1!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.child1.next==null;\n };\n if(!res)throw \"assert(\"+\"node.child1.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.child1.next=stack;\n stack=node.child1;\n };\n if(node.child2!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.child2.next==null;\n };\n if(!res)throw \"assert(\"+\"node.child2.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.child2.next=stack;\n stack=node.child2;\n };\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n root=null;\n }\n public static var tmpaabb=new ZPP_AABB();\n function insertLeaf(leaf:ZPP_AABBNode){\n inlined_insertLeaf(leaf);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insertLeaf(leaf:ZPP_AABBNode){\n if(root==null){\n root=leaf;\n root.parent=null;\n }\n else{\n var leafaabb=leaf.aabb;\n var node=root;\n while(!node.isLeaf()){\n var child1=node.child1;\n var child2=node.child2;\n var area=node.aabb.perimeter();\n tmpaabb.setCombine(node.aabb,leafaabb);\n var carea=tmpaabb.perimeter();\n var cost=2*carea;\n var icost=2*(carea-area);\n var cost1=({\n tmpaabb.setCombine(leafaabb,child1.aabb);\n if(child1.isLeaf())tmpaabb.perimeter()+icost;\n else{\n var oarea=child1.aabb.perimeter();\n var narea=tmpaabb.perimeter();\n (narea-oarea)+icost;\n }\n });\n var cost2=({\n tmpaabb.setCombine(leafaabb,child2.aabb);\n if(child2.isLeaf())tmpaabb.perimeter()+icost;\n else{\n var oarea=child2.aabb.perimeter();\n var narea=tmpaabb.perimeter();\n (narea-oarea)+icost;\n }\n });\n if(costy?x:y;\n });\n node.aabb.setCombine(child1.aabb,child2.aabb);\n node=node.parent;\n }\n }\n }\n public function removeLeaf(leaf:ZPP_AABBNode){\n inlined_removeLeaf(leaf);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_removeLeaf(leaf:ZPP_AABBNode){\n if(leaf==root){\n root=null;\n return;\n }\n else{\n var parent=leaf.parent;\n var gparent=parent.parent;\n var sibling=if(parent.child1==leaf)parent.child2 else parent.child1;\n if(gparent!=null){\n if(gparent.child1==parent)gparent.child1=sibling;\n else gparent.child2=sibling;\n sibling.parent=gparent;\n {\n var o=parent;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"parent\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n var node=gparent;\n while(node!=null){\n node=balance(node);\n var child1=node.child1;\n var child2=node.child2;\n node.aabb.setCombine(child1.aabb,child2.aabb);\n node.height=1+({\n var x=child1.height;\n var y=child2.height;\n x>y?x:y;\n });\n node=node.parent;\n }\n }\n else{\n root=sibling;\n sibling.parent=null;\n {\n var o=parent;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"parent\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n }\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function balance(a:ZPP_AABBNode){\n if(a.isLeaf()||a.height<2)return a;\n else{\n var b=a.child1;\n var c=a.child2;\n var balance=c.height-b.height;\n if(balance>1){\n var f=c.child1;\n var g=c.child2;\n c.child1=a;\n c.parent=a.parent;\n a.parent=c;\n if(c.parent!=null){\n if(c.parent.child1==a)c.parent.child1=c;\n else c.parent.child2=c;\n }\n else root=c;\n if(f.height>g.height){\n c.child2=f;\n a.child2=g;\n g.parent=a;\n a.aabb.setCombine(b.aabb,g.aabb);\n c.aabb.setCombine(a.aabb,f.aabb);\n a.height=1+({\n var x=b.height;\n var y=g.height;\n x>y?x:y;\n });\n c.height=1+({\n var x=a.height;\n var y=f.height;\n x>y?x:y;\n });\n };\n else{\n c.child2=g;\n a.child2=f;\n f.parent=a;\n a.aabb.setCombine(b.aabb,f.aabb);\n c.aabb.setCombine(a.aabb,g.aabb);\n a.height=1+({\n var x=b.height;\n var y=f.height;\n x>y?x:y;\n });\n c.height=1+({\n var x=a.height;\n var y=g.height;\n x>y?x:y;\n });\n };\n return c;\n };\n else if(balance<-1){\n var f=b.child1;\n var g=b.child2;\n b.child1=a;\n b.parent=a.parent;\n a.parent=b;\n if(b.parent!=null){\n if(b.parent.child1==a)b.parent.child1=b;\n else b.parent.child2=b;\n }\n else root=b;\n if(f.height>g.height){\n b.child2=f;\n a.child1=g;\n g.parent=a;\n a.aabb.setCombine(c.aabb,g.aabb);\n b.aabb.setCombine(a.aabb,f.aabb);\n a.height=1+({\n var x=c.height;\n var y=g.height;\n x>y?x:y;\n });\n b.height=1+({\n var x=a.height;\n var y=f.height;\n x>y?x:y;\n });\n };\n else{\n b.child2=g;\n a.child1=f;\n f.parent=a;\n a.aabb.setCombine(c.aabb,f.aabb);\n b.aabb.setCombine(a.aabb,g.aabb);\n a.height=1+({\n var x=c.height;\n var y=f.height;\n x>y?x:y;\n });\n b.height=1+({\n var x=a.height;\n var y=g.height;\n x>y?x:y;\n });\n };\n return b;\n };\n else return a;\n }\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_DynAABBPhase extends ZPP_Broadphase{\n #if NAPE_NO_INLINE#else inline #end\n static var FATTEN=3.0;\n #if NAPE_NO_INLINE#else inline #end\n static var VEL_STEPS=2.0;\n public var stree:ZPP_AABBTree=null;\n public var dtree:ZPP_AABBTree=null;\n public var pairs:ZPP_AABBPair=null;\n public var syncs:ZPP_AABBNode=null;\n public var moves:ZPP_AABBNode=null;\n public function new(space:ZPP_Space){\n this.space=space;\n is_sweep=false;\n dynab=this;\n stree=new ZPP_AABBTree();\n dtree=new ZPP_AABBTree();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function dyn(shape:ZPP_Shape){\n if(shape.body.isStatic())return false;\n else return!shape.body.component.sleeping;\n }\n public function __insert(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.node==null;\n };\n if(!res)throw \"assert(\"+\"shape.node==null\"+\") :: \"+(\"shape has been inserted already\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape inserted with no body\");\n #end\n };\n var node;\n {\n if(ZPP_AABBNode.zpp_pool==null){\n node=new ZPP_AABBNode();\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_TOT++;\n ZPP_AABBNode.POOL_ADDNEW++;\n #end\n }\n else{\n node=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=node.next;\n node.next=null;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT--;\n ZPP_AABBNode.POOL_ADD++;\n #end\n }\n node.alloc();\n };\n node.shape=shape;\n shape.node=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !node.synced;\n };\n if(!res)throw \"assert(\"+\"!node.synced\"+\") :: \"+(\"node is already in sync list?\");\n #end\n };\n node.synced=true;\n node.first_sync=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.snext==null;\n };\n if(!res)throw \"assert(\"+\"node.snext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.snext=syncs;\n syncs=node;\n };\n }\n public function __remove(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"do i need this assertion?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.node!=null;\n };\n if(!res)throw \"assert(\"+\"shape.node!=null\"+\") :: \"+(\"shape has no node?\");\n #end\n };\n var node=shape.node;\n if(!node.first_sync){\n if(node.dyn)dtree.removeLeaf(node);\n else stree.removeLeaf(node);\n }\n shape.node=null;\n if(node.synced){\n {\n var pre=null;\n var cur=syncs;\n while(cur!=null){\n if(cur==node)break;\n pre=cur;\n cur=cur.snext;\n }\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"cur = null\");\n #end\n };\n if(pre==null)syncs=cur.snext;\n else pre.snext=cur.snext;\n cur.snext=null;\n };\n };\n node.synced=false;\n }\n if(node.moved){\n {\n var pre=null;\n var cur=moves;\n while(cur!=null){\n if(cur==node)break;\n pre=cur;\n cur=cur.mnext;\n }\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"cur = null\");\n #end\n };\n if(pre==null)moves=cur.mnext;\n else pre.mnext=cur.mnext;\n cur.mnext=null;\n };\n };\n node.moved=false;\n }\n var pre=null;\n var cur=pairs;\n while(cur!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cur.sleeping;\n };\n if(!res)throw \"assert(\"+\"!cur.sleeping\"+\") :: \"+(\"sleeping pair in pairs\");\n #end\n };\n var nxt=cur.next;\n if(cur.n1==node||cur.n2==node){\n if(pre==null)pairs=nxt;\n else pre.next=nxt;\n if(cur.arb!=null)cur.arb.pair=null;\n cur.arb=null;\n cur.n1.shape.pairs.remove(cur);\n cur.n2.shape.pairs.remove(cur);\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBPair.zpp_pool;\n ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBPair.POOL_CNT++;\n ZPP_AABBPair.POOL_SUB++;\n #end\n };\n cur=nxt;\n continue;\n }\n pre=cur;\n cur=nxt;\n }\n while(!shape.pairs.empty()){\n var cur=shape.pairs.pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.sleeping;\n };\n if(!res)throw \"assert(\"+\"cur.sleeping\"+\") :: \"+(\"non-sleeping pair remaining after removing them from pairs\");\n #end\n };\n if(cur.n1==node)cur.n2.shape.pairs.remove(cur);\n else cur.n1.shape.pairs.remove(cur);\n if(cur.arb!=null)cur.arb.pair=null;\n cur.arb=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBPair.zpp_pool;\n ZPP_AABBPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBPair.POOL_CNT++;\n ZPP_AABBPair.POOL_SUB++;\n #end\n };\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABBNode\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABBNode.zpp_pool;\n ZPP_AABBNode.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABBNode.POOL_CNT++;\n ZPP_AABBNode.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __sync(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !shape.body.isStatic();\n };\n if(!res)throw \"assert(\"+\"!shape.body.isStatic()\"+\") :: \"+(\"static shape being synced?\");\n #end\n };\n var node=shape.node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"shape has no node?\");\n #end\n };\n if(!node.synced){\n if(!space.continuous)shape.validate_aabb();\n var sync=node.dyn!=dyn(shape)||!node.aabb.contains(shape.aabb);\n if(sync){\n #if NAPE_TIMES Debug.BROADCLASH++;\n #end\n node.synced=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.snext==null;\n };\n if(!res)throw \"assert(\"+\"node.snext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.snext=syncs;\n syncs=node;\n };\n }\n #if NAPE_TIMES Debug.BROADTOTAL++;\n #end\n }\n }\n public function sync_broadphase(){\n space.validation();\n if(syncs!=null){\n if(moves==null){\n var node=syncs;\n while(node!=null){\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !node.moved;\n };\n if(!res)throw \"assert(\"+\"!node.moved\"+\") :: \"+(\"node already moved apparently?\");\n #end\n };\n node.moved=true;\n node.mnext=node.snext;\n node.snext=null;\n node=node.mnext;\n }\n {\n var t=syncs;\n syncs=moves;\n moves=t;\n }\n }\n else{\n while(syncs!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n syncs!=null;\n };\n if(!res)throw \"assert(\"+\"syncs!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=syncs;\n syncs=ret.snext;\n ret.snext=null;\n ret;\n });\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n if(!node.moved){\n node.moved=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.mnext==null;\n };\n if(!res)throw \"assert(\"+\"node.mnext==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n node.mnext=moves;\n moves=node;\n };\n }\n }\n }\n }\n }\n public override function broadphase(space:ZPP_Space,discrete:Bool){\n var node=syncs;\n while(node!=null){\n {\n var shape=node.shape;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.synced;\n };\n if(!res)throw \"assert(\"+\"node.synced\"+\") :: \"+(\"node doesn't need syncing?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.body!=null;\n };\n if(!res)throw \"assert(\"+\"shape.body!=null\"+\") :: \"+(\"shape with no body can't be synced\");\n #end\n };\n if(!node.first_sync){\n var tree=if(node.dyn)dtree else stree;\n tree.inlined_removeLeaf(node);\n }\n else node.first_sync=false;\n var aabb=node.aabb;\n if(!space.continuous)shape.validate_aabb();\n aabb.setExpand(shape.aabb,FATTEN);\n var tree=if(node.dyn=dyn(shape))dtree else stree;\n tree.inlined_insertLeaf(node);\n node.synced=false;\n };\n node=node.snext;\n }\n {\n while(syncs!=null){\n var leaf=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n syncs!=null;\n };\n if(!res)throw \"assert(\"+\"syncs!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=syncs;\n syncs=ret.snext;\n ret.snext=null;\n ret;\n });\n if(\"syncs\"!=\"moves\"&&leaf.moved)continue;\n leaf.moved=false;\n var lshape=leaf.shape;\n var lbody=lshape.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(lbody.component.sleeping&&lbody.isStatic());\n };\n if(!res)throw \"assert(\"+\"!(lbody.component.sleeping&&lbody.isStatic())\"+\") :: \"+(\"a sleeping static?\");\n #end\n };\n if(lbody.component.sleeping)continue;\n var ab=leaf.aabb;\n var stack=null;\n {\n if(dtree.root!=null){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n dtree.root.next==null;\n };\n if(!res)throw \"assert(\"+\"dtree.root.next==null\"+\") :: \"+(\"object already in list\");\n #end\n };\n dtree.root.next=stack;\n stack=dtree.root;\n };\n while(stack!=null){\n var node=({\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n stack!=null;\n };\n if(!res)throw \"assert(\"+\"stack!=null\"+\") :: \"+(\"pop from empty list!\");\n #end\n };\n var ret=stack;\n stack=ret.next;\n ret.next=null;\n ret;\n });\n if(node==leaf)continue;\n if(node.isLeaf()){\n var shape=node.shape;\n if(shape.body!=lshape.body&&!(shape.body.isStatic()&&lshape.body.isStatic())){\n if(ab.intersect(node.aabb)){\n var id:Int;\n var di:Int;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n lshape!=shape;\n };\n if(!res)throw \"assert(\"+\"lshape!=shape\"+\") :: \"+(\"narrowphase area of dyn-aabb with same shape?\");\n #end\n };\n if(lshape.id=0&&t=0&&t=mint)break;\n if(cnode.isLeaf()){\n var shape=cnode.shape;\n if(filter==null||shape.filter.shouldCollide(filter)){\n var result=if(shape.isCircle())ray.circlesect(shape.circle,inner,mint)else if(ray.aabbtest(shape.aabb))ray.polysect(shape.polygon,inner,mint);\n else null;\n if(result!=null){\n mint=result.distance;\n if(minres!=null){\n minres.dispose();\n }\n minres=result;\n }\n }\n }\n else{\n {\n if(cnode.child1!=null){\n if(ray.aabbtest(cnode.child1.aabb)){\n var t=ray.aabbsect(cnode.child1.aabb);\n if(t>=0&&t=0&&t=ZPP_Const.POSINF();\n var ret=(output==null?new RayResultList():output);\n {\n if(dtree.root!=null){\n if(ray.aabbtest(dtree.root.aabb)){\n if(inf)openlist.add(dtree.root);\n else{\n var t=ray.aabbsect(dtree.root.aabb);\n if(t>=0&&t=0&&t=0&&t=0&&t o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_Island,o:ZPP_Island):ZPP_Island{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_Island,o:ZPP_Island):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_Island{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_Island):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_Island):ZPP_Island{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_Island):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_Island;\n var ret:ZPP_Island;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_Island,n:Int):ZPP_Island{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_Island):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_Island):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_Island\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_Island{\n return begin().elem();\n }\n public function back():ZPP_Island{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_Island{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n public var comps:ZNPList_ZPP_Component=null;\n public var sleep:Bool=false;\n public var waket:Int=0;\n static public var zpp_pool:ZPP_Island=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n comps.empty();\n };\n if(!res)throw \"assert(\"+\"comps.empty()\"+\") :: \"+(\"Island freed with components in island\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n waket=0;\n }\n public function new(){\n comps=new ZNPList_ZPP_Component();\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Component{\n public var next:ZPP_Component=null;\n static public var zpp_pool:ZPP_Component=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var parent:ZPP_Component=null;\n public var rank:Int=0;\n public var isBody:Bool=false;\n public var body:ZPP_Body=null;\n public var constraint:ZPP_Constraint=null;\n public var island:ZPP_Island=null;\n public var sleeping:Bool=false;\n public var waket:Int=0;\n public var woken:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n body=null;\n constraint=null;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n island==null;\n };\n if(!res)throw \"assert(\"+\"island==null\"+\") :: \"+(\"component freeed whilst connected to an island?\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public function new(){\n reset();\n woken=false;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function reset(){\n sleeping=false;\n island=null;\n parent=this;\n rank=0;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CallbackSet{\n public var id:Int=0;\n public var di:Int=0;\n public var int1:ZPP_Interactor=null;\n public var int2:ZPP_Interactor=null;\n public static function get(i1:ZPP_Interactor,i2:ZPP_Interactor){\n var ret;\n {\n if(ZPP_CallbackSet.zpp_pool==null){\n ret=new ZPP_CallbackSet();\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_TOT++;\n ZPP_CallbackSet.POOL_ADDNEW++;\n #end\n }\n else{\n ret=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=ret.next;\n ret.next=null;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT--;\n ZPP_CallbackSet.POOL_ADD++;\n #end\n }\n ret.alloc();\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i1!=i2;\n };\n if(!res)throw \"assert(\"+\"i1!=i2\"+\") :: \"+(\"CallbackSet between the same interactor?\");\n #end\n };\n if(i1.id o=\"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n temp.next=begin();\n next=temp;\n modified=true;\n length++;\n return o;\n }\n public function addAll(x:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x!=null;\n };\n if(!res)throw \"assert(\"+\"x!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] addAll -> \"+x);\n #end\n };\n {\n var cx_ite=x.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function insert(cur:ZPP_CallbackSet,o:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_insert(cur,o);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_insert(cur:ZPP_CallbackSet,o:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null&&!has(o);\n };\n if(!res)throw \"assert(\"+\"o!=null&&!has(o)\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] cur -> \"+cur+\" -> \"+o);\n #end\n };\n var temp={\n o._inuse=true;\n o;\n };\n if(cur==null){\n temp.next=begin();\n next=temp;\n }\n else{\n temp.next=cur.next;\n cur.next=temp;\n }\n pushmod=modified=true;\n length++;\n return temp;\n }\n public function pop():Void{\n inlined_pop();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop():Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop\");\n #end\n };\n var ret=begin();\n next=ret.next;\n {\n ret.elem()._inuse=false;\n };\n {};\n if(empty())pushmod=true;\n modified=true;\n length--;\n }\n public function pop_unsafe():ZPP_CallbackSet{\n return inlined_pop_unsafe();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_pop_unsafe():ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] pop_unsafe\");\n #end\n };\n var ret=front();\n pop();\n return ret;\n }\n public function remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n public function try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_remove(obj:ZPP_CallbackSet):Void{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"removed but didn't exist\");\n #end\n };\n inlined_try_remove(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_try_remove(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] remove -> \"+obj);\n #end\n };\n var pre=null;\n var cur=begin();\n var ret=false;\n while(cur!=null){\n if(cur.elem()==obj){\n inlined_erase(pre);\n ret=true;\n break;\n }\n pre=cur;\n cur=cur.next;\n }\n return ret;\n }\n public function erase(pre:ZPP_CallbackSet):ZPP_CallbackSet{\n return inlined_erase(pre);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_erase(pre:ZPP_CallbackSet):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] erase -> \"+pre);\n #end\n };\n var old:ZPP_CallbackSet;\n var ret:ZPP_CallbackSet;\n if(pre==null){\n old=begin();\n ret=old.next;\n next=ret;\n if(empty())pushmod=true;\n }\n else{\n old=pre.next;\n ret=old.next;\n pre.next=ret;\n if(ret==null)pushmod=true;\n }\n {\n old.elem()._inuse=false;\n };\n {};\n modified=true;\n length--;\n pushmod=true;\n return ret;\n }\n public function splice(pre:ZPP_CallbackSet,n:Int):ZPP_CallbackSet{\n while(n-->0&&pre.next!=null)erase(pre);\n return pre.next;\n }\n public function clear():Void{\n inlined_clear();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_clear():Void{\n if(false){\n while(!empty())inlined_pop();\n pushmod=true;\n }\n }\n public function reverse():Void{\n var cur=begin();\n var pre=null;\n while(cur!=null){\n var nx=cur.next;\n cur.next=pre;\n next=cur;\n pre=cur;\n cur=nx;\n }\n modified=true;\n pushmod=true;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function empty():Bool{\n return begin()==null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function size():Int{\n return length;\n }\n public function has(obj:ZPP_CallbackSet):Bool{\n return inlined_has(obj);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_has(obj:ZPP_CallbackSet):Bool{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n obj!=null;\n };\n if(!res)throw \"assert(\"+\"obj!=null\"+\") :: \"+(\"[ListMixin(\"+\"ZPP_CallbackSet\"+\"] has -> \"+obj);\n #end\n };\n var ret;\n {\n ret=false;\n {\n var cx_ite=this.begin();\n while(cx_ite!=null){\n var npite=cx_ite.elem();\n {\n if(npite==obj){\n ret=true;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function front():ZPP_CallbackSet{\n return begin().elem();\n }\n public function back():ZPP_CallbackSet{\n var ret=begin();\n var cur=ret;\n while(cur!=null){\n ret=cur;\n cur=cur.next;\n }\n return ret.elem();\n }\n public function iterator_at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=-1&&ind=-1&&ind \"+ind);\n #end\n };\n var ret=begin();\n while(ind-->0&&ret!=null)ret=ret.next;\n return ret;\n }\n public function at(ind:Int):ZPP_CallbackSet{\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n ind>=0&&ind=0&&ind \"+ind);\n #end\n };\n var it=iterator_at(ind);\n return if(it!=null)it.elem()else null;\n }\n static public var zpp_pool:ZPP_CallbackSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n public var freed:Bool=false;\n public var lazydel:Bool=false;\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n int1=int2=null;\n id=di=-1;\n freed=true;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arbiters.empty();\n };\n if(!res)throw \"assert(\"+\"arbiters.empty()\"+\") :: \"+(\"callbackset released with lingering arbs\");\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){\n freed=false;\n lazydel=false;\n \n COLLISIONstate=ZPP_Flags.id_PreFlag_ACCEPT;\n COLLISIONstamp=0;\n SENSORstate=ZPP_Flags.id_PreFlag_ACCEPT;\n SENSORstamp=0;\n FLUIDstate=ZPP_Flags.id_PreFlag_ACCEPT;\n FLUIDstamp=0;\n }\n public function new(){\n arbiters=new ZNPList_ZPP_Arbiter();\n }\n public#if NAPE_NO_INLINE#else inline #end\n function add_arb(x:ZPP_Arbiter){\n if(!arbiters.inlined_has(x)){\n arbiters.inlined_add(x);\n return true;\n }\n else return false;\n }\n public function try_remove_arb(x:ZPP_Arbiter){\n return arbiters.inlined_try_remove(x);\n }\n public function remove_arb(x:ZPP_Arbiter){\n arbiters.inlined_remove(x);\n }\n public function empty_arb(type:Int){\n var retvar;\n {\n retvar=true;\n {\n var cx_ite=arbiters.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if((x.type&type)==0){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n retvar=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return retvar;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function really_empty(){\n return arbiters.empty();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sleeping(){\n var ret;\n {\n ret=true;\n {\n var cx_ite=arbiters.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n if(x.sleeping){\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n else{\n ret=false;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n return ret;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_CbSetManager{\n public var cbsets:ZPP_Set_ZPP_CbSet=null;\n public var space:ZPP_Space=null;\n public function get(cbTypes:ZNPList_ZPP_CbType){\n if(cbTypes.empty())return null;\n #if NAPE_ASSERT ZPP_CbSet.assert_cbTypes(cbTypes);\n #end\n var fake;\n {\n if(ZPP_CbSet.zpp_pool==null){\n fake=new ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_TOT++;\n ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n fake=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=fake.next;\n fake.next=null;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT--;\n ZPP_CbSet.POOL_ADD++;\n #end\n }\n fake.alloc();\n };\n var faketypes=fake.cbTypes;\n fake.cbTypes=cbTypes;\n var res=cbsets.find_weak(fake);\n var ret=if(res!=null)res.data else{\n var set=ZPP_CbSet.get(cbTypes);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !cbsets.has_weak(set);\n };\n if(!res)throw \"assert(\"+\"!cbsets.has_weak(set)\"+\") :: \"+(\"CbSet exists in Set already, but not found??\");\n #end\n };\n cbsets.insert(set);\n set.manager=this;\n set;\n }\n fake.cbTypes=faketypes;\n {\n var o=fake;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSet\"+\", in obj: \"+\"fake\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSet.zpp_pool;\n ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSet.POOL_CNT++;\n ZPP_CbSet.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function remove(set:ZPP_CbSet){\n cbsets.remove(set);\n {\n while(!set.cbpairs.empty()){\n var pair=set.cbpairs.pop_unsafe();\n {\n if(pair.a!=pair.b){\n if(set==pair.a)pair.b.cbpairs.remove(pair);\n else pair.a.cbpairs.remove(pair);\n }\n {\n var o=pair;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CbSetPair\"+\", in obj: \"+\"pair\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CbSetPair.zpp_pool;\n ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CbSetPair.POOL_CNT++;\n ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n };\n }\n };\n set.manager=null;\n }\n public function clear(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbsets.empty();\n };\n if(!res)throw \"assert(\"+\"cbsets.empty()\"+\") :: \"+(\"space cleared, called setmanager clear(), and tree was non-empty. wuh\");\n #end\n };\n }\n public function new(space:ZPP_Space){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n cbsets=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n cbsets=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=cbsets.next;\n cbsets.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n cbsets.alloc();\n };\n cbsets.lt=ZPP_CbSet.setlt;\n this.space=space;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function validate(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cbsets!=null;\n };\n if(!res)throw \"assert(\"+\"cbsets!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!cbsets.empty()){\n var set_ite=cbsets.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var cb=set_ite.data;\n cb.validate();\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function pair(a:ZPP_CbSet,b:ZPP_CbSet){\n var ret:ZPP_CbSetPair=null;\n var pairs=if(a.cbpairs.length=null;\n public var gravityx:Float=0.0;\n public var gravityy:Float=0.0;\n public var wrap_gravity:Vec2=null;\n public function getgravity(){\n wrap_gravity=Vec2.get(gravityx,gravityy);\n wrap_gravity.zpp_inner._inuse=true;\n wrap_gravity.zpp_inner._invalidate=gravity_invalidate;\n wrap_gravity.zpp_inner._validate=gravity_validate;\n }\n private function gravity_invalidate(x:ZPP_Vec2){\n #if(!NAPE_RELEASE_BUILD)\n if(midstep)throw \"Error: Space::gravity cannot be set during space step\";\n #end\n {\n gravityx=x.x;\n gravityy=x.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityx!=gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((gravityy!=gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"gravity\"+\",in x: \"+\"x.x\"+\",in y: \"+\"x.y\"+\")\");\n #end\n };\n };\n var stack=new ZNPList_ZPP_Compound();\n {\n var cx_ite=bodies.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var o=x;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n while(!stack.empty()){\n var s=stack.pop_unsafe();\n {\n var cx_ite=s.bodies.begin();\n while(cx_ite!=null){\n var x=cx_ite.elem();\n {\n var o=x;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=s.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n private function gravity_validate(){\n {\n wrap_gravity.zpp_inner.x=gravityx;\n wrap_gravity.zpp_inner.y=gravityy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.x!=wrap_gravity.zpp_inner.x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.x)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((wrap_gravity.zpp_inner.y!=wrap_gravity.zpp_inner.y));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(wrap_gravity.zpp_inner.y)\"+\") :: \"+(\"vec_set(in n: \"+\"wrap_gravity.zpp_inner.\"+\",in x: \"+\"gravityx\"+\",in y: \"+\"gravityy\"+\")\");\n #end\n };\n };\n }\n public var bodies:ZNPList_ZPP_Body=null;\n public var wrap_bodies:BodyList=null;\n public var compounds:ZNPList_ZPP_Compound=null;\n public var wrap_compounds:CompoundList=null;\n public var constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_constraints:ConstraintList=null;\n public var kinematics:ZNPList_ZPP_Body=null;\n public var bphase:ZPP_Broadphase=null;\n public var __static:Body=null;\n public var global_lin_drag:Float=0.0;\n public var global_ang_drag:Float=0.0;\n public var stamp:Int=0;\n public var midstep:Bool=false;\n public var time:Float=0.0;\n public var sortcontacts:Bool=false;\n \n public var c_arbiters_true:ZNPList_ZPP_ColArbiter=null;\n public var c_arbiters_false:ZNPList_ZPP_ColArbiter=null;\n public var f_arbiters:ZNPList_ZPP_FluidArbiter=null;\n public var s_arbiters:ZNPList_ZPP_SensorArbiter=null;\n public var wrap_arbiters:ArbiterList=null;\n public var live:ZNPList_ZPP_Body=null;\n public var wrap_live:BodyList=null;\n public var live_constraints:ZNPList_ZPP_Constraint=null;\n public var wrap_livecon:ConstraintList=null;\n public var staticsleep:ZNPList_ZPP_Body=null;\n public var islands:ZPP_Island=null;\n public var listeners:ZNPList_ZPP_Listener=null;\n public var wrap_listeners:ListenerList=null;\n public var callbacks:ZPP_Callback=null;\n public var callbackset_list:ZPP_CallbackSet=null;\n public var cbsets:ZPP_CbSetManager=null;\n public function clear(){\n {\n while(!listeners.empty()){\n var c=listeners.pop_unsafe();\n remListener(c);\n }\n };\n {\n while(!callbackset_list.empty()){\n var c=callbackset_list.pop_unsafe();\n {\n c.arbiters.clear();\n {\n var o=c;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CallbackSet\"+\", in obj: \"+\"c\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT++;\n ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n };\n }\n };\n {\n while(!c_arbiters_true.empty()){\n var arb=c_arbiters_true.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!c_arbiters_false.empty()){\n var arb=c_arbiters_false.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!s_arbiters.empty()){\n var arb=s_arbiters.pop_unsafe();\n arb.retire();\n }\n };\n {\n while(!f_arbiters.empty()){\n var arb=f_arbiters.pop_unsafe();\n arb.retire();\n }\n };\n bphase.clear();\n {\n while(!bodies.empty()){\n var b=bodies.pop_unsafe();\n {\n {\n if(b.component!=null){\n var i=b.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n b.removedFromSpace();\n b.space=null;\n };\n }\n };\n {\n while(!constraints.empty()){\n var c=constraints.pop_unsafe();\n {\n {\n if(c.component!=null){\n var i=c.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n c.removedFromSpace();\n c.space=null;\n };\n }\n };\n kinematics.clear();\n var stack=new ZNPList_ZPP_Compound();\n {\n while(!compounds.empty()){\n var c=compounds.pop_unsafe();\n stack.add(c);\n }\n };\n while(!stack.empty()){\n var comp=stack.pop_unsafe();\n comp.removedFromSpace();\n comp.space=null;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n {\n if(b.component!=null){\n var i=b.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n b.removedFromSpace();\n b.space=null;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.constraints.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n {\n if(c.component!=null){\n var i=c.component.island;\n if(i!=null){\n {\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n c.reset();\n }\n };\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n };\n c.removedFromSpace();\n c.space=null;\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n islands.empty();\n };\n if(!res)throw \"assert(\"+\"islands.empty()\"+\") :: \"+(\"islands exist... wuh?\");\n #end\n };\n staticsleep.clear();\n live.clear();\n live_constraints.clear();\n stamp=0;\n time=0.0;\n #if NAPE_TIMES Debug.FOR=Debug.BROAD=Debug.PRE=Debug.POS=Debug.VEL=Debug.DRAW=Debug.SORT=0;\n Debug.ltime=0;\n #end\n mrca1.clear();\n mrca2.clear();\n prelisteners.clear();\n cbsets.clear();\n }\n private function bodies_adder(x:Body){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Body belonging to a Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.bodies.remove(x);\n addBody(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function bodies_subber(x:Body){\n remBody(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function bodies_modifiable(){\n if(midstep)throw \"Error: Space::bodies cannot be set during space step()\";\n }\n #end\n private function compounds_adder(x:Compound){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of an inner Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.wrap_compounds.remove(x);\n addCompound(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function compounds_subber(x:Compound){\n remCompound(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function compounds_modifiable(){\n if(midstep)throw \"Error: Space::compounds cannot be set during space step()\";\n }\n #end\n private function constraints_adder(x:Constraint){\n #if(!NAPE_RELEASE_BUILD)\n if(x.zpp_inner.compound!=null)throw \"Error: Cannot set the space of a Constraint belonging to a Compound, only the root Compound space can be set\";\n #end\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.constraints.remove(x);\n this.addConstraint(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function constraints_subber(x:Constraint){\n remConstraint(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function constraints_modifiable(){\n if(midstep)throw \"Error: Space::constraints cannot be set during space step()\";\n }\n #end\n private function listeners_adder(x:Listener){\n if(x.zpp_inner.space!=this){\n if(x.zpp_inner.space!=null)x.zpp_inner.space.outer.listeners.remove(x);\n addListener(x.zpp_inner);\n return true;\n }\n else return false;\n }\n private function listeners_subber(x:Listener){\n remListener(x.zpp_inner);\n }\n #if(!NAPE_RELEASE_BUILD)\n private function listeners_modifiable(){\n if(midstep)throw \"Error: Space::listeners cannot be set during space step()\";\n }\n #end\n public function new(gravity:ZPP_Vec2,broadphase:Broadphase){\n toiEvents=new ZNPList_ZPP_ToiEvent();\n global_lin_drag=0.015;\n global_ang_drag=0.015;\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Callback.internal=true;\n #end\n precb=new PreCallback();\n precb.zpp_inner=new ZPP_Callback();\n #if(!NAPE_RELEASE_BUILD)\n ZPP_Callback.internal=false;\n #end\n sortcontacts=true;\n pre_dt=0.0;\n if(broadphase==null||broadphase==Broadphase.DYNAMIC_AABB_TREE)bphase=new ZPP_DynAABBPhase(this);\n else if(broadphase==Broadphase.SWEEP_AND_PRUNE)bphase=new ZPP_SweepPhase(this);\n time=0.0;\n var me=this;\n if(gravity!=null){\n this.gravityx=gravity.x;\n this.gravityy=gravity.y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityx!=this.gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"gravity.x\"+\",in y: \"+\"gravity.y\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityy!=this.gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"gravity.x\"+\",in y: \"+\"gravity.y\"+\")\");\n #end\n };\n };\n else{\n this.gravityx=0;\n this.gravityy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityx!=this.gravityx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityx)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((this.gravityy!=this.gravityy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(this.gravityy)\"+\") :: \"+(\"vec_set(in n: \"+\"this.gravity\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n bodies=new ZNPList_ZPP_Body();\n wrap_bodies=ZPP_BodyList.get(bodies);\n wrap_bodies.zpp_inner.adder=bodies_adder;\n wrap_bodies.zpp_inner.subber=bodies_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_bodies.zpp_inner._modifiable=bodies_modifiable;\n #end\n compounds=new ZNPList_ZPP_Compound();\n wrap_compounds=ZPP_CompoundList.get(compounds);\n wrap_compounds.zpp_inner.adder=compounds_adder;\n wrap_compounds.zpp_inner.subber=compounds_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_compounds.zpp_inner._modifiable=compounds_modifiable;\n #end\n kinematics=new ZNPList_ZPP_Body();\n c_arbiters_true=new ZNPList_ZPP_ColArbiter();\n c_arbiters_false=new ZNPList_ZPP_ColArbiter();\n f_arbiters=new ZNPList_ZPP_FluidArbiter();\n s_arbiters=new ZNPList_ZPP_SensorArbiter();\n islands=new ZPP_Island();\n live=new ZNPList_ZPP_Body();\n wrap_live=ZPP_BodyList.get(live,true);\n staticsleep=new ZNPList_ZPP_Body();\n constraints=new ZNPList_ZPP_Constraint();\n wrap_constraints=ZPP_ConstraintList.get(constraints);\n wrap_constraints.zpp_inner.adder=constraints_adder;\n wrap_constraints.zpp_inner.subber=constraints_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_constraints.zpp_inner._modifiable=constraints_modifiable;\n #end\n live_constraints=new ZNPList_ZPP_Constraint();\n wrap_livecon=ZPP_ConstraintList.get(live_constraints,true);\n __static=ZPP_Body.__static();\n __static.zpp_inner.space=this;\n callbacks=new ZPP_Callback();\n midstep=false;\n listeners=new ZNPList_ZPP_Listener();\n wrap_listeners=ZPP_ListenerList.get(listeners);\n wrap_listeners.zpp_inner.adder=listeners_adder;\n wrap_listeners.zpp_inner.subber=listeners_subber;\n #if(!NAPE_RELEASE_BUILD)\n wrap_listeners.zpp_inner._modifiable=listeners_modifiable;\n #end\n callbackset_list=new ZPP_CallbackSet();\n mrca1=new ZNPList_ZPP_Interactor();\n mrca2=new ZNPList_ZPP_Interactor();\n prelisteners=new ZNPList_ZPP_InteractionListener();\n cbsets=new ZPP_CbSetManager(this);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function revoke_listener(x:ZPP_InteractionListener){}\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function unrevoke_listener(x:ZPP_InteractionListener){}\n public function addListener(x:ZPP_Listener){\n x.space=this;\n x.addedToSpace();\n if(x.interaction!=null){\n unrevoke_listener(x.interaction);\n }\n }\n public function remListener(x:ZPP_Listener){\n if(x.interaction!=null){\n revoke_listener(x.interaction);\n }\n x.removedFromSpace();\n x.space=null;\n }\n public function add_callbackset(cb:ZPP_CallbackSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !(cb.freed||cb.lazydel);\n };\n if(!res)throw \"assert(\"+\"!(cb.freed||cb.lazydel)\"+\") :: \"+(\"adding callbacket which is freed or lazydel??\");\n #end\n };\n cb.int1.cbsets.inlined_add(cb);\n cb.int2.cbsets.inlined_add(cb);\n callbackset_list.inlined_add(cb);\n }\n public function remove_callbackset(cb:ZPP_CallbackSet){\n cb.lazydel=true;\n cb.int1.cbsets.inlined_remove(cb);\n cb.int2.cbsets.inlined_remove(cb);\n }\n public function transmitType(p:ZPP_Body,new_type:Int){\n {\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(p.type==ZPP_Flags.id_BodyType_DYNAMIC){\n live.remove(p);\n }\n else if(p.type==ZPP_Flags.id_BodyType_KINEMATIC){\n kinematics.remove(p);\n staticsleep.remove(p);\n }\n else if(p.type==ZPP_Flags.id_BodyType_STATIC){\n staticsleep.remove(p);\n }\n p.type=new_type;\n if(p.type==ZPP_Flags.id_BodyType_KINEMATIC)kinematics.add(p);\n if(p.type==ZPP_Flags.id_BodyType_STATIC)static_validation(p);\n p.component.sleeping=true;\n {\n var o=p;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n }\n public#if NAPE_NO_INLINE#else inline #end\n function added_shape(s:ZPP_Shape,dontwake:Bool=false){\n if(!dontwake){\n {\n var o=s.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n bphase.insert(s);\n s.addedToSpace();\n }\n public function removed_shape(s:ZPP_Shape,deleting=false){\n var body=s.body;\n if(!deleting){\n body.wake();\n }\n var pre=null;\n {\n var cx_ite=body.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n var rem=xarb.ws1==s||xarb.ws2==s;\n if(rem){\n if(xarb.present!=0){\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cbsets from MRCA_chains?\");\n #end\n };\n cb1.validate();\n cb2.validate();\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n callbackset!=null;\n };\n if(!res)throw \"assert(\"+\"callbackset!=null\"+\") :: \"+(\"null callbackset on arbiter deletion?\");\n #end\n };\n callbackset.remove_arb(xarb);\n xarb.present--;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_END,function(listener:ZPP_InteractionListener){\n if((listener.itype&xarb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_END;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n xarb.present>=0;\n };\n if(!res)throw \"assert(\"+\"xarb.present>=0\"+\") :: \"+(\"xarb present < 0?\");\n #end\n };\n }\n if(xarb.b1!=body&&xarb.b1.isDynamic()){\n var o=xarb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(xarb.b2!=body&&xarb.b2.isDynamic()){\n var o=xarb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n xarb.lazyRetire(this,body);\n cx_ite=body.arbiters.erase(pre);\n continue;\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n bphase.remove(s);\n s.removedFromSpace();\n }\n public function addConstraint(con:ZPP_Constraint){\n con.space=this;\n con.addedToSpace();\n if(con.active){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component.island==null;\n };\n if(!res)throw \"assert(\"+\"con.component.island==null\"+\") :: \"+(\"newly added constraint has an island??\");\n #end\n };\n con.component.sleeping=true;\n wake_constraint(con,true);\n }\n }\n public function remConstraint(con:ZPP_Constraint){\n if(con.active){\n wake_constraint(con,true);\n live_constraints.remove(con);\n }\n con.removedFromSpace();\n con.space=null;\n }\n public function addCompound(x:ZPP_Compound){\n x.space=this;\n x.addedToSpace();\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addBody(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addConstraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n addCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function remCompound(x:ZPP_Compound){\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remBody(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remConstraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n remCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n x.removedFromSpace();\n x.space=null;\n }\n public function addBody(body:ZPP_Body,flag:Int=-1){\n body.space=this;\n body.addedToSpace();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n body.component.island==null;\n };\n if(!res)throw \"assert(\"+\"body.component.island==null\"+\") :: \"+(\"newly added body has an island??\");\n #end\n };\n body.component.sleeping=true;\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n added_shape(shape,true);\n cx_ite=cx_ite.next;\n }\n };\n if(body.isStatic()){\n static_validation(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"a2b f=\"+flag);\n #end\n };\n }\n else{\n if(body.isDynamic()){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n live.has(body);\n };\n if(!res)throw \"assert(\"+\"live.has(body)\"+\") :: \"+(\"a4b f=\"+flag);\n #end\n };\n }\n else{\n if(flag!=ZPP_Flags.id_BodyType_KINEMATIC)kinematics.add(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"a6b f=\"+flag);\n #end\n };\n }\n }\n }\n public function remBody(body:ZPP_Body,flag:Int=-1){\n if(body.isStatic()){\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !body.component.sleeping;\n };\n if(!res)throw \"assert(\"+\"!body.component.sleeping\"+\") :: \"+(\"as3\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"staticsleep.has(body)\"+\") :: \"+(\"as4\");\n #end\n };\n staticsleep.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"!staticsleep.has(body)\"+\") :: \"+(\"e1\");\n #end\n };\n }\n else{\n if(body.isDynamic()){\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n live.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !live.has(body);\n };\n if(!res)throw \"assert(\"+\"!live.has(body)\"+\") :: \"+(\"e3b\");\n #end\n };\n }\n else{\n if(flag!=ZPP_Flags.id_BodyType_KINEMATIC)kinematics.remove(body);\n {\n var o=body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,true);\n }\n }\n };\n staticsleep.remove(body);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !staticsleep.has(body);\n };\n if(!res)throw \"assert(\"+\"!staticsleep.has(body)\"+\") :: \"+(\"e4\");\n #end\n };\n }\n }\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n removed_shape(shape,true);\n cx_ite=cx_ite.next;\n }\n };\n body.removedFromSpace();\n body.space=null;\n }\n public function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesUnderPoint(x,y,filter,output);\n }\n public function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesUnderPoint(x,y,filter,output);\n }\n public function shapesInAABB(aabb:AABB,strict:Bool,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInAABB(aabb.zpp_inner,strict,cont,filter,output);\n }\n public function bodiesInAABB(aabb:AABB,strict:Bool,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInAABB(aabb.zpp_inner,strict,cont,filter,output);\n }\n public function shapesInCircle(pos:Vec2,rad:Float,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInCircle(pos.x,pos.y,rad,cont,filter,output);\n }\n public function bodiesInCircle(pos:Vec2,rad:Float,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInCircle(pos.x,pos.y,rad,cont,filter,output);\n }\n public function shapesInShape(shape:ZPP_Shape,cont:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n return bphase.shapesInShape(shape,cont,filter,output);\n }\n public function bodiesInShape(shape:ZPP_Shape,cont:Bool,filter:ZPP_InteractionFilter,output:BodyList){\n return bphase.bodiesInShape(shape,cont,filter,output);\n }\n public function rayCast(ray:Ray,inner:Bool,filter:InteractionFilter){\n return bphase.rayCast(ray.zpp_inner,inner,filter==null?null:filter.zpp_inner);\n }\n public function rayMultiCast(ray:Ray,inner:Bool,filter:InteractionFilter,output:RayResultList){\n return bphase.rayMultiCast(ray.zpp_inner,inner,filter==null?null:filter.zpp_inner,output);\n }\n var convexShapeList:ShapeList=null;\n public function convexCast(shape:ZPP_Shape,deltaTime:Float,filter:InteractionFilter,dynamics:Bool){\n var toi;\n {\n if(ZPP_ToiEvent.zpp_pool==null){\n toi=new ZPP_ToiEvent();\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_TOT++;\n ZPP_ToiEvent.POOL_ADDNEW++;\n #end\n }\n else{\n toi=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=toi.next;\n toi.next=null;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT--;\n ZPP_ToiEvent.POOL_ADD++;\n #end\n }\n toi.alloc();\n };\n prepareCast(shape);\n var body=shape.body;\n var prex=body.posx;\n var prey=body.posy;\n body.sweepTime=0;\n body.sweep_angvel=body.angvel;\n body.sweepIntegrate(deltaTime);\n var postx=body.posx;\n var posty=body.posy;\n shape.validate_sweepRadius();\n var rad=shape.sweepRadius;\n var aabb;\n {\n if(ZPP_AABB.zpp_pool==null){\n aabb=new ZPP_AABB();\n #if NAPE_POOL_STATS ZPP_AABB.POOL_TOT++;\n ZPP_AABB.POOL_ADDNEW++;\n #end\n }\n else{\n aabb=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=aabb.next;\n aabb.next=null;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT--;\n ZPP_AABB.POOL_ADD++;\n #end\n }\n aabb.alloc();\n };\n aabb.minx=({\n var x=prex;\n var y=postx;\n xy?x:y;\n })+rad;\n aabb.miny=({\n var x=prey;\n var y=posty;\n xy?x:y;\n })+rad;\n var list=convexShapeList=bphase.shapesInAABB(aabb,false,false,filter==null?null:filter.zpp_inner,convexShapeList);\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n var minAxisx:Float=0.0;\n var minAxisy:Float=0.0;\n {\n minAxisx=0;\n minAxisy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minAxisx!=minAxisx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minAxisx)\"+\") :: \"+(\"vec_set(in n: \"+\"minAxis\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minAxisy!=minAxisy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minAxisy)\"+\") :: \"+(\"vec_set(in n: \"+\"minAxis\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var minPosx:Float=0.0;\n var minPosy:Float=0.0;\n {\n minPosx=0;\n minPosy=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minPosx!=minPosx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minPosx)\"+\") :: \"+(\"vec_set(in n: \"+\"minPos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((minPosy!=minPosy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(minPosy)\"+\") :: \"+(\"vec_set(in n: \"+\"minPos\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n var mins=null;\n var mint=deltaTime+1;\n for(s in list){\n if(s!=shape.outer&&s.body!=body.outer){\n toi.s1=shape;\n toi.s2=s.zpp_inner;\n if(dynamics){\n s.zpp_inner.validate_sweepRadius();\n s.body.zpp_inner.sweep_angvel=s.body.zpp_inner.angvel;\n s.body.zpp_inner.sweepTime=0;\n ZPP_SweepDistance.dynamicSweep(toi,deltaTime,0,0,true);\n s.body.zpp_inner.sweepIntegrate(0);\n s.body.zpp_inner.sweepValidate(s.zpp_inner);\n }\n else{\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,0);\n }\n toi.toi*=deltaTime;\n if(toi.toi>0&&toi.toiy?x:y;\n })+rad;\n aabb.miny=({\n var x=prey;\n var y=posty;\n xy?x:y;\n })+rad;\n var list=convexShapeList=bphase.shapesInAABB(aabb,false,false,filter==null?null:filter.zpp_inner,convexShapeList);\n {\n var o=aabb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"aabb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n var ret=(output==null?new ConvexResultList():output);\n for(s in list){\n if(s!=shape.outer&&s.body!=body.outer){\n toi.s1=shape;\n toi.s2=s.zpp_inner;\n if(dynamics){\n s.zpp_inner.validate_sweepRadius();\n s.body.zpp_inner.sweep_angvel=s.body.zpp_inner.angvel;\n s.body.zpp_inner.sweepTime=0;\n ZPP_SweepDistance.dynamicSweep(toi,deltaTime,0,0,true);\n s.body.zpp_inner.sweepIntegrate(0);\n s.body.zpp_inner.sweepValidate(s.zpp_inner);\n }\n else{\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,0);\n }\n toi.toi*=deltaTime;\n if(toi.toi>0){\n var res=ZPP_ConvexRayResult.getConvex(Vec2.get(-toi.axis.x,-toi.axis.y),Vec2.get(toi.c2.x,toi.c2.y),toi.toi,s);\n {\n var pre=null;\n {\n var cx_ite=ret.zpp_inner.inner.begin();\n while(cx_ite!=null){\n var j=cx_ite.elem();\n {\n if((res.toi0||(rightSize>0&&right!=null)){\n if(leftSize==0){\n nxt=right;\n right=right.next;\n rightSize--;\n }\n else if(rightSize==0||right==null){\n nxt=left;\n left=left.next;\n leftSize--;\n }\n else if({\n if(left.elem().active&&right.elem().active)left.elem().oc1.dist1);\n xxlist.setbegin(head);\n }\n };\n }\n #if NAPE_TIMES Debug.SORT+=flash.Lib.getTimer()-pt;\n #end\n updateVel(deltaTime);\n warmStart();\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n iterateVel(velocityIterations);\n #if NAPE_TIMES Debug.VEL+=flash.Lib.getTimer()-pt;\n #end\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n updatePos(deltaTime);\n continuous=true;\n continuousCollisions(deltaTime);\n continuous=false;\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n iteratePos(positionIterations);\n #if NAPE_TIMES Debug.POS+=flash.Lib.getTimer()-pt;\n #end\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n var upos=!(cur.posx==cur.pre_posx&&cur.posy==cur.pre_posy);\n var urot=cur.pre_rot!=cur.rot;\n if(upos)cur.invalidate_pos();\n if(urot)cur.invalidate_rot();\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n var upos=!(cur.posx==cur.pre_posx&&cur.posy==cur.pre_posy);\n var urot=cur.pre_rot!=cur.rot;\n if(upos)cur.invalidate_pos();\n if(urot)cur.invalidate_rot();\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n var pre=null;\n {\n var cx_ite=staticsleep.begin();\n while(cx_ite!=null){\n var b=cx_ite.elem();\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !b.isDynamic();\n };\n if(!res)throw \"assert(\"+\"!b.isDynamic()\"+\") :: \"+(\"step :: swef static/kinematics\");\n #end\n };\n if(!b.isKinematic()||(b.velx==0&&b.vely==0&&b.angvel==0)){\n if(b.kinematicDelaySleep){\n b.kinematicDelaySleep=false;\n {\n cx_ite=cx_ite.next;\n continue;\n };\n }\n b.component.sleeping=true;\n cx_ite=staticsleep.inlined_erase(pre);\n continue;\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n #if NAPE_TIMES var pt=flash.Lib.getTimer();\n #end\n doForests(deltaTime);\n sleepArbiters();\n #if NAPE_TIMES Debug.FOR+=flash.Lib.getTimer()-pt;\n #end\n midstep=false;\n var pre=null;\n {\n var cx_ite=callbackset_list.begin();\n while(cx_ite!=null){\n var set=cx_ite.elem();\n {\n if(set.really_empty()){\n cx_ite=callbackset_list.inlined_erase(pre);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !set.int1.cbsets.has(set);\n };\n if(!res)throw \"assert(\"+\"!set.int1.cbsets.has(set)\"+\") :: \"+(\"freeing set that wasn't lazy del'ed \"+set.int1.id+\" \"+set.int2.id);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !set.int2.cbsets.has(set);\n };\n if(!res)throw \"assert(\"+\"!set.int2.cbsets.has(set)\"+\") :: \"+(\"freeing set that wasn't lazy del'ed \"+set.int1.id+\" \"+set.int2.id);\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n set.lazydel;\n };\n if(!res)throw \"assert(\"+\"set.lazydel\"+\") :: \"+(\"freeing set not with lazydel true\");\n #end\n };\n {\n var o=set;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_CallbackSet\"+\", in obj: \"+\"set\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_CallbackSet.zpp_pool;\n ZPP_CallbackSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_CallbackSet.POOL_CNT++;\n ZPP_CallbackSet.POOL_SUB++;\n #end\n };\n continue;\n }\n var sleeping=set.sleeping();\n ZPP_CbSet.find_all(set.int1.cbSet,set.int2.cbSet,ZPP_Flags.id_CbEvent_ONGOING,function(x:ZPP_InteractionListener){\n if((!sleeping||x.allowSleepingCallbacks)&&!set.empty_arb(x.itype)){\n var cb=push_callback(x);\n cb.event=ZPP_Flags.id_CbEvent_ONGOING;\n ZPP_Interactor.int_callback(set,x,cb);\n cb.set=set;\n }\n });\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n while(!callbacks.empty()){\n var cb=callbacks.pop();\n if(cb.listener.type==ZPP_Flags.id_ListenerType_BODY){\n var o=cb.listener.body;\n o.handler(cb.wrapper_body());\n }\n else if(cb.listener.type==ZPP_Flags.id_ListenerType_CONSTRAINT){\n var o=cb.listener.constraint;\n o.handler(cb.wrapper_con());\n }\n else if(cb.listener.type==ZPP_Flags.id_ListenerType_INTERACTION){\n var o=cb.listener.interaction;\n o.handleri(cb.wrapper_int());\n }\n {\n var o=cb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Callback\"+\", in obj: \"+\"cb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Callback.zpp_pool;\n ZPP_Callback.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Callback.POOL_CNT++;\n ZPP_Callback.POOL_SUB++;\n #end\n };\n }\n }\n public var toiEvents:ZNPList_ZPP_ToiEvent=null;\n public function continuousCollisions(deltaTime:Float){\n var MAX_VEL=2*Math.PI/deltaTime;\n bphase.broadphase(this,false);\n var curTimeAlpha=0.0;\n while(curTimeAlpha<1&&!toiEvents.empty()){\n var minTOI:ZPP_ToiEvent=null;\n var minTime=2.0;\n var minKinematic=false;\n var preMin:ZNPNode_ZPP_ToiEvent=null;\n var pre:ZNPNode_ZPP_ToiEvent=null;\n {\n var cx_ite=toiEvents.begin();\n while(cx_ite!=null){\n var toi=cx_ite.elem();\n {\n var b1=toi.s1.body;\n var b2=toi.s2.body;\n if(b1.sweepFrozen&&b2.sweepFrozen){\n if(toi.toi!=0&&ZPP_Collide.testCollide_safe(toi.s1,toi.s2)){\n toi.toi=0;\n }\n else{\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n if((toi.frozen1!=b1.sweepFrozen||toi.frozen2!=b2.sweepFrozen)){\n if(!toi.kinematic){\n toi.frozen1=b1.sweepFrozen;\n toi.frozen2=b2.sweepFrozen;\n if(toi.frozen1){\n var tmp=toi.s1;\n toi.s1=toi.s2;\n toi.s2=tmp;\n toi.frozen1=false;\n toi.frozen2=true;\n }\n ZPP_SweepDistance.staticSweep(toi,deltaTime,0,Config.collisionSlopCCD);\n if(toi.toi<0){\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n else{\n cx_ite=toiEvents.erase(pre);\n {\n var o=toi;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ToiEvent\"+\", in obj: \"+\"toi\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ToiEvent.zpp_pool;\n ZPP_ToiEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ToiEvent.POOL_CNT++;\n ZPP_ToiEvent.POOL_SUB++;\n #end\n };\n continue;\n }\n }\n if(toi.toi>=0&&(toi.toi=0;\n };\n if(!res)throw \"assert(\"+\"arb.present>=0\"+\") :: \"+(\"xarb present <0 ?\");\n #end\n };\n };\n }\n };\n remove_callbackset(callbackset);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public function nullInteractorType(intx:ZPP_Interactor,me:ZPP_Interactor=null){\n if(me==null)me=intx;\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var body=cx_ite.elem();\n nullInteractorType(body,me);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var comp=cx_ite.elem();\n nullInteractorType(comp,me);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(xarb.present==0){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if(i1!=me&&i2!=me){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset!=null){\n xarb.present--;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n xarb.present>=0;\n };\n if(!res)throw \"assert(\"+\"xarb.present>=0\"+\") :: \"+(\"xarb present <0?\");\n #end\n };\n callbackset.remove_arb(xarb);\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n public function freshListenerType(cb1:ZPP_CbSet,cb2:ZPP_CbSet){\n var stack=new ZNPList_ZPP_Interactor();\n {\n var cx_ite=cb1.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n if(cb1!=cb2){\n var cx_ite=cb2.interactors.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n while(!stack.empty()){\n var intx=stack.pop_unsafe();\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n stack.add(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(!xarb.presentable){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n if(i1.cbSet!=cb1&&i1.cbSet!=cb2){\n cx_ite=cx_ite.next;\n continue;\n };\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if((i1.cbSet==cb1&&i2.cbSet!=cb2)||(i1.cbSet==cb2&&i2.cbSet!=cb1)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n if(callbackset.add_arb(xarb)){\n xarb.present++;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n }\n public function freshInteractorType(intx:ZPP_Interactor,me:ZPP_Interactor=null){\n if(me==null)me=intx;\n if(intx.isCompound()){\n var comp=intx.icompound;\n {\n var cx_ite=comp.bodies.begin();\n while(cx_ite!=null){\n var body=cx_ite.elem();\n freshInteractorType(body,me);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=comp.compounds.begin();\n while(cx_ite!=null){\n var comp=cx_ite.elem();\n freshInteractorType(comp,me);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var xbody=if(intx.isBody())intx.ibody else intx.ishape.body;\n var xshp=if(intx.isShape())intx.ishape else null;\n {\n var cx_ite=xbody.arbiters.begin();\n while(cx_ite!=null){\n var xarb=cx_ite.elem();\n {\n if(!xarb.presentable){\n cx_ite=cx_ite.next;\n continue;\n };\n if(xshp!=null&&!(xarb.ws1==xshp||xarb.ws2==xshp)){\n cx_ite=cx_ite.next;\n continue;\n };\n MRCA_chains(xarb.ws1,xarb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n if(i1!=me&&i2!=me){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cbset from MRCA_chain?\");\n #end\n };\n cb1.validate();\n cb2.validate();\n if(!ZPP_CbSet.empty_intersection(cb1,cb2)){\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n if(callbackset.add_arb(xarb)){\n xarb.present++;\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n public function wakeCompound(x:ZPP_Compound){\n {\n var cx_ite=x.bodies.begin();\n while(cx_ite!=null){\n var y=cx_ite.elem();\n {\n var o=y;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.constraints.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n wake_constraint(i);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=x.compounds.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n wakeCompound(i);\n cx_ite=cx_ite.next;\n }\n };\n }\n public function wakeIsland(i:ZPP_Island){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n i.sleep;\n };\n if(!res)throw \"assert(\"+\"i.sleep\"+\") :: \"+(\"this island is not sleeping but referenced? wtf\");\n #end\n };\n while(!i.comps.empty()){\n var c=i.comps.pop_unsafe();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n c.sleeping;\n };\n if(!res)throw \"assert(\"+\"c.sleeping\"+\") :: \"+(\"???\");\n #end\n };\n c.waket=stamp+(midstep?0:1);\n if(c.isBody){\n var b=c.body;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b.space==this;\n };\n if(!res)throw \"assert(\"+\"b.space==this\"+\") :: \"+(\"wakeIsland:: body is not actually IN this space??\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n b.isDynamic();\n };\n if(!res)throw \"assert(\"+\"b.isDynamic()\"+\") :: \"+(\"din din\");\n #end\n };\n live.add(b);\n {\n var cx_ite=b.arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(arb.sleeping){\n arb.sleeping=false;\n arb.up_stamp+=stamp-arb.sleep_stamp;\n if(arb.type==ZPP_Arbiter.COL){\n var carb=arb.colarb;\n if(carb.stat)c_arbiters_true.inlined_add(carb);\n else c_arbiters_false.inlined_add(carb);\n }\n else if(arb.type==ZPP_Arbiter.FLUID)f_arbiters.inlined_add(arb.fluidarb);\n else s_arbiters.inlined_add(arb.sensorarb);\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n bodyCbWake(b);\n c.reset();\n if(!b.isStatic()){\n var cx_ite=b.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n if(shape.node!=null)bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n var con=c.constraint;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.space==this;\n };\n if(!res)throw \"assert(\"+\"con.space==this\"+\") :: \"+(\"wakeIsland:: constraint is not actually IN this space??\");\n #end\n };\n live_constraints.inlined_add(con);\n constraintCbWake(con);\n c.reset();\n }\n }\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n public function non_inlined_wake(o:ZPP_Body,fst=false){\n {\n var o=o;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,fst);\n }\n }\n };\n }\n public function really_wake(o:ZPP_Body,fst=false){\n if(o.component.island==null){\n o.component.sleeping=false;\n if(o.isKinematic()||o.isStatic())staticsleep.inlined_add(o);\n else live.inlined_add(o);\n {\n var cx_ite=o.constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n if(con.space==this)wake_constraint(con);\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=o.arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(arb.sleeping){\n arb.sleeping=false;\n arb.up_stamp+=stamp+(midstep?0:1)-arb.sleep_stamp;\n if(arb.type==ZPP_Arbiter.COL){\n var carb=arb.colarb;\n if(carb.stat)c_arbiters_true.inlined_add(carb);\n else c_arbiters_false.inlined_add(carb);\n }\n else if(arb.type==ZPP_Arbiter.FLUID)f_arbiters.inlined_add(arb.fluidarb);\n else s_arbiters.inlined_add(arb.sensorarb);\n }\n if(arb.type!=ZPP_Arbiter.SENSOR&&!arb.cleared&&arb.up_stamp>=stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n if(!fst&&o.isDynamic())bodyCbWake(o);\n if(!fst&&!bphase.is_sweep&&!o.isStatic()){\n var cx_ite=o.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n if(shape.node!=null)bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n wakeIsland(o.component.island);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component.island==null;\n };\n if(!res)throw \"assert(\"+\"o.component.island==null\"+\") :: \"+(\"woken, but island non-null?\");\n #end\n };\n }\n public function wake_constraint(con:ZPP_Constraint,fst=false){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.space==this;\n };\n if(!res)throw \"assert(\"+\"con.space==this\"+\") :: \"+(\"constraint woken, but not actually IN the space!\");\n #end\n };\n if(con.active){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component!=null;\n };\n if(!res)throw \"assert(\"+\"con.component!=null\"+\") :: \"+(\"constraint woken but no component exists?\");\n #end\n };\n con.component.waket=stamp+(midstep?0:1);\n if(con.component.sleeping){\n if(con.component.island==null){\n con.component.sleeping=false;\n live_constraints.inlined_add(con);\n con.wake_connected();\n if(!fst)constraintCbWake(con);\n }\n else{\n wakeIsland(con.component.island);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n con.component.island==null;\n };\n if(!res)throw \"assert(\"+\"con.component.island==null\"+\") :: \"+(\"woken (con), but island non-null?\");\n #end\n };\n return true;\n }\n else return false;\n }\n else return false;\n }\n public function doForests(dt:Float){\n {\n var cx_ite=c_arbiters_false.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(!arb.cleared&&arb.up_stamp==stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b2.isDynamic()){\n var xr=({\n if(arb.b1.component==arb.b1.component.parent)arb.b1.component;\n else{\n var obj=arb.b1.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n var yr=({\n if(arb.b2.component==arb.b2.component.parent)arb.b2.component;\n else{\n var obj=arb.b2.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(xr!=yr){\n if(xr.rankyr.rank)yr.parent=xr;\n else{\n yr.parent=xr;\n xr.rank++;\n }\n }\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=f_arbiters.begin();\n while(cx_ite!=null){\n var arb=cx_ite.elem();\n {\n if(!arb.cleared&&arb.up_stamp==stamp&&((arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0)){\n if(arb.b1.isDynamic()&&arb.b2.isDynamic()){\n var xr=({\n if(arb.b1.component==arb.b1.component.parent)arb.b1.component;\n else{\n var obj=arb.b1.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n var yr=({\n if(arb.b2.component==arb.b2.component.parent)arb.b2.component;\n else{\n var obj=arb.b2.component;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(xr!=yr){\n if(xr.rankyr.rank)yr.parent=xr;\n else{\n yr.parent=xr;\n xr.rank++;\n }\n }\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n {\n var cx_ite=live_constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n con.forest();\n cx_ite=cx_ite.next;\n }\n };\n while(!live.empty()){\n var o=live.inlined_pop_unsafe();\n var oc=o.component;\n var root=({\n if(oc==oc.parent)oc;\n else{\n var obj=oc;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n if(root.island==null){\n {\n if(ZPP_Island.zpp_pool==null){\n root.island=new ZPP_Island();\n #if NAPE_POOL_STATS ZPP_Island.POOL_TOT++;\n ZPP_Island.POOL_ADDNEW++;\n #end\n }\n else{\n root.island=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=root.island.next;\n root.island.next=null;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT--;\n ZPP_Island.POOL_ADD++;\n #end\n }\n root.island.alloc();\n };\n islands.inlined_add(root.island);\n root.island.sleep=true;\n }\n oc.island=root.island;\n oc.island.comps.inlined_add(oc);\n var rest=o.atRest(dt);\n oc.island.sleep=oc.island.sleep&&rest;\n if(oc.waket>oc.island.waket)oc.island.waket=oc.waket;\n }\n while(!live_constraints.empty()){\n var o=live_constraints.inlined_pop_unsafe();\n var oc=o.component;\n var root=({\n if(oc==oc.parent)oc;\n else{\n var obj=oc;\n var stack=null;\n while(obj!=obj.parent){\n var nxt=obj.parent;\n obj.parent=stack;\n stack=obj;\n obj=nxt;\n }\n while(stack!=null){\n var nxt=stack.parent;\n stack.parent=obj;\n stack=nxt;\n }\n obj;\n }\n });\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n root.island!=null;\n };\n if(!res)throw \"assert(\"+\"root.island!=null\"+\") :: \"+(\"constraint without bodies?\");\n #end\n };\n oc.island=root.island;\n oc.island.comps.inlined_add(oc);\n if(oc.waket>oc.island.waket)oc.island.waket=oc.waket;\n }\n while(!islands.empty()){\n var i=islands.inlined_pop_unsafe();\n if(i.sleep){\n {\n var cx_ite=i.comps.begin();\n while(cx_ite!=null){\n var c=cx_ite.elem();\n {\n if(c.isBody){\n var b=c.body;\n {\n b.velx=0;\n b.vely=0;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((b.velx!=b.velx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(b.velx)\"+\") :: \"+(\"vec_set(in n: \"+\"b.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((b.vely!=b.vely));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(b.vely)\"+\") :: \"+(\"vec_set(in n: \"+\"b.vel\"+\",in x: \"+\"0\"+\",in y: \"+\"0\"+\")\");\n #end\n };\n };\n b.angvel=0;\n c.sleeping=true;\n {\n var cx_ite=b.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n }\n bodyCbSleep(b);\n }\n else{\n var con=c.constraint;\n constraintCbSleep(con);\n c.sleeping=true;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n else{\n while(!i.comps.empty()){\n var c=i.comps.inlined_pop_unsafe();\n c.waket=i.waket;\n if(c.isBody)live.inlined_add(c.body);\n else live_constraints.inlined_add(c.constraint);\n c.reset();\n }\n {\n var o=i;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Island\"+\", in obj: \"+\"i\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Island.zpp_pool;\n ZPP_Island.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Island.POOL_CNT++;\n ZPP_Island.POOL_SUB++;\n #end\n };\n }\n }\n }\n public function sleepArbiters(){\n {\n var pre=null;\n var arbs=c_arbiters_true;\n var arbite=arbs.begin();\n var fst=c_arbiters_false!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n arbite=c_arbiters_false.begin();\n arbs=c_arbiters_false;\n pre=null;\n }\n };\n }\n };\n {\n var pre=null;\n var arbs=f_arbiters;\n var arbite=arbs.begin();\n var fst=null!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n }\n };\n {\n var pre=null;\n var arbs=s_arbiters;\n var arbite=arbs.begin();\n var fst=null!=null;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n while(arbite!=null){\n var arb=arbite.elem();\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !arb.cleared;\n };\n if(!res)throw \"assert(\"+\"!arb.cleared\"+\") :: \"+(\"arb cleared in sleepArbiters\");\n #end\n };\n if(arb.b1.component.sleeping&&arb.b2.component.sleeping){\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n arbite=arbs.inlined_erase(pre);\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n continue;\n }\n pre=arbite;\n arbite=arbite.next;\n {\n if(fst&&arbite==null){\n fst=false;\n/*silly null. issues*/\n arbs=null;\n pre=null;\n }\n };\n }\n };\n }\n public function static_validation(body:ZPP_Body){\n if(!body.shapes.empty()){\n body.validate_aabb();\n }\n body.validate_mass();\n body.validate_inertia();\n #if(!NAPE_RELEASE_BUILD)\n if(body.velx!=0||body.vely!=0||body.angvel!=0)throw \"Error: Static body cannot have any real velocity, only kinematic or surface velocities\";\n #end\n {\n var cx_ite=body.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n body.sweepFrozen=true;\n }\n public function validation(){\n cbsets.validate();\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n cur.sweepRadius=0;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n s.validate_sweepRadius();\n if(s.sweepRadius>cur.sweepRadius)cur.sweepRadius=s.sweepRadius;\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.validate_mass();\n cur.validate_inertia();\n if(!cur.shapes.empty()){\n cur.validate_aabb();\n cur.validate_worldCOM();\n }\n cur.validate_gravMass();\n cur.validate_axis();\n #if(!NAPE_RELEASE_BUILD)\n if(!cur.nomove&&cur.isDynamic()&&cur.mass==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false\";\n }\n if(!cur.norotate&&cur.isDynamic()&&cur.inertia==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false\";\n }\n #end\n if(!false){\n if(cur.component.woken&&cur.cbSet!=null){\n {\n var cx_ite=cur.cbSet.bodylisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.body=cur;\n };\n cx_ite=cx_ite.next;\n }\n }\n }\n cur.component.woken=false;\n }\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n cur.sweepRadius=0;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n if(s.isPolygon()){\n s.polygon.splice_collinear();\n #if(!NAPE_RELEASE_BUILD)\n var res=s.polygon.valid();\n if(res!=ValidationResult.VALID){\n throw \"Error: Cannot simulate with an invalid Polygon : \"+s.polygon.outer.toString()+\" is invalid : \"+res.toString();\n }\n #end\n s.polygon.validate_gaxi();\n }\n s.validate_sweepRadius();\n if(s.sweepRadius>cur.sweepRadius)cur.sweepRadius=s.sweepRadius;\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.validate_mass();\n cur.validate_inertia();\n if(!cur.shapes.empty()){\n cur.validate_aabb();\n cur.validate_worldCOM();\n }\n cur.validate_gravMass();\n cur.validate_axis();\n #if(!NAPE_RELEASE_BUILD)\n if(!cur.nomove&&cur.isDynamic()&&cur.mass==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 mass unless allowMovement is false\";\n }\n if(!cur.norotate&&cur.isDynamic()&&cur.inertia==0){\n throw \"Error: Dynamic Body cannot be simulated with 0 inertia unless allowRotation is false\";\n }\n #end\n if(!true){\n if(cur.component.woken&&cur.cbSet!=null){\n {\n var cx_ite=cur.cbSet.bodylisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.body=cur;\n };\n cx_ite=cx_ite.next;\n }\n }\n }\n cur.component.woken=false;\n }\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var shape=cx_ite.elem();\n bphase.sync(shape);\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n var cx_ite=live_constraints.begin();\n while(cx_ite!=null){\n var con=cx_ite.elem();\n {\n if(con.active){\n #if(!NAPE_RELEASE_BUILD)\n con.validate();\n #end\n if(con.component.woken&&con.cbSet!=null){\n {\n var cx_ite=con.cbSet.conlisteners.begin();\n while(cx_ite!=null){\n var i=cx_ite.elem();\n {\n if(i.event!=ZPP_Flags.id_CbEvent_WAKE){\n cx_ite=cx_ite.next;\n continue;\n };\n var cb=push_callback(i);\n cb.event=ZPP_Flags.id_CbEvent_WAKE;\n cb.constraint=con;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n con.component.woken=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function updateVel(dt:Float){\n var pre=null;\n var linDrag=1-(dt*global_lin_drag);\n var angDrag=1-(dt*global_ang_drag);\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n if(cur.smass!=0.0){\n var time=dt*cur.imass;\n cur.velx=(linDrag*cur.velx)+(cur.forcex+gravityx*cur.gravMass)*time;\n cur.vely=(linDrag*cur.vely)+(cur.forcey+gravityy*cur.gravMass)*time;\n }\n if(cur.sinertia!=0.0){\n var dpx:Float=0.0;\n var dpy:Float=0.0;\n {\n dpx=cur.worldCOMx-cur.posx;\n dpy=cur.worldCOMy-cur.posy;\n };\n var torque=cur.torque+((gravityy*dpx-gravityx*dpy)*cur.gravMass);\n cur.angvel=(angDrag*cur.angvel)+(torque*dt*cur.iinertia);\n }\n pre=cx_ite;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n public function updatePos(dt:Float){\n var MAX_VEL=2*Math.PI/dt;\n {\n {\n var cx_ite=live.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n cur.sweepTime=0;\n cur.sweep_angvel=(cur.angvel)%MAX_VEL;\n cur.sweepIntegrate(dt);\n if(!cur.disableCCD){\n var linThreshold=Config.staticCCDLinearThreshold*cur.sweepRadius;\n var angThreshold=Config.staticCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold*linThreshold)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold*angThreshold))||cur.isKinematic()){\n var angvel=cur.sweep_angvel;\n if(angvel<0)angvel=-angvel;\n var iangvel=1/angvel;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n var aabb=s.aabb;\n var minx=aabb.minx;\n var miny=aabb.miny;\n var maxx=aabb.maxx;\n var maxy=aabb.maxy;\n var count:Int=(#if flash9 untyped __int__(angvel*dt*s.sweepCoef*(1/120))#else Std.int(angvel*dt*s.sweepCoef*(1/120))#end);\n if(count>8)count=8;\n var anginc=(angvel*dt)/count;\n cur.sweepIntegrate(dt);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n for(i in 1...count){\n cur.sweepIntegrate(anginc*i*iangvel);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n }\n bphase.sync(s);\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.sweepFrozen=false;\n if(cur.isDynamic()&&cur.bulletEnabled){\n var linThreshold2=Config.bulletCCDLinearThreshold*cur.sweepRadius;\n var angThreshold2=Config.bulletCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold2*linThreshold2)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold2*angThreshold2))){\n cur.bullet=true;\n }\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n {\n {\n var cx_ite=kinematics.begin();\n while(cx_ite!=null){\n var cur=cx_ite.elem();\n {\n {\n cur.pre_posx=cur.posx;\n cur.pre_posy=cur.posy;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posx!=cur.pre_posx));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posx)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((cur.pre_posy!=cur.pre_posy));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(cur.pre_posy)\"+\") :: \"+(\"vec_set(in n: \"+\"cur.pre_pos\"+\",in x: \"+\"cur.posx\"+\",in y: \"+\"cur.posy\"+\")\");\n #end\n };\n };\n cur.pre_rot=cur.rot;\n cur.sweepTime=0;\n cur.sweep_angvel=(cur.angvel)%MAX_VEL;\n cur.sweepIntegrate(dt);\n if(!cur.disableCCD){\n var linThreshold=Config.staticCCDLinearThreshold*cur.sweepRadius;\n var angThreshold=Config.staticCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold*linThreshold)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold*angThreshold))||cur.isKinematic()){\n var angvel=cur.sweep_angvel;\n if(angvel<0)angvel=-angvel;\n var iangvel=1/angvel;\n {\n var cx_ite=cur.shapes.begin();\n while(cx_ite!=null){\n var s=cx_ite.elem();\n {\n var aabb=s.aabb;\n var minx=aabb.minx;\n var miny=aabb.miny;\n var maxx=aabb.maxx;\n var maxy=aabb.maxy;\n var count:Int=(#if flash9 untyped __int__(angvel*dt*s.sweepCoef*(1/120))#else Std.int(angvel*dt*s.sweepCoef*(1/120))#end);\n if(count>8)count=8;\n var anginc=(angvel*dt)/count;\n cur.sweepIntegrate(dt);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n for(i in 1...count){\n cur.sweepIntegrate(anginc*i*iangvel);\n s.force_validate_aabb();\n if(minxaabb.maxx)aabb.maxx=maxx else maxx=aabb.maxx;\n if(maxy>aabb.maxy)aabb.maxy=maxy else maxy=aabb.maxy;\n }\n bphase.sync(s);\n };\n cx_ite=cx_ite.next;\n }\n };\n cur.sweepFrozen=false;\n if(cur.isDynamic()&&cur.bulletEnabled){\n var linThreshold2=Config.bulletCCDLinearThreshold*cur.sweepRadius;\n var angThreshold2=Config.bulletCCDAngularThreshold;\n if((((cur.velx*cur.velx+cur.vely*cur.vely)*dt*dt)>(linThreshold2*linThreshold2)||(cur.angvel*cur.angvel*dt*dt)>(angThreshold2*angThreshold2))){\n cur.bullet=true;\n }\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n }\n else{\n cur.sweepFrozen=true;\n cur.bullet=false;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n }\n public var continuous:Bool=false;\n public function presteparb(arb:ZPP_Arbiter,dt:Float,?cont=false){\n if(!arb.cleared&&(arb.b1.component.sleeping&&arb.b2.component.sleeping)){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n false;\n };\n if(!res)throw \"assert(\"+\"false\"+\") :: \"+(\"sleep in prestep (no longer should occur)\");\n #end\n };\n arb.sleep_stamp=stamp;\n arb.sleeping=true;\n return true;\n }\n #if NAPE_TIMES Debug.ACNT++;\n #end\n if(!arb.cleared||arb.present!=0||arb.intchange){\n var endcb=(!cont&&arb.up_stamp==stamp-1)&&!arb.cleared&&!arb.intchange;\n var begcb=(arb.fresh)&&!arb.cleared&&!arb.intchange;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !begcb||arb.up_stamp==stamp;\n };\n if(!res)throw \"assert(\"+\"!begcb||arb.up_stamp==stamp\"+\") :: \"+(\" fresh -> active=true hasn't held :(\"+begcb+\" \"+arb.up_stamp+\" \"+stamp);\n #end\n };\n if(endcb){\n arb.endGenerated=stamp;\n }\n if(begcb||endcb||arb.cleared||arb.intchange){\n inlined_MRCA_chains(arb.ws1,arb.ws2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset=ZPP_Interactor.get(i1,i2);\n if(begcb||arb.intchange){\n if(callbackset==null){\n callbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(callbackset);\n }\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_BEGIN,function(listener:ZPP_InteractionListener){\n if((listener.itype&arb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_BEGIN;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.add_arb(arb))arb.present++;\n }\n else{\n arb.present--;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n arb.present>=0;\n };\n if(!res)throw \"assert(\"+\"arb.present>=0\"+\") :: \"+(\"arb present < 0?\");\n #end\n };\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n callbackset!=null;\n };\n if(!res)throw \"assert(\"+\"callbackset!=null\"+\") :: \"+(\"end arbiter with no callbackset\");\n #end\n };\n callbackset.remove_arb(arb);\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_END,function(listener:ZPP_InteractionListener){\n if((listener.itype&arb.type)!=0&&callbackset.empty_arb(listener.itype)){\n var cb=push_callback(listener);\n cb.event=ZPP_Flags.id_CbEvent_END;\n ZPP_Interactor.int_callback(callbackset,listener,cb);\n cb.set=callbackset;\n }\n });\n if(callbackset.really_empty()){\n remove_callbackset(callbackset);\n }\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n arb.fresh=false;\n arb.intchange=false;\n }\n if(arb.cleared||arb.up_stamp+(arb.type==ZPP_Arbiter.COL?Config.arbiterExpirationDelay:0)s2.type){\n sa=s2;\n sb=s1;\n }\n else if(s1.type==s2.type){\n if(s1.id\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n if(ZPP_FluidArbiter.zpp_pool==null){\n arb=new ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_TOT++;\n ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT--;\n ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n }\n else{\n if(xarb.fluidarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_FluidArbiter.zpp_pool==null){\n arb=new ZPP_FluidArbiter();\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_TOT++;\n ZPP_FluidArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT--;\n ZPP_FluidArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n first=true;\n swapped=true;\n }\n else arb=xarb.fluidarb;\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_FLUID;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.flowCollide(sa,sb,arb)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n f_arbiters.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.FLUIDstamp!=stamp||continuous)&&(callbackset.FLUIDstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.FLUIDstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if false arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.FLUIDstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.FLUIDstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(true){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(true&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n f_arbiters.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_FluidArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_FluidArbiter.zpp_pool;\n ZPP_FluidArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_FluidArbiter.POOL_CNT++;\n ZPP_FluidArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n else if(itype==1){\n var carbs=stat?c_arbiters_true:c_arbiters_false;\n var xarb=if(in_arb==null)({\n var ret:ZPP_Arbiter=null;\n var b=if(b1.arbiters.length\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n {\n if(ZPP_ColArbiter.zpp_pool==null){\n arb=new ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_TOT++;\n ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT--;\n ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.stat=stat;\n }\n else{\n if(xarb.colarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_ColArbiter.zpp_pool==null){\n arb=new ZPP_ColArbiter();\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_TOT++;\n ZPP_ColArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT--;\n ZPP_ColArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n arb.stat=stat;\n first=true;\n swapped=true;\n }\n else{\n arb=xarb.colarb;\n reverse=sa!=arb.s1;\n if(arb.stat!=stat){\n arb.stat=stat;\n if(!arb.sleeping){\n (if(stat)c_arbiters_false else c_arbiters_true).remove(arb);\n carbs.add(arb);\n }\n }\n }\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_COLLISION;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.contactCollide(sa,sb,arb,reverse)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n carbs.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.COLLISIONstamp!=stamp||continuous)&&(callbackset.COLLISIONstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.COLLISIONstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if true arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.COLLISIONstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.COLLISIONstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(true){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(true&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n carbs.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_ColArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_ColArbiter.zpp_pool;\n ZPP_ColArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_ColArbiter.POOL_CNT++;\n ZPP_ColArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n else{\n var xarb=if(in_arb==null)({\n var ret:ZPP_Arbiter=null;\n var b=if(b1.arbiters.length\");\n #end\n };\n if(arb.id==sa.id&&arb.di==sb.id){\n ret=arb;\n break;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n ret;\n })else in_arb;\n var first=xarb==null;\n var arb;\n var swapped=false;\n if(first){\n if(ZPP_SensorArbiter.zpp_pool==null){\n arb=new ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_TOT++;\n ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT--;\n ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n }\n else{\n if(xarb.sensorarb==null){\n xarb.lazyRetire(this,null);\n {\n if(ZPP_SensorArbiter.zpp_pool==null){\n arb=new ZPP_SensorArbiter();\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_TOT++;\n ZPP_SensorArbiter.POOL_ADDNEW++;\n #end\n }\n else{\n arb=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=arb.next;\n arb.next=null;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT--;\n ZPP_SensorArbiter.POOL_ADD++;\n #end\n }\n arb.alloc();\n };\n arb.intchange=true;\n first=true;\n swapped=true;\n }\n else arb=xarb.sensorarb;\n }\n ret={\n var inttype=ZPP_Flags.id_InteractionType_SENSOR;\n if(first||arb.stamp!=stamp||continuous){\n arb.stamp=stamp;\n if(ZPP_Collide.testCollide(sa,sb)){\n if(first){\n arb.assign(s1,s2,sa.id,sb.id);\n s_arbiters.inlined_add(arb);\n arb.fresh=!swapped;\n }\n else{\n arb.fresh=(arb.up_stamparb.ws2.id?arb.ws2:arb.ws1;\n var arbs2=arb.ws1.id>arb.ws2.id?arb.ws1:arb.ws2;\n inlined_MRCA_chains(arbs1,arbs2);\n {\n var cx_ite=mrca1.begin();\n while(cx_ite!=null){\n var i1=cx_ite.elem();\n {\n {\n var cx_ite=mrca2.begin();\n while(cx_ite!=null){\n var i2=cx_ite.elem();\n {\n var cb1=i1.cbSet;\n var cb2=i2.cbSet;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cb1!=null&&cb2!=null;\n };\n if(!res)throw \"assert(\"+\"cb1!=null&&cb2!=null\"+\") :: \"+(\"null cb from MRCA_chains?\");\n #end\n };\n if(ZPP_CbSet.empty_intersection(cb1,cb2)){\n cx_ite=cx_ite.next;\n continue;\n };\n var callbackset:ZPP_CallbackSet=null;\n var ncallbackset:ZPP_CallbackSet=null;\n prelisteners.inlined_clear();\n var lite:ZNPNode_ZPP_InteractionListener=null;\n ZPP_CbSet.find_all(cb1,cb2,ZPP_Flags.id_CbEvent_PRE,function(listener:ZPP_InteractionListener){\n if((listener.itype&inttype)!=0){\n lite=prelisteners.inlined_insert(lite,listener);\n anyimpure=anyimpure||!listener.pure;\n }\n });\n if(prelisteners.empty()){\n cx_ite=cx_ite.next;\n continue;\n };\n callbackset=ZPP_Interactor.get(i1,i2);\n if(callbackset==null){\n ncallbackset=ZPP_CallbackSet.get(i1,i2);\n add_callbackset(ncallbackset);\n }\n if(callbackset==null||((callbackset.SENSORstamp!=stamp||continuous)&&(callbackset.SENSORstate&ZPP_Flags.id_ImmState_ALWAYS==0))){\n if(ncallbackset!=null)callbackset=ncallbackset;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstamp=stamp;\n callbackset.SENSORstamp=stamp;\n callbackset.FLUIDstamp=stamp;\n }\n else callbackset.SENSORstamp=stamp;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n #if(!NAPE_RELEASE_BUILD)\n arb.makemutable();\n #end\n var pact=arb.active;\n arb.active=true;\n var emptycontacts=false;\n #if false arb.cleanupContacts();\n #end\n precb.zpp_inner.pre_arbiter=arb;\n precb.zpp_inner.set=callbackset;\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n precb.zpp_inner.listener=listener;\n #if NAPE_ASSERT if(callbackset.int1==null){\n var err=\"\";\n err+=\"OKAY WTF IS HAPPENING HERE\\n\";\n err+=\"ncallbackset is null? \"+(ncallbackset==null?\"yes\":\"no\")+\"\\n\";\n err+=\"assuming yes, let's find callbacksets on interactor\\n\";\n err+=\"i1 (id=\"+i1.id+\"):\\n\";\n {\n var cx_ite=i1.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n err+=\"i2 (id=\"+i2.id+\"):\\n\";\n {\n var cx_ite=i2.cbsets.begin();\n while(cx_ite!=null){\n var cbset=cx_ite.elem();\n err+=\" (\"+cbset.id+\" \"+(cbset.int1==null?\"null\":\"\")+\",\"+cbset.di+\" \"+(cbset.int2==null?\"null\":\"\")+\") arbs size=\"+cbset.arbiters.size()+\" freed=\"+cbset.freed+\" lazydel=\"+cbset.lazydel+\"\\n\";\n cx_ite=cx_ite.next;\n }\n };\n throw err;\n }\n #end\n ZPP_Interactor.int_callback(callbackset,listener,precb.zpp_inner);\n precb.zpp_inner.pre_swapped=i1!=precb.zpp_inner.int1;\n var ret=listener.handlerp(precb);\n if(ret!=null){\n arb.immState=if(ret==PreFlag.ACCEPT)ZPP_Flags.id_ImmState_ACCEPT|ZPP_Flags.id_ImmState_ALWAYS else if(ret==PreFlag.ACCEPT_ONCE)ZPP_Flags.id_ImmState_ACCEPT else if(ret==PreFlag.IGNORE)ZPP_Flags.id_ImmState_IGNORE|ZPP_Flags.id_ImmState_ALWAYS else ZPP_Flags.id_ImmState_IGNORE;\n }\n };\n cx_ite=cx_ite.next;\n }\n };\n #if(!NAPE_RELEASE_BUILD)\n arb.makeimmutable();\n #end\n arb.active=pact;\n if(callbackset!=null){\n {\n var cx_ite=prelisteners.begin();\n while(cx_ite!=null){\n var listener=cx_ite.elem();\n {\n if(listener.itype==ZPP_Flags.id_InteractionType_ANY){\n callbackset.COLLISIONstate=arb.immState;\n callbackset.SENSORstate=arb.immState;\n callbackset.FLUIDstate=arb.immState;\n }\n else callbackset.SENSORstate=arb.immState;\n };\n cx_ite=cx_ite.next;\n }\n };\n }\n }\n else if(callbackset==null){\n if((arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0)arb.immState=ZPP_Flags.id_ImmState_ACCEPT;\n }\n else arb.immState=callbackset.SENSORstate;\n };\n cx_ite=cx_ite.next;\n }\n };\n };\n cx_ite=cx_ite.next;\n }\n };\n if(anyimpure&&(arb.immState&ZPP_Flags.id_ImmState_ALWAYS)==0){\n if(false){\n if(arb.b1.isDynamic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b1.isDynamic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n else{\n if(!arb.b1.isStatic()){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(!arb.b2.isStatic()){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n }\n }\n if(false&&(arb.immState&ZPP_Flags.id_ImmState_ACCEPT)!=0){\n if(arb.b1.isDynamic()&&arb.b1.component.sleeping){\n var o=arb.b1;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n if(arb.b2.isDynamic()&&arb.b2.component.sleeping){\n var o=arb.b2;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.space==this;\n };\n if(!res)throw \"assert(\"+\"o.space==this\"+\") :: \"+(\"object being woken in the space... is not actually in the space!\");\n #end\n };\n if(!o.world){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o.component!=null;\n };\n if(!res)throw \"assert(\"+\"o.component!=null\"+\") :: \"+(\"body woken, but no component exists?\");\n #end\n };\n o.component.waket=stamp+(midstep?0:1);\n if(o.isKinematic())o.kinematicDelaySleep=true;\n if(o.component.sleeping){\n really_wake(o,false);\n }\n }\n };\n }\n if(arb.sleeping){\n arb.sleeping=false;\n s_arbiters.inlined_add(arb);\n }\n arb;\n }\n else if(first){\n {\n var o=arb;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SensorArbiter\"+\", in obj: \"+\"arb\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SensorArbiter.zpp_pool;\n ZPP_SensorArbiter.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SensorArbiter.POOL_CNT++;\n ZPP_SensorArbiter.POOL_SUB++;\n #end\n };\n null;\n }\n else arb;\n }\n else arb;\n };\n }\n }\n #if NAPE_TIMES Debug.NARROW+=flash.Lib.getTimer()-pt;\n #end\n return ret;\n }\n public var mrca1:ZNPList_ZPP_Interactor;\n public var mrca2:ZNPList_ZPP_Interactor;\n public function MRCA_chains(s1:ZPP_Shape,s2:ZPP_Shape){\n inlined_MRCA_chains(s1,s2);\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function inlined_MRCA_chains(s1:ZPP_Shape,s2:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n s1!=s2&&s1.body!=s2.body;\n };\n if(!res)throw \"assert(\"+\"s1!=s2&&s1.body!=s2.body\"+\") :: \"+(\"MRCA chain for equal shapes, or shapes of the same body?\");\n #end\n };\n mrca1.inlined_clear();\n mrca2.inlined_clear();\n if(s1.cbSet!=null)mrca1.inlined_add(s1);\n if(s1.body.cbSet!=null)mrca1.inlined_add(s1.body);\n if(s2.cbSet!=null)mrca2.inlined_add(s2);\n if(s2.body.cbSet!=null)mrca2.inlined_add(s2.body);\n var c1=s1.body.compound;\n var c2=s2.body.compound;\n while(c1!=c2){\n var d1=if(c1==null)0 else c1.depth;\n var d2=if(c2==null)0 else c2.depth;\n if(d1x.aabb.minx;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_SweepPhase extends ZPP_Broadphase{\n public var list:ZPP_SweepData=null;\n public function new(space:ZPP_Space){\n this.space=space;\n is_sweep=true;\n sweep=this;\n }\n public function __insert(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.sweep==null;\n };\n if(!res)throw \"assert(\"+\"shape.sweep==null\"+\") :: \"+(\"SweepPhase::insert\");\n #end\n };\n var dat;\n {\n if(ZPP_SweepData.zpp_pool==null){\n dat=new ZPP_SweepData();\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_TOT++;\n ZPP_SweepData.POOL_ADDNEW++;\n #end\n }\n else{\n dat=ZPP_SweepData.zpp_pool;\n ZPP_SweepData.zpp_pool=dat.next;\n dat.next=null;\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_CNT--;\n ZPP_SweepData.POOL_ADD++;\n #end\n }\n dat.alloc();\n };\n shape.sweep=dat;\n dat.shape=shape;\n dat.aabb=shape.aabb;\n dat.next=list;\n if(list!=null)list.prev=dat;\n list=dat;\n }\n public function __remove(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n shape.sweep!=null;\n };\n if(!res)throw \"assert(\"+\"shape.sweep!=null\"+\") :: \"+(\"SweepPhase::remove\");\n #end\n };\n var dat=shape.sweep;\n if(dat.prev==null)list=dat.next;\n else dat.prev.next=dat.next;\n if(dat.next!=null)dat.next.prev=dat.prev;\n shape.sweep=null;\n {\n var o=dat;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_SweepData\"+\", in obj: \"+\"dat\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_SweepData.zpp_pool;\n ZPP_SweepData.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_SweepData.POOL_CNT++;\n ZPP_SweepData.POOL_SUB++;\n #end\n };\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function __sync(shape:ZPP_Shape){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !shape.body.isStatic();\n };\n if(!res)throw \"assert(\"+\"!shape.body.isStatic()\"+\") :: \"+(\"static shape being synced?\");\n #end\n };\n if(!space.continuous)shape.validate_aabb();\n }\n public function sync_broadphase(){\n space.validation();\n if(list!=null)sync_broadphase_fast();\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function sync_broadphase_fast(){\n var a=list.next;\n while(a!=null){\n #if NAPE_TIMES Debug.BROADTOTAL++;\n #end\n var n=a.next;\n var b=a.prev;\n if(a.gt(b)){\n a=n;\n continue;\n }\n #if NAPE_TIMES Debug.BROADCLASH++;\n #end\n while(b.prev!=null&&b.prev.gt(a))b=b.prev;\n var prev=a.prev;\n prev.next=a.next;\n if(a.next!=null)a.next.prev=prev;\n if(b.prev==null){\n a.prev=null;\n list=a;\n a.next=b;\n b.prev=a;\n }\n else{\n a.prev=b.prev;\n b.prev=a;\n a.prev.next=a;\n a.next=b;\n }\n a=n;\n }\n }\n public override function broadphase(space:ZPP_Space,discrete:Bool){\n if(list!=null){\n sync_broadphase_fast();\n var d1=list;\n while(d1!=null){\n var d2=d1.next;\n var s1=d1.shape;\n var b1=s1.body;\n var bottom=d1.aabb.maxx;\n while(d2!=null){\n if(d2.aabb.minx>bottom)break;\n var s2=d2.shape;\n var b2=s2.body;\n if(b2==b1){\n d2=d2.next;\n continue;\n }\n if(b1.isStatic()&&b2.isStatic()){\n d2=d2.next;\n continue;\n }\n if(b1.component.sleeping&&b2.component.sleeping){\n d2=d2.next;\n continue;\n }\n if(s1.aabb.intersectY(s2.aabb)){\n if(discrete){\n space.narrowPhase(s1,s2,!b1.isDynamic()||!b2.isDynamic(),null,false);\n }\n else{\n space.continuousEvent(s1,s2,!b1.isDynamic()||!b2.isDynamic(),null,false);\n }\n }\n d2=d2.next;\n }\n d1=d1.next;\n }\n }\n }\n public override function clear(){\n while(list!=null){\n list.shape.removedFromSpace();\n __remove(list.shape);\n }\n }\n public override function shapesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:ShapeList){\n sync_broadphase();\n var v=ZPP_Vec2.get(x,y);\n var ret=(output==null?new ShapeList():output);\n var a=list;\n while(a!=null&&a.aabb.minx>x)a=a.next;\n while(a!=null&&a.aabb.minx<=x){\n if(a.aabb.maxx>=x&&a.aabb.miny<=y&&a.aabb.maxy>=y){\n var shape=a.shape;\n if(filter==null||shape.filter.shouldCollide(filter)){\n if(shape.isCircle()){\n if(ZPP_Collide.circleContains(shape.circle,v))ret.push(shape.outer);\n }\n else{\n if(ZPP_Collide.polyContains(shape.polygon,v))ret.push(shape.outer);\n }\n }\n }\n a=a.next;\n }\n {\n var o=v;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"v\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n return ret;\n }\n public override function bodiesUnderPoint(x:Float,y:Float,filter:ZPP_InteractionFilter,output:BodyList){\n sync_broadphase();\n var v=ZPP_Vec2.get(x,y);\n var ret=(output==null?new BodyList():output);\n var a=list;\n while(a!=null&&a.aabb.minx>x)a=a.next;\n while(a!=null&&a.aabb.minx<=x){\n if(a.aabb.maxx>=x&&a.aabb.miny<=y&&a.aabb.maxy>=y){\n var shape=a.shape;\n var body=shape.body.outer;\n if(!ret.has(body)){\n if(filter==null||shape.filter.shouldCollide(filter)){\n if(shape.isCircle()){\n if(ZPP_Collide.circleContains(shape.circle,v))ret.push(body);\n }\n else{\n if(ZPP_Collide.polyContains(shape.polygon,v))ret.push(body);\n }\n }\n }\n }\n a=a.next;\n }\n {\n var o=v;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Vec2\"+\", in obj: \"+\"v\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Vec2.zpp_pool;\n ZPP_Vec2.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Vec2.POOL_CNT++;\n ZPP_Vec2.POOL_SUB++;\n #end\n };\n return ret;\n }\n public override function shapesInAABB(aabb:ZPP_AABB,strict:Bool,containment:Bool,filter:ZPP_InteractionFilter,output:ShapeList){\n sync_broadphase();\n updateAABBShape(aabb);\n var ab=aabbShape.zpp_inner.aabb;\n var ret=(output==null?new ShapeList():output);\n var a=list;\n while(a!=null&&a.aabb.maxx=0&&t=0&&t=0&&t=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.next;\n }\n }\n else if(ray.dirx<0){\n var a=list;\n var b=null;\n while(a!=null&&a.aabb.minx<=rayab.maxx){\n b=a;\n a=a.next;\n }\n a=b;\n while(a!=null){\n if(a.aabb.intersect(rayab)&&(filter==null||a.shape.filter.shouldCollide(filter))){\n var t=ray.aabbsect(a.aabb);\n if(t>=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.prev;\n }\n }\n else{\n var a=list;\n while(a!=null&&a.aabb.minx<=rayab.maxx){\n if(a.aabb.intersect(rayab)&&(filter==null||a.shape.filter.shouldCollide(filter))){\n var t=ray.aabbsect(a.aabb);\n if(t>=0){\n if(a.shape.isCircle())ray.circlesect2(a.shape.circle,inner,ret);\n else ray.polysect2(a.shape.polygon,inner,ret);\n }\n }\n a=a.next;\n }\n }\n {\n var o=rayab;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_AABB\"+\", in obj: \"+\"rayab\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_AABB.zpp_pool;\n ZPP_AABB.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_AABB.POOL_CNT++;\n ZPP_AABB.POOL_SUB++;\n #end\n };\n return ret;\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if flash10 import flash.Memory;\nimport flash.utils.ByteArray;\n#end\n#if nape_swc@:keep #end\nclass ZPP_Math{\n public static#if NAPE_NO_INLINE#else inline #end\n function sqrt(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)\"+\") :: \"+(\"PR(Math).sqrt\");\n #end\n };\n #if flash10 return if(x==0.0)0.0 else 1/invsqrt(x);\n #else return Math.sqrt(x);\n #end\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function invsqrt(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&x!=0.0;\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&x!=0.0\"+\") :: \"+(\"PR(Math).invsqrt\");\n #end\n };\n #if flash10 Memory.setFloat(0,x);\n Memory.setI32(0,0x5f3759df-(Memory.getI32(0)>>1));\n var x2=Memory.getFloat(0);\n return x2*(1.5-0.5*x*x2*x2);\n #else return 1.0/sqrt(x);\n #end\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function sqr(x:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)\"+\") :: \"+(\"PR(Math).sqr\");\n #end\n };\n return x*x;\n }\n public#if NAPE_NO_INLINE#else inline #end\n static function clamp2(x:Float,a:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&!((a!=a));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&!assert_isNaN(a)\"+\") :: \"+(\"PR(Math).clamp2 -> \"+x+\" -> \"+a);\n #end\n };\n return clamp(x,-a,a);\n }\n public static#if NAPE_NO_INLINE#else inline #end\n function clamp(x:Float,a:Float,b:Float){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !((x!=x))&&!((a!=a))&&!((b!=b));\n };\n if(!res)throw \"assert(\"+\"!assert_isNaN(x)&&!assert_isNaN(a)&&!assert_isNaN(b)\"+\") :: \"+(\"PR(Math).clamp2 -> \"+x+\" -> \"+a+\" -> \"+b);\n #end\n };\n return if(xb)b else x;\n }\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Flags;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_Body{\n static public var zpp_pool:ZPP_Set_ZPP_Body=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_Body->ZPP_Body->Bool=null;\n public var swapped:ZPP_Body->ZPP_Body->Void=null;\n public var data:ZPP_Body=null;\n public var prev:ZPP_Set_ZPP_Body=null;\n public var next:ZPP_Set_ZPP_Body=null;\n public var parent:ZPP_Set_ZPP_Body=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_Body){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_Body){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_Body){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_Body){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_Body){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_Body){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_Body\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT++;\n ZPP_Set_ZPP_Body.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_Body->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_Body,lambda:ZPP_Body->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_Body\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT++;\n ZPP_Set_ZPP_Body.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_Body){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_Body){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_Body,n2:ZPP_Set_ZPP_Body,n3:ZPP_Set_ZPP_Body,t1:ZPP_Set_ZPP_Body,t2:ZPP_Set_ZPP_Body,t3:ZPP_Set_ZPP_Body,t4:ZPP_Set_ZPP_Body;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_Body){\n var x:ZPP_Set_ZPP_Body=null;\n var cur:ZPP_Set_ZPP_Body=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_Body){\n var x:ZPP_Set_ZPP_Body=null;\n var cur:ZPP_Set_ZPP_Body=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_Body){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_Body.zpp_pool==null){\n x=new ZPP_Set_ZPP_Body();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_TOT++;\n ZPP_Set_ZPP_Body.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_Body.zpp_pool;\n ZPP_Set_ZPP_Body.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_Body.POOL_CNT--;\n ZPP_Set_ZPP_Body.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_CbSetPair{\n static public var zpp_pool:ZPP_Set_ZPP_CbSetPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_CbSetPair->ZPP_CbSetPair->Bool=null;\n public var swapped:ZPP_CbSetPair->ZPP_CbSetPair->Void=null;\n public var data:ZPP_CbSetPair=null;\n public var prev:ZPP_Set_ZPP_CbSetPair=null;\n public var next:ZPP_Set_ZPP_CbSetPair=null;\n public var parent:ZPP_Set_ZPP_CbSetPair=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_CbSetPair){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_CbSetPair){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_CbSetPair){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_CbSetPair){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_CbSetPair){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_CbSetPair){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_CbSetPair->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_CbSetPair,lambda:ZPP_CbSetPair->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSetPair\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT++;\n ZPP_Set_ZPP_CbSetPair.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_CbSetPair){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_CbSetPair){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_CbSetPair,n2:ZPP_Set_ZPP_CbSetPair,n3:ZPP_Set_ZPP_CbSetPair,t1:ZPP_Set_ZPP_CbSetPair,t2:ZPP_Set_ZPP_CbSetPair,t3:ZPP_Set_ZPP_CbSetPair,t4:ZPP_Set_ZPP_CbSetPair;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_CbSetPair){\n var x:ZPP_Set_ZPP_CbSetPair=null;\n var cur:ZPP_Set_ZPP_CbSetPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_CbSetPair){\n var x:ZPP_Set_ZPP_CbSetPair=null;\n var cur:ZPP_Set_ZPP_CbSetPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_CbSetPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_CbSetPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSetPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_TOT++;\n ZPP_Set_ZPP_CbSetPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSetPair.zpp_pool;\n ZPP_Set_ZPP_CbSetPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSetPair.POOL_CNT--;\n ZPP_Set_ZPP_CbSetPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_PartitionVertex{\n static public var zpp_pool:ZPP_Set_ZPP_PartitionVertex=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_PartitionVertex->ZPP_PartitionVertex->Bool=null;\n public var swapped:ZPP_PartitionVertex->ZPP_PartitionVertex->Void=null;\n public var data:ZPP_PartitionVertex=null;\n public var prev:ZPP_Set_ZPP_PartitionVertex=null;\n public var next:ZPP_Set_ZPP_PartitionVertex=null;\n public var parent:ZPP_Set_ZPP_PartitionVertex=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_PartitionVertex){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_PartitionVertex){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_PartitionVertex){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_PartitionVertex){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_PartitionVertex){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_PartitionVertex){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionVertex\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_PartitionVertex->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_PartitionVertex,lambda:ZPP_PartitionVertex->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionVertex\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_PartitionVertex){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_PartitionVertex){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_PartitionVertex,n2:ZPP_Set_ZPP_PartitionVertex,n3:ZPP_Set_ZPP_PartitionVertex,t1:ZPP_Set_ZPP_PartitionVertex,t2:ZPP_Set_ZPP_PartitionVertex,t3:ZPP_Set_ZPP_PartitionVertex,t4:ZPP_Set_ZPP_PartitionVertex;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_PartitionVertex){\n var x:ZPP_Set_ZPP_PartitionVertex=null;\n var cur:ZPP_Set_ZPP_PartitionVertex=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_PartitionVertex){\n var x:ZPP_Set_ZPP_PartitionVertex=null;\n var cur:ZPP_Set_ZPP_PartitionVertex=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_PartitionVertex){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_PartitionVertex.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionVertex();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_TOT++;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionVertex.zpp_pool;\n ZPP_Set_ZPP_PartitionVertex.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionVertex.POOL_CNT--;\n ZPP_Set_ZPP_PartitionVertex.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_PartitionPair{\n static public var zpp_pool:ZPP_Set_ZPP_PartitionPair=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_PartitionPair->ZPP_PartitionPair->Bool=null;\n public var swapped:ZPP_PartitionPair->ZPP_PartitionPair->Void=null;\n public var data:ZPP_PartitionPair=null;\n public var prev:ZPP_Set_ZPP_PartitionPair=null;\n public var next:ZPP_Set_ZPP_PartitionPair=null;\n public var parent:ZPP_Set_ZPP_PartitionPair=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_PartitionPair){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_PartitionPair){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_PartitionPair){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_PartitionPair){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_PartitionPair){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_PartitionPair){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionPair\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT++;\n ZPP_Set_ZPP_PartitionPair.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_PartitionPair->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_PartitionPair,lambda:ZPP_PartitionPair->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_PartitionPair\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT++;\n ZPP_Set_ZPP_PartitionPair.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_PartitionPair){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_PartitionPair){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_PartitionPair,n2:ZPP_Set_ZPP_PartitionPair,n3:ZPP_Set_ZPP_PartitionPair,t1:ZPP_Set_ZPP_PartitionPair,t2:ZPP_Set_ZPP_PartitionPair,t3:ZPP_Set_ZPP_PartitionPair,t4:ZPP_Set_ZPP_PartitionPair;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_PartitionPair){\n var x:ZPP_Set_ZPP_PartitionPair=null;\n var cur:ZPP_Set_ZPP_PartitionPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_PartitionPair){\n var x:ZPP_Set_ZPP_PartitionPair=null;\n var cur:ZPP_Set_ZPP_PartitionPair=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_PartitionPair){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_PartitionPair.zpp_pool==null){\n x=new ZPP_Set_ZPP_PartitionPair();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_TOT++;\n ZPP_Set_ZPP_PartitionPair.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_PartitionPair.zpp_pool;\n ZPP_Set_ZPP_PartitionPair.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_PartitionPair.POOL_CNT--;\n ZPP_Set_ZPP_PartitionPair.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleVert{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleVert=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleVert->ZPP_SimpleVert->Bool=null;\n public var swapped:ZPP_SimpleVert->ZPP_SimpleVert->Void=null;\n public var data:ZPP_SimpleVert=null;\n public var prev:ZPP_Set_ZPP_SimpleVert=null;\n public var next:ZPP_Set_ZPP_SimpleVert=null;\n public var parent:ZPP_Set_ZPP_SimpleVert=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleVert){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleVert){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleVert){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleVert){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleVert){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleVert){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleVert\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT++;\n ZPP_Set_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleVert->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleVert,lambda:ZPP_SimpleVert->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleVert\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT++;\n ZPP_Set_ZPP_SimpleVert.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleVert){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleVert){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleVert,n2:ZPP_Set_ZPP_SimpleVert,n3:ZPP_Set_ZPP_SimpleVert,t1:ZPP_Set_ZPP_SimpleVert,t2:ZPP_Set_ZPP_SimpleVert,t3:ZPP_Set_ZPP_SimpleVert,t4:ZPP_Set_ZPP_SimpleVert;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleVert){\n var x:ZPP_Set_ZPP_SimpleVert=null;\n var cur:ZPP_Set_ZPP_SimpleVert=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleVert){\n var x:ZPP_Set_ZPP_SimpleVert=null;\n var cur:ZPP_Set_ZPP_SimpleVert=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleVert){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleVert.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleVert();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_TOT++;\n ZPP_Set_ZPP_SimpleVert.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleVert.zpp_pool;\n ZPP_Set_ZPP_SimpleVert.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleVert.POOL_CNT--;\n ZPP_Set_ZPP_SimpleVert.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleSeg{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleSeg=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleSeg->ZPP_SimpleSeg->Bool=null;\n public var swapped:ZPP_SimpleSeg->ZPP_SimpleSeg->Void=null;\n public var data:ZPP_SimpleSeg=null;\n public var prev:ZPP_Set_ZPP_SimpleSeg=null;\n public var next:ZPP_Set_ZPP_SimpleSeg=null;\n public var parent:ZPP_Set_ZPP_SimpleSeg=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleSeg){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleSeg){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleSeg){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleSeg){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleSeg){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleSeg){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleSeg\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleSeg->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleSeg,lambda:ZPP_SimpleSeg->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleSeg\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleSeg){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleSeg){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleSeg,n2:ZPP_Set_ZPP_SimpleSeg,n3:ZPP_Set_ZPP_SimpleSeg,t1:ZPP_Set_ZPP_SimpleSeg,t2:ZPP_Set_ZPP_SimpleSeg,t3:ZPP_Set_ZPP_SimpleSeg,t4:ZPP_Set_ZPP_SimpleSeg;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleSeg){\n var x:ZPP_Set_ZPP_SimpleSeg=null;\n var cur:ZPP_Set_ZPP_SimpleSeg=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleSeg){\n var x:ZPP_Set_ZPP_SimpleSeg=null;\n var cur:ZPP_Set_ZPP_SimpleSeg=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleSeg){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleSeg.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleSeg();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_TOT++;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleSeg.zpp_pool;\n ZPP_Set_ZPP_SimpleSeg.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleSeg.POOL_CNT--;\n ZPP_Set_ZPP_SimpleSeg.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_SimpleEvent{\n static public var zpp_pool:ZPP_Set_ZPP_SimpleEvent=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_SimpleEvent->ZPP_SimpleEvent->Bool=null;\n public var swapped:ZPP_SimpleEvent->ZPP_SimpleEvent->Void=null;\n public var data:ZPP_SimpleEvent=null;\n public var prev:ZPP_Set_ZPP_SimpleEvent=null;\n public var next:ZPP_Set_ZPP_SimpleEvent=null;\n public var parent:ZPP_Set_ZPP_SimpleEvent=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_SimpleEvent){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_SimpleEvent){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_SimpleEvent){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_SimpleEvent){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_SimpleEvent){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_SimpleEvent){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleEvent\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_SimpleEvent->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_SimpleEvent,lambda:ZPP_SimpleEvent->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_SimpleEvent\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_SimpleEvent){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_SimpleEvent){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_SimpleEvent,n2:ZPP_Set_ZPP_SimpleEvent,n3:ZPP_Set_ZPP_SimpleEvent,t1:ZPP_Set_ZPP_SimpleEvent,t2:ZPP_Set_ZPP_SimpleEvent,t3:ZPP_Set_ZPP_SimpleEvent,t4:ZPP_Set_ZPP_SimpleEvent;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_SimpleEvent){\n var x:ZPP_Set_ZPP_SimpleEvent=null;\n var cur:ZPP_Set_ZPP_SimpleEvent=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_SimpleEvent){\n var x:ZPP_Set_ZPP_SimpleEvent=null;\n var cur:ZPP_Set_ZPP_SimpleEvent=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_SimpleEvent){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_SimpleEvent.zpp_pool==null){\n x=new ZPP_Set_ZPP_SimpleEvent();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_TOT++;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_SimpleEvent.zpp_pool;\n ZPP_Set_ZPP_SimpleEvent.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_SimpleEvent.POOL_CNT--;\n ZPP_Set_ZPP_SimpleEvent.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n#if nape_swc@:keep #end\nclass ZPP_Set_ZPP_CbSet{\n static public var zpp_pool:ZPP_Set_ZPP_CbSet=null;\n #if NAPE_POOL_STATS \n /**\n * @private\n */\n static public var POOL_CNT:Int=0;\n /**\n * @private\n */\n static public var POOL_TOT:Int=0;\n /**\n * @private\n */\n static public var POOL_ADD:Int=0;\n /**\n * @private\n */\n static public var POOL_ADDNEW:Int=0;\n /**\n * @private\n */\n static public var POOL_SUB:Int=0;\n #end\n \n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function free(){\n data=null;\n lt=null;\n swapped=null;\n }\n #if NAPE_NO_INLINE#elseif(flash9&&flib)@:ns(\"flibdel\")#end\n public#if NAPE_NO_INLINE#else inline #end\n function alloc(){}\n public var lt:ZPP_CbSet->ZPP_CbSet->Bool=null;\n public var swapped:ZPP_CbSet->ZPP_CbSet->Void=null;\n public var data:ZPP_CbSet=null;\n public var prev:ZPP_Set_ZPP_CbSet=null;\n public var next:ZPP_Set_ZPP_CbSet=null;\n public var parent:ZPP_Set_ZPP_CbSet=null;\n public var colour:Int=0;\n public function new(){}\n public function verify(){\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n {\n var prei=true;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var j=set_ite.data;\n {\n if(!prei){\n if(!lt(i,j)&<(j,i))return false;\n }\n else if(i==j)prei=false;\n else{\n if(!lt(j,i)&<(i,j))return false;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return true;\n }\n public function empty(){\n return parent==null;\n }\n public function singular(){\n return parent!=null&&parent.prev==null&&parent.next==null;\n }\n public function size(){\n var ret=0;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var i=set_ite.data;\n ret++;\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n return ret;\n }\n public function has(obj:ZPP_CbSet){\n return find(obj)!=null;\n }\n public function find(obj:ZPP_CbSet){\n var cur=parent;\n while(cur!=null&&cur.data!=obj){\n if(lt(obj,cur.data))cur=cur.prev;\n else cur=cur.next;\n }\n return cur;\n }\n public function has_weak(obj:ZPP_CbSet){\n return find_weak(obj)!=null;\n }\n public function find_weak(obj:ZPP_CbSet){\n var cur=parent;\n while(cur!=null){\n if(lt(obj,cur.data))cur=cur.prev;\n else if(lt(cur.data,obj))cur=cur.next;\n else break;\n }\n return cur;\n }\n public function lower_bound(obj:ZPP_CbSet){\n return{\n var ret=null;\n {\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n this!=null;\n };\n if(!res)throw \"assert(\"+\"this!=null\"+\") :: \"+(\"Iterate null set?\");\n #end\n };\n if(!this.empty()){\n var set_ite=this.parent;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n while(set_ite!=null){\n var elt=set_ite.data;\n {\n if(!lt(elt,obj)){\n ret=elt;\n break;\n }\n };\n if(set_ite.next!=null){\n set_ite=set_ite.next;\n while(set_ite.prev!=null)set_ite=set_ite.prev;\n }\n else{\n while(set_ite.parent!=null&&set_ite==set_ite.parent.next)set_ite=set_ite.parent;\n set_ite=set_ite.parent;\n }\n }\n }\n };\n ret;\n };\n }\n public function first(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"first in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n return cur.data;\n }\n public function pop_front(){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !empty();\n };\n if(!res)throw \"assert(\"+\"!empty()\"+\") :: \"+(\"pop_front in empty\");\n #end\n };\n var cur=parent;\n while(cur.prev!=null)cur=cur.prev;\n var ret=cur.data;\n remove_node(cur);\n return ret;\n }\n public function remove(obj:ZPP_CbSet){\n var node=find(obj);\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node!=null;\n };\n if(!res)throw \"assert(\"+\"node!=null\"+\") :: \"+(\"object not in tree\");\n #end\n };\n remove_node(node);\n }\n public function successor_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null){\n cur=cur.next;\n while(cur.prev!=null)cur=cur.prev;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.prev!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function predecessor_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.prev!=null){\n cur=cur.prev;\n while(cur.next!=null)cur=cur.next;\n }\n else{\n var pre=cur;\n cur=cur.parent;\n while(cur!=null&&cur.next!=pre){\n pre=cur;\n cur=cur.parent;\n }\n }\n return cur;\n }\n public function successor(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=successor_node(find(obj));\n return node==null?null:node.data;\n }\n public function predecessor(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n has(obj);\n };\n if(!res)throw \"assert(\"+\"has(obj)\"+\") :: \"+(\"not in tree!\");\n #end\n };\n var node=predecessor_node(find(obj));\n return node==null?null:node.data;\n }\n public function remove_node(cur:ZPP_Set_ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur!=null;\n };\n if(!res)throw \"assert(\"+\"cur!=null\"+\") :: \"+(\"null node\");\n #end\n };\n if(cur.next!=null&&cur.prev!=null){\n var sm=cur.next;\n while(sm.prev!=null)sm=sm.prev;\n {\n var t=cur.data;\n cur.data=sm.data;\n sm.data=t;\n };\n if(swapped!=null)swapped(cur.data,sm.data);\n cur=sm;\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n cur.next==null||cur.prev==null;\n };\n if(!res)throw \"assert(\"+\"cur.next==null||cur.prev==null\"+\") :: \"+(\"node still has two children??\");\n #end\n };\n var child=if(cur.prev==null)cur.next else cur.prev;\n if(cur.colour==1){\n if(cur.prev!=null||cur.next!=null)child.colour=1;\n else if(cur.parent!=null){\n var parent=cur.parent;\n while(true){\n parent.colour++;\n parent.prev.colour--;\n parent.next.colour--;\n {\n var child=parent.prev;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n {\n var child=parent.next;\n if(child.colour==(-1)){\n __fix_neg_red(child);\n break;\n }\n else if(child.colour==0){\n {\n if(child.prev!=null&&child.prev.colour==0){\n __fix_dbl_red(child.prev);\n break;\n }\n }\n {\n if(child.next!=null&&child.next.colour==0){\n __fix_dbl_red(child.next);\n break;\n }\n }\n }\n }\n if(parent.colour==2){\n if(parent.parent==null){\n parent.colour=1;\n }\n else{\n parent=parent.parent;\n continue;\n }\n }\n break;\n }\n }\n }\n {\n var par=cur.parent;\n if(par==null){\n parent=child;\n }\n else if(par.prev==cur)par.prev=child;\n else par.next=child;\n if(child!=null)child.parent=par;\n };\n cur.parent=cur.prev=cur.next=null;\n {\n var o=cur;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSet\"+\", in obj: \"+\"cur\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT++;\n ZPP_Set_ZPP_CbSet.POOL_SUB++;\n #end\n };\n }\n public function clear(){\n clear_with(function(_){});\n }\n public#if NAPE_NO_INLINE#else inline #end\n function clear_with(lambda:ZPP_CbSet->Void){\n if(parent==null)return;\n else{\n var cur=parent;\n while(cur!=null)cur=if(cur.prev!=null)cur.prev else if(cur.next!=null)cur.next else clear_node(cur,lambda);\n parent=null;\n }\n }\n #if NAPE_NO_INLINE#else inline #end\n function clear_node(node:ZPP_Set_ZPP_CbSet,lambda:ZPP_CbSet->Void){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n node.next==null&&node.prev==null;\n };\n if(!res)throw \"assert(\"+\"node.next==null&&node.prev==null\"+\") :: \"+(\"clear_node :: node not a leaf\");\n #end\n };\n lambda(node.data);\n var ret=node.parent;\n if(ret!=null){\n if(node==ret.prev)ret.prev=null;\n else ret.next=null;\n node.parent=null;\n }\n {\n var o=node;\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n o!=null;\n };\n if(!res)throw \"assert(\"+\"o!=null\"+\") :: \"+(\"Free(in T: \"+\"ZPP_Set_ZPP_CbSet\"+\", in obj: \"+\"node\"+\")\");\n #end\n };\n o.free();\n o.next=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=o;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT++;\n ZPP_Set_ZPP_CbSet.POOL_SUB++;\n #end\n };\n return ret;\n }\n public function __fix_neg_red(negred:ZPP_Set_ZPP_CbSet){\n var parent=negred.parent;\n var child=if(parent.prev==negred){\n var nl=negred.prev;\n var nr=negred.next;\n var trl=nr.prev;\n var trr=nr.next;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.next=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.prev=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.next=parent.next;\n if(parent.next!=null)parent.next.parent=nr;\n };\n {\n parent.next=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n else{\n var nl=negred.next;\n var nr=negred.prev;\n var trl=nr.next;\n var trr=nr.prev;\n nl.colour=0;\n negred.colour=parent.colour=1;\n {\n negred.prev=trl;\n if(trl!=null)trl.parent=negred;\n };\n {\n var t=parent.data;\n parent.data=nr.data;\n nr.data=t;\n };\n if(swapped!=null)swapped(parent.data,nr.data);\n {\n nr.next=trr;\n if(trr!=null)trr.parent=nr;\n };\n {\n nr.prev=parent.prev;\n if(parent.prev!=null)parent.prev.parent=nr;\n };\n {\n parent.prev=nr;\n if(nr!=null)nr.parent=parent;\n };\n nl;\n };\n if(child.prev!=null&&child.prev.colour==0)__fix_dbl_red(child.prev);\n else if(child.next!=null&&child.next.colour==0)__fix_dbl_red(child.next);\n }\n public function __fix_dbl_red(x:ZPP_Set_ZPP_CbSet){\n while(true){\n var par=x.parent;\n var g=par.parent;\n if(g==null){\n par.colour=1;\n break;\n }\n var n1:ZPP_Set_ZPP_CbSet,n2:ZPP_Set_ZPP_CbSet,n3:ZPP_Set_ZPP_CbSet,t1:ZPP_Set_ZPP_CbSet,t2:ZPP_Set_ZPP_CbSet,t3:ZPP_Set_ZPP_CbSet,t4:ZPP_Set_ZPP_CbSet;\n if(par==g.prev){\n n3=g;\n t4=g.next;\n if(x==par.prev){\n n1=x;\n n2=par;\n t1=x.prev;\n t2=x.next;\n t3=par.next;\n }\n else{\n n1=par;\n n2=x;\n t1=par.prev;\n t2=x.prev;\n t3=x.next;\n }\n }\n else{\n n1=g;\n t1=g.prev;\n if(x==par.prev){\n n2=x;\n n3=par;\n t2=x.prev;\n t3=x.next;\n t4=par.next;\n }\n else{\n n2=par;\n n3=x;\n t2=par.prev;\n t3=x.prev;\n t4=x.next;\n }\n }\n {\n var par=g.parent;\n if(par==null){\n parent=n2;\n }\n else if(par.prev==g)par.prev=n2;\n else par.next=n2;\n if(n2!=null)n2.parent=par;\n };\n {\n n1.prev=t1;\n if(t1!=null)t1.parent=n1;\n };\n {\n n1.next=t2;\n if(t2!=null)t2.parent=n1;\n };\n {\n n2.prev=n1;\n if(n1!=null)n1.parent=n2;\n };\n {\n n2.next=n3;\n if(n3!=null)n3.parent=n2;\n };\n {\n n3.prev=t3;\n if(t3!=null)t3.parent=n3;\n };\n {\n n3.next=t4;\n if(t4!=null)t4.parent=n3;\n };\n n2.colour=g.colour-1;\n n1.colour=1;\n n3.colour=1;\n if(n2==parent)parent.colour=1;\n else if(n2.colour==0&&n2.parent.colour==0){\n x=n2;\n continue;\n }\n break;\n }\n }\n public function try_insert_bool(obj:ZPP_CbSet){\n var x:ZPP_Set_ZPP_CbSet=null;\n var cur:ZPP_Set_ZPP_CbSet=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return false;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return true;\n }\n }\n public function try_insert(obj:ZPP_CbSet){\n var x:ZPP_Set_ZPP_CbSet=null;\n var cur:ZPP_Set_ZPP_CbSet=null;\n if(parent==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n parent=x;\n }\n else{\n cur=parent;\n while(true){\n if(lt(obj,cur.data)){\n if(cur.prev==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else if(lt(cur.data,obj)){\n if(cur.next==null){\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n else break;\n }\n }\n if(x==null)return cur;\n else{\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n return x;\n }\n }\n public function insert(obj:ZPP_CbSet){\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n !has(obj);\n };\n if(!res)throw \"assert(\"+\"!has(obj)\"+\") :: \"+(\"object already in set\");\n #end\n };\n var x;\n {\n if(ZPP_Set_ZPP_CbSet.zpp_pool==null){\n x=new ZPP_Set_ZPP_CbSet();\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_TOT++;\n ZPP_Set_ZPP_CbSet.POOL_ADDNEW++;\n #end\n }\n else{\n x=ZPP_Set_ZPP_CbSet.zpp_pool;\n ZPP_Set_ZPP_CbSet.zpp_pool=x.next;\n x.next=null;\n #if NAPE_POOL_STATS ZPP_Set_ZPP_CbSet.POOL_CNT--;\n ZPP_Set_ZPP_CbSet.POOL_ADD++;\n #end\n }\n x.alloc();\n };\n x.data=obj;\n if(parent==null)parent=x;\n else{\n var cur=parent;\n while(true){\n if(lt(x.data,cur.data)){\n if(cur.prev==null){\n cur.prev=x;\n x.parent=cur;\n break;\n }\n else cur=cur.prev;\n }\n else{\n if(cur.next==null){\n cur.next=x;\n x.parent=cur;\n break;\n }\n else cur=cur.next;\n }\n }\n }\n if(x.parent==null)x.colour=1;\n else{\n x.colour=0;\n if(x.parent.colour==0)__fix_dbl_red(x);\n }\n {\n #if(NAPE_ASSERT&&!NAPE_RELEASE_BUILD)\n var res={\n x.data==obj;\n };\n if(!res)throw \"assert(\"+\"x.data==obj\"+\") :: \"+(\"...wtf?\");\n #end\n };\n return x;\n }\n}\n","package nape;\n/**\n * Configuration parameters for Nape\n */\n@:final class Config{\n /**\n * @private\n */\n function new(){}\n /**\n * Generic epsilon value for float comparisons\n *

\n * @default 1e-8\n */\n public static var epsilon:Float=1e-8;\n /**\n * Parameter used in computing shape fluid angular drag coeffecient.\n *

\n * Defines the contribution to the drag coeffecient due to Material dynamicFriction\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has units kg/px\n * @default 2.5 kg/px\n */\n public static var fluidAngularDragFriction:Float=2.5;\n /**\n * Parameter used in computing shape fluid angular drag coeffecient.\n *

\n * Defines the contribution to the drag coeffecient due to shape's surface\n * area rotating into a fluid.\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has units kg/px\n * @default 100kg/px\n */\n public static var fluidAngularDrag:Float=100;\n /**\n * Parameter used in computing fluid drags.\n *

\n * Defines an added weight for scaling the contribution of forward drag due\n * to leaving a vaccuum behind the shape pulling it back.\n *

\n * This global value must be set as the very first thing to ensure all Shapes\n * use your intended value.\n *

\n * This parameter has no units.\n * @default 0.5\n */\n public static var fluidVacuumDrag:Float=0.5;\n /**\n * Parameter used in computing shapes linear drag in fluid.\n *

\n * Used in determining the amount of linear drag for the shape based on forward profile.\n *

\n * This parameter has units kg/px\n * @default 0.5kg/px\n */\n public static var fluidLinearDrag:Float=0.5;\n /**\n * Amount of overlap permitted between Shapes for collisions.\n *

\n * This parameter has units of pixels.\n * @default 0.2px\n */\n public static var collisionSlop:Float=0.2;\n /**\n * Amount of overlap permitted between Shapes before CCD kicks in.\n *

\n * This parameter has units of pixels, and should always be larger\n * than collisionSlop parameter.\n * @default 0.5px\n */\n public static var collisionSlopCCD:Float=0.5;\n /**\n * Biased distance treshold for CCD collisions.\n *

\n * In CCD collision routines, two Shapes will be considered intersecting\n * when the distance between them + collisionSlopCCD falls below this\n * value.\n *

\n * This parameter has units of pixels, and should always be > 0\n * @default 0.05px\n */\n public static var distanceThresholdCCD:Float=0.05;\n /**\n * Linear sweep threshold-ratio for static CCD collisions\n *

\n * In deciding what non-bullet objects should be collided continuously against\n * static/kinematic objects, the linear speed of the body is considered.\n * \n * ccdCollide if: bodyLinearSpeed * deltaTime > threshold * bodyRadius\n * \n * Intuitively, a value of 0.5 would mean that a body, in the worst case scenario\n * will be permitted to move half of its width in a single time step, before CCD\n * is enabled for this reason.\n *

\n * This parameter has no units.\n * @default 0.05\n */\n public static var staticCCDLinearThreshold:Float=0.05;\n /**\n * Angular sweep threshold for static CCD collisions\n *

\n * In deciding what non-bullet objects should be collided continuously against\n * static/kinematic objects, the angular speed of the body is considered.\n * \n * ccdCollide if: bodyAngularSpeed * deltaTime > threshold\n * \n * Intuitively, a value of 0.5 would mean that a body would have to rotate more than\n * 0.5 radians in a single time step, before CCD is enabled for this reason. Noting that\n * at 60fps physics, the body would need an angularVel greater than 30rad/s for this\n * limit of 0.5 to be reached; the default is far smaller.\n *

\n * This parameter has units of rad.\n * @default 0.005rad\n */\n public static var staticCCDAngularThreshold:Float=0.005;\n /**\n * Linear sweep threshold-ratio for bullet CCD collisions\n *

\n * A dynamic body marked as a bullet, will not necessarigly always be collided\n * with continuously.\n *

\n * Should a body be moving, or rotating fast enough to pass the tests determined\n * by staticCCD#Threshold parameters, and is marked as a bullet, it must then\n * have its velocities checked against the equivalent bullet thresholds to actually\n * be collided continuously against other dynamic bodies too.\n *

\n * This parameter has no units.\n * @default 0.125\n */\n public static var bulletCCDLinearThreshold:Float=0.125;\n /**\n * Angular sweep threshold for bullet CCD collisions.\n *

\n * See description of bulletCCDLinearThreshold.\n *

\n * This parameter has units of rad.\n * @default 0.0125rad\n */\n public static var bulletCCDAngularThreshold:Float=0.0125;\n /**\n * Relative linear threshold for dynamic-dynamic sweeps.\n *

\n * When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,\n * should the relative velocity of the bodies fall beneath this magnitude, they\n * may be considered (based on angular velocities also) to be moving together, and\n * this specific CCD test will be skipped.\n *

\n * This parameter has units of px/s\n * @default 17px/s\n */\n public static var dynamicSweepLinearThreshold:Float=17;\n /**\n * Relative angular bias threshold for dynamic-dynamic sweeps.\n *

\n * When performing dynamic-dynamic sweep of Body shapes during CCD collision phase,\n * should the relative angular velocity (weighted by the shape bias values) fall\n * beneath this magnitude, they may be considered (based on linear velocities also) to\n * be moving together, and this specific CCD test will be skipped.\n *

\n * The shape bias, is an internal value which indicates the 'amount of radius' of\n * a shape about the centre of rotation that can be considered to change under rotations.\n * eg: A circle at origin has a bias of 0 (Its rotation has no effect on sweeps)\n * whilst A circle far from the origin may have a large bias.\n *

\n * This parameter has units of px.rad/s\n * @default 0.6px.rad/s\n */\n public static var dynamicSweepAngularThreshold:Float=0.6;\n /**\n * Angular velocity scaling during CCD slips.\n *

\n * In rare cases, a Body can be moving in such a way that we fail to compute a perfect\n * time of impact; generally when a thin box-like object is rotating very quickly. The\n * time of impact solver in Nape attempts to avoid impacts which are seperating; so that\n * we can catch true impact times; but in a 'slip' case we are unable to achieve this and\n * to avoid a possible tunneling from the other side during later operations we will in\n * these rare cases scale down the angular velocity of a Body by this parameter.\n *

\n * This parameter has no units.\n * @default 0.75\n */\n public static var angularCCDSlipScale:Float=0.75;\n /**\n * Expiration delay length for collision arbiter destruction.\n *

\n * In unstable physics conditions, two colliding shapes may jitter such as to constantly\n * seperate, and then come back together again. This parameter controls the number of time\n * steps during which we will delay this destruction so that cached impulse values may\n * persist and improve stability of strenuous simulations.\n *

\n * This parameter has units of 'steps' I suppose.\n * @default 6steps\n */\n public static var arbiterExpirationDelay:Int=6;\n /**\n * Contact velocity threshold for static-dynamic friction\n *

\n * This is the threshold on projected contact velocities at which Nape will use\n * dynamic friction Mateiral values, in place of static friction Material values.\n *

\n * This parameter has units of px/s\n * @default 2px/s\n */\n public static var staticFrictionThreshold:Float=2;\n /**\n * Contact velocity threshold for elastic collisions\n *

\n * This is the threshold on weighted projected normal-contact velocities at which Nape will\n * decide to stop using elastic collisions. Nape will take the normal velocities at contact\n * and scale by the combined elasticity coeffecient for the Arbiter, if this value falls\n * below the threshold, then elasticity is ignored for stability in stacking.\n *

\n * This parameter has units of px/s\n * @default 20px/s\n */\n public static var elasticThreshold:Float=20;\n /**\n * Sleep delay for stationary bodies.\n *

\n * By default, Nape considers a body to be stationary even if it has a very small linear\n * or angular velocity. This parameter controls how many steps such a Body will continue\n * to be simulated for, before being put to sleep (Assuming everything else in the island\n * is also stationary for a sufficiently long time).\n *

\n * This parameter has units of 'steps' I suppose.\n * @default 60steps\n */\n public static var sleepDelay:Int=60;\n /**\n * Linear speed threshold for sleeping of Bodies.\n *

\n * A body in Nape will be considered stationary only if its linear velocity has magnitude\n * under this threshold.\n *

\n * This parameter has units of px/s\n * @default 0.2px/s\n */\n public static var linearSleepThreshold:Float=0.2;\n /**\n * Angular speed threshold for sleeping of Bodies.\n *

\n * A body in Nape will be considered stationary only if its angular velocity, multiplied\n * by the body radius (never under-estimated) about the origin, falls below this threshold.\n *

\n * The body radius scaling, ensures that a very large body needs to be rotating more slowly\n * to be considered stationary than a very small body. Intuitively we're designating this\n * a threshold on the maximum tangentenial velocity of the body due to rotation.\n *

\n * This parameter has units of px.rad/s\n * @default 0.4px.rad/s\n */\n public static var angularSleepThreshold:Float=0.4;\n /**\n * Fraction of contact slop resolved per-step for dynamic-dynamic discrete collisions.\n *

\n * This value determines, in the case of two non-continuously colliding dynamic objects\n * the fraction of the contact overlap that will attempt to be resolved during positional\n * iterations.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.3/step\n */\n public static var contactBiasCoef:Float=0.3;\n /**\n * Fraction of contact slop resolved per-step for static/kinematic discrete collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for non-continuous collisions\n * between a dynamic, and a static or kinematic object.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.6/step\n */\n public static var contactStaticBiasCoef:Float=0.6;\n /**\n * Fraction of contact slop resolved per-step for dynamic-dynamic continuous collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for continuous collisions\n * between two dynamic bodies.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.4/step\n */\n public static var contactContinuousBiasCoef:Float=0.4;\n /**\n * Fraction of contact slop resolved per-step for static/kinematic continuous collisions.\n *

\n * See description of contactBiasCoef; this is the coeffecient for continuous collisions\n * between a dynamic, and a static or kinematic object.\n *

\n * This parameter has units of 1/'step' I suppose.\n * @default 0.5/step\n */\n public static var contactContinuousStaticBiasCoef:Float=0.5;\n /**\n * Amount of linear slop permitted in constraints.\n *

\n * A constraint will be considered to be 'relaxed' during positional iterations\n * only if the linear error falls below this threshold.\n *

\n * Assuming a 'sensible' constraint, this has units of px\n * @default 0.1px\n */\n public static var constraintLinearSlop:Float=0.1;\n /**\n * Amount of angular slop permitted in constraints.\n *

\n * A constraint will be considered to be 'relaxed' during positional iterations\n * only if the angular error falls below this threshold.\n *

\n * Assuming a 'sensible' constraint, this has units of rad\n * @default 1e-3rad\n */\n public static var constraintAngularSlop:Float=1e-3;\n /**\n * Ill-conditioned threshold for 2-contact collision constraints.\n *

\n * This is a threshold on the measure of ill-conditioning of the effective-mass-matrix\n * in a 2-contact collision at which the contact manifold will be forced into a 1-contact\n * constraint. This can occur quite readily when two contact points are almost exactly equal\n * or in certain other conditions where the mathematics quite simply breaks down when using\n * a block solver.\n *

\n * This parameter has no units.\n * @default 2e+8\n */\n public static var illConditionedThreshold:Float=2e+8;\n}\n","package zpp_nape.util;\nimport zpp_nape.Const;\nimport zpp_nape.constraint.PivotJoint;\nimport zpp_nape.ID;\nimport zpp_nape.constraint.Constraint;\nimport zpp_nape.constraint.WeldJoint;\nimport zpp_nape.constraint.UserConstraint;\nimport zpp_nape.constraint.DistanceJoint;\nimport zpp_nape.constraint.LineJoint;\nimport zpp_nape.constraint.LinearJoint;\nimport zpp_nape.constraint.AngleJoint;\nimport zpp_nape.constraint.MotorJoint;\nimport zpp_nape.phys.Interactor;\nimport zpp_nape.phys.FeatureMix;\nimport zpp_nape.phys.Material;\nimport zpp_nape.constraint.PulleyJoint;\nimport zpp_nape.phys.FluidProperties;\nimport zpp_nape.phys.Compound;\nimport zpp_nape.callbacks.OptionType;\nimport zpp_nape.phys.Body;\nimport zpp_nape.callbacks.CbSetPair;\nimport zpp_nape.callbacks.CbType;\nimport zpp_nape.callbacks.Callback;\nimport zpp_nape.callbacks.CbSet;\nimport zpp_nape.callbacks.Listener;\nimport zpp_nape.geom.GeomPoly;\nimport zpp_nape.geom.Mat23;\nimport zpp_nape.geom.ConvexRayResult;\nimport zpp_nape.geom.Cutter;\nimport zpp_nape.geom.Ray;\nimport zpp_nape.geom.Vec2;\nimport zpp_nape.geom.Convex;\nimport zpp_nape.geom.MatMath;\nimport zpp_nape.geom.PartitionedPoly;\nimport zpp_nape.geom.Simplify;\nimport zpp_nape.geom.Triangular;\nimport zpp_nape.geom.AABB;\nimport zpp_nape.geom.Simple;\nimport zpp_nape.geom.SweepDistance;\nimport zpp_nape.geom.Monotone;\nimport zpp_nape.geom.VecMath;\nimport zpp_nape.geom.Vec3;\nimport zpp_nape.geom.MatMN;\nimport zpp_nape.geom.PolyIter;\nimport zpp_nape.geom.MarchingSquares;\nimport zpp_nape.geom.Geom;\nimport zpp_nape.shape.Circle;\nimport zpp_nape.geom.Collide;\nimport zpp_nape.shape.Shape;\nimport zpp_nape.shape.Edge;\nimport zpp_nape.space.Broadphase;\nimport zpp_nape.shape.Polygon;\nimport zpp_nape.space.SweepPhase;\nimport zpp_nape.space.DynAABBPhase;\nimport zpp_nape.dynamics.Contact;\nimport zpp_nape.space.Space;\nimport zpp_nape.dynamics.Arbiter;\nimport zpp_nape.dynamics.InteractionGroup;\nimport zpp_nape.dynamics.InteractionFilter;\nimport zpp_nape.dynamics.SpaceArbiterList;\nimport zpp_nape.util.Array2;\nimport zpp_nape.util.Lists;\nimport zpp_nape.util.Queue;\nimport zpp_nape.util.Debug;\nimport zpp_nape.util.FastHash;\nimport zpp_nape.util.RBTree;\nimport zpp_nape.util.Pool;\nimport zpp_nape.util.Names;\nimport zpp_nape.util.Circular;\nimport zpp_nape.util.WrapLists;\nimport zpp_nape.util.Math;\nimport zpp_nape.util.UserData;\nimport nape.TArray;\nimport zpp_nape.util.DisjointSetForest;\nimport nape.Config;\nimport nape.constraint.PivotJoint;\nimport nape.constraint.WeldJoint;\nimport nape.constraint.Constraint;\nimport nape.constraint.UserConstraint;\nimport nape.constraint.DistanceJoint;\nimport nape.constraint.LineJoint;\nimport nape.constraint.LinearJoint;\nimport nape.constraint.ConstraintList;\nimport nape.constraint.AngleJoint;\nimport nape.constraint.MotorJoint;\nimport nape.constraint.ConstraintIterator;\nimport nape.phys.GravMassMode;\nimport nape.phys.BodyList;\nimport nape.phys.Interactor;\nimport nape.phys.InertiaMode;\nimport nape.phys.InteractorList;\nimport nape.constraint.PulleyJoint;\nimport nape.phys.MassMode;\nimport nape.phys.Material;\nimport nape.phys.InteractorIterator;\nimport nape.phys.FluidProperties;\nimport nape.phys.BodyIterator;\nimport nape.phys.Compound;\nimport nape.phys.CompoundList;\nimport nape.phys.BodyType;\nimport nape.phys.CompoundIterator;\nimport nape.callbacks.InteractionListener;\nimport nape.callbacks.OptionType;\nimport nape.callbacks.PreListener;\nimport nape.callbacks.BodyListener;\nimport nape.callbacks.ListenerIterator;\nimport nape.callbacks.CbType;\nimport nape.callbacks.ListenerType;\nimport nape.callbacks.PreFlag;\nimport nape.callbacks.CbEvent;\nimport nape.callbacks.InteractionType;\nimport nape.callbacks.PreCallback;\nimport nape.callbacks.InteractionCallback;\nimport nape.callbacks.ListenerList;\nimport nape.callbacks.ConstraintListener;\nimport nape.phys.Body;\nimport nape.callbacks.BodyCallback;\nimport nape.callbacks.CbTypeList;\nimport nape.callbacks.CbTypeIterator;\nimport nape.callbacks.Callback;\nimport nape.callbacks.ConstraintCallback;\nimport nape.callbacks.Listener;\nimport nape.geom.Mat23;\nimport nape.geom.ConvexResultIterator;\nimport nape.geom.GeomPoly;\nimport nape.geom.Ray;\nimport nape.geom.GeomPolyIterator;\nimport nape.geom.Vec2Iterator;\nimport nape.geom.RayResult;\nimport nape.geom.Winding;\nimport nape.geom.Vec2List;\nimport nape.geom.RayResultIterator;\nimport nape.geom.AABB;\nimport nape.geom.IsoFunction;\nimport nape.geom.GeomVertexIterator;\nimport nape.geom.ConvexResult;\nimport nape.geom.GeomPolyList;\nimport nape.geom.Vec2;\nimport nape.geom.RayResultList;\nimport nape.geom.Vec3;\nimport nape.geom.MatMN;\nimport nape.geom.ConvexResultList;\nimport nape.geom.MarchingSquares;\nimport nape.shape.Circle;\nimport nape.geom.Geom;\nimport nape.shape.ValidationResult;\nimport nape.shape.ShapeIterator;\nimport nape.shape.Polygon;\nimport nape.shape.Edge;\nimport nape.shape.Shape;\nimport nape.shape.EdgeList;\nimport nape.shape.EdgeIterator;\nimport nape.shape.ShapeList;\nimport nape.shape.ShapeType;\nimport nape.space.Broadphase;\nimport nape.dynamics.Contact;\nimport nape.dynamics.InteractionGroupList;\nimport nape.dynamics.Arbiter;\nimport nape.dynamics.InteractionGroup;\nimport nape.space.Space;\nimport nape.dynamics.ContactIterator;\nimport nape.dynamics.ArbiterList;\nimport nape.dynamics.InteractionFilter;\nimport nape.dynamics.ArbiterIterator;\nimport nape.dynamics.InteractionGroupIterator;\nimport nape.dynamics.FluidArbiter;\nimport nape.dynamics.ContactList;\nimport nape.dynamics.ArbiterType;\nimport nape.dynamics.CollisionArbiter;\nimport nape.util.Debug;\nimport nape.util.BitmapDebug;\nimport nape.util.ShapeDebug;\n#if nape_swc@:keep #end\nclass ZPP_Flags{\n public static var internal:Bool=false;\n \n public static inline var id_ImmState_ACCEPT=1;\n public static inline var id_ImmState_IGNORE=2;\n public static inline var id_ImmState_ALWAYS=4;\n public static inline var id_GravMassMode_DEFAULT=0;\n public static inline var id_GravMassMode_FIXED=1;\n public static inline var id_GravMassMode_SCALED=2;\n public static inline var id_InertiaMode_DEFAULT=0;\n public static inline var id_InertiaMode_FIXED=1;\n public static inline var id_MassMode_DEFAULT=0;\n public static inline var id_MassMode_FIXED=1;\n public static inline var id_BodyType_STATIC=1;\n public static inline var id_BodyType_DYNAMIC=2;\n public static inline var id_BodyType_KINEMATIC=3;\n public static inline var id_ListenerType_BODY=0;\n public static inline var id_PreFlag_ACCEPT=1;\n public static inline var id_ListenerType_CONSTRAINT=1;\n public static inline var id_PreFlag_IGNORE=2;\n public static inline var id_ListenerType_INTERACTION=2;\n public static inline var id_PreFlag_ACCEPT_ONCE=3;\n public static inline var id_ListenerType_PRE=3;\n public static inline var id_PreFlag_IGNORE_ONCE=4;\n public static inline var id_CbEvent_BEGIN=0;\n public static inline var id_InteractionType_COLLISION=1;\n public static inline var id_CbEvent_ONGOING=6;\n public static inline var id_InteractionType_SENSOR=2;\n public static inline var id_CbEvent_END=1;\n public static inline var id_InteractionType_FLUID=4;\n public static inline var id_CbEvent_WAKE=2;\n public static inline var id_InteractionType_ANY=7;\n public static inline var id_CbEvent_SLEEP=3;\n public static inline var id_CbEvent_BREAK=4;\n public static inline var id_CbEvent_PRE=5;\n public static inline var id_Winding_UNDEFINED=0;\n public static inline var id_Winding_CLOCKWISE=1;\n public static inline var id_Winding_ANTICLOCKWISE=2;\n public static inline var id_ValidationResult_VALID=0;\n public static inline var id_ValidationResult_DEGENERATE=1;\n public static inline var id_ValidationResult_CONCAVE=2;\n public static inline var id_ValidationResult_SELF_INTERSECTING=3;\n public static inline var id_ShapeType_CIRCLE=0;\n public static inline var id_ShapeType_POLYGON=1;\n public static inline var id_Broadphase_DYNAMIC_AABB_TREE=0;\n public static inline var id_Broadphase_SWEEP_AND_PRUNE=1;\n public static inline var id_ArbiterType_COLLISION=1;\n public static inline var id_ArbiterType_SENSOR=2;\n public static inline var id_ArbiterType_FLUID=4;\n \n public static var GravMassMode_DEFAULT:GravMassMode;\n public static var GravMassMode_FIXED:GravMassMode;\n public static var GravMassMode_SCALED:GravMassMode;\n public static var InertiaMode_DEFAULT:InertiaMode;\n public static var InertiaMode_FIXED:InertiaMode;\n public static var MassMode_DEFAULT:MassMode;\n public static var MassMode_FIXED:MassMode;\n public static var BodyType_STATIC:BodyType;\n public static var BodyType_DYNAMIC:BodyType;\n public static var BodyType_KINEMATIC:BodyType;\n public static var ListenerType_BODY:ListenerType;\n public static var PreFlag_ACCEPT:PreFlag;\n public static var ListenerType_CONSTRAINT:ListenerType;\n public static var PreFlag_IGNORE:PreFlag;\n public static var ListenerType_INTERACTION:ListenerType;\n public static var PreFlag_ACCEPT_ONCE:PreFlag;\n public static var ListenerType_PRE:ListenerType;\n public static var PreFlag_IGNORE_ONCE:PreFlag;\n public static var CbEvent_BEGIN:CbEvent;\n public static var InteractionType_COLLISION:InteractionType;\n public static var CbEvent_ONGOING:CbEvent;\n public static var InteractionType_SENSOR:InteractionType;\n public static var CbEvent_END:CbEvent;\n public static var InteractionType_FLUID:InteractionType;\n public static var CbEvent_WAKE:CbEvent;\n public static var InteractionType_ANY:InteractionType;\n public static var CbEvent_SLEEP:CbEvent;\n public static var CbEvent_BREAK:CbEvent;\n public static var CbEvent_PRE:CbEvent;\n public static var Winding_UNDEFINED:Winding;\n public static var Winding_CLOCKWISE:Winding;\n public static var Winding_ANTICLOCKWISE:Winding;\n public static var ValidationResult_VALID:ValidationResult;\n public static var ValidationResult_DEGENERATE:ValidationResult;\n public static var ValidationResult_CONCAVE:ValidationResult;\n public static var ValidationResult_SELF_INTERSECTING:ValidationResult;\n public static var ShapeType_CIRCLE:ShapeType;\n public static var ShapeType_POLYGON:ShapeType;\n public static var Broadphase_DYNAMIC_AABB_TREE:Broadphase;\n public static var Broadphase_SWEEP_AND_PRUNE:Broadphase;\n public static var ArbiterType_COLLISION:ArbiterType;\n public static var ArbiterType_SENSOR:ArbiterType;\n public static var ArbiterType_FLUID:ArbiterType;\n}\n"], "names":[], -"mappings":";;;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,J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,VAAC;AAGrG,GAAyE;AACrF,GAAiB,FAAC;AAGP,GAAuE;AAClF,GAAiB,FAAC;AAGlB,GAAY,AAAiF,QAAa,VAAC;AAG3G,GAAW;4BFjFgC;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;kBIyMC;sByHtNM;uCAYiB;+BAaR;8BAaD;8BASA;4BAOF;+BAQG;mCAWI;uCAgBI;wCAiBC;uCAeD;wCASC;0CAYE;2CAiBC;kCAcT;qCAYC;sCAUG;+BAYP;yBAYR;mCAUY;oCAcC;8BAWN;oCAUM;wCAUI;8CAUM;sCAiCR;yCnE9CZ;qCexEA;gCclCF;4BAIJ;2BAID;6CCTF;4CIyKC;2CACD;+CACI;iDACE;qCkChLD;sDjCkNd;sDACA;sDACA;uDA6EC;uDACA;uDACA;2CG/RQ;sCAkFJ;wCACE;yCACC;2CCvFM;uCI8qFY;uCACjB;iCU9pFa,hCAAC,AAAK;;;;;;;;;CAAgB;;;;;;;;;CAAiB;;;;;;;;;;oCGuFvD;qCACC;uCACE;wCACC;qCG1EI;wCGkNN;8C7BotfM;wCA8DA;8CA8DA;4CA8DA;4CA8DA;0CA8DA;wCA8DA;4CA8DA;6CA8DA;gDA8DA;wCA8DA;yCA8DA;oDA8DA;2CA8DA;2CA8DA;;;;" } \ No newline at end of file diff --git a/samples/_output/retina.js b/samples/_output/retina.js index 0efe5c6f..f40d018c 100644 --- a/samples/_output/retina.js +++ b/samples/_output/retina.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/retina.js.map b/samples/_output/retina.js.map index cacf529e..2f167b7d 100644 --- a/samples/_output/retina.js.map +++ b/samples/_output/retina.js.map @@ -3,7 +3,7 @@ "file":"retina.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/retina/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.retina;\n\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tpixelRatio = _getPixelRatio();\n\t\tsuper.start();\n\n\t\tvar imgPath:String = \"assets/retina/img\" + _getResolutionStr() + \".jpg\";\n\t\t_img = new Sprite(Texture.fromImage(imgPath));\n\t\t_img.anchor.set(0.5);\n\t\t_img.name = \"img\";\n\t\t_img.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\tstage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#F78181\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(imgPath, style);\n\t\t_label.position.set(0, 0);\n\t\tstage.addChild(_label);\n\t}\n\n\tfunction _getPixelRatio():Float {\n\t\tif (Browser.window.devicePixelRatio <= 1 || (Browser.window.devicePixelRatio > 1 && Browser.window.devicePixelRatio < 1.5)) return 1;\n\t\telse if (Browser.window.devicePixelRatio >= 1.5 && Browser.window.devicePixelRatio < 2) return 1.5;\n\t\telse if (Browser.window.devicePixelRatio >= 2 && Browser.window.devicePixelRatio < 3) return 2;\n\t\telse return 3;\n\t}\n\n\tfunction _getResolutionStr():String {\n\t\treturn \"@\" + _getPixelRatio() + \"x\";\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.retina;\n\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tpixelRatio = _getPixelRatio();\n\t\tsuper.start();\n\n\t\tvar imgPath:String = \"assets/retina/img\" + _getResolutionStr() + \".jpg\";\n\t\t_img = new Sprite(Texture.fromImage(imgPath));\n\t\t_img.anchor.set(0.5);\n\t\t_img.name = \"img\";\n\t\t_img.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\tstage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#F78181\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(imgPath, style);\n\t\t_label.position.set(0, 0);\n\t\tstage.addChild(_label);\n\t}\n\n\tfunction _getPixelRatio():Float {\n\t\tif (Browser.window.devicePixelRatio <= 1 || (Browser.window.devicePixelRatio > 1 && Browser.window.devicePixelRatio < 1.5)) return 1;\n\t\telse if (Browser.window.devicePixelRatio >= 1.5 && Browser.window.devicePixelRatio < 2) return 1.5;\n\t\telse if (Browser.window.devicePixelRatio >= 2 && Browser.window.devicePixelRatio < 3) return 2;\n\t\telse return 3;\n\t}\n\n\tfunction _getResolutionStr():String {\n\t\treturn \"@\" + _getPixelRatio() + \"x\";\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;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b,CAAa;EAEb,CAAS,OAAS,TAAS;EAC3B,DAAoB,AAAG;EACvB,DAAe;;gBAGhB,LACC;EAAI,EAAmC,AAAK,AAAC,DAAkC,CAAK,DAAkC,FAAM,MAAO,DAC9H,JAAI,EAAmC,AAAO,DAAkC,FAAG,MAAO,DAC1F,JAAI,EAAmC,AAAK,DAAkC,FAAG,MAAO,DACxF,CAAO;;mBAGb,RACC;OAAO,JAAM,AAAmB;;;;;4BHzCY;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/rope.js b/samples/_output/rope.js index 41f697b3..0d07ece1 100644 --- a/samples/_output/rope.js +++ b/samples/_output/rope.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/rope.js.map b/samples/_output/rope.js.map index 27602ea1..1698c308 100644 --- a/samples/_output/rope.js.map +++ b/samples/_output/rope.js.map @@ -3,7 +3,7 @@ "file":"rope.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/rope/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.rope;\n\nimport pixi.mesh.Rope;\nimport pixi.core.display.Container;\nimport pixi.core.math.Point;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _count:Float;\n\tvar _points:Array;\n\tvar _length:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.AUTO);\n\n\t\t_count = 0;\n\t\t_points = [];\n\t\t_length = 918 / 20;\n\n\t\tfor (i in 0 ... 20) {\n\t\t\tvar segSize = _length;\n\t\t\t_points.push(new Point(i * _length, 0));\n\t\t};\n\n\t\tvar strip = new Rope(Texture.fromImage(\"assets/rope/snake.png\"), _points);\n\t\tstrip.x = -918 / 2;\n\n\t\tvar snakeContainer:Container = new Container();\n\t\tsnakeContainer.position.x = width / 2;\n\t\tsnakeContainer.position.y = height / 2;\n\n\t\tsnakeContainer.scale.x = width / 1100;\n\t\tstage.addChild(snakeContainer);\n\n\t\tsnakeContainer.addChild(strip);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.1;\n\n\t\tfor (i in 0 ... _points.length) {\n\t\t\t_points[i].y = Math.sin(i * 0.5 + _count) * 30;\n\t\t\t_points[i].x = i * _length + Math.cos(i * 0.3 + _count) * 20;\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.rope;\n\nimport pixi.mesh.Rope;\nimport pixi.core.display.Container;\nimport pixi.core.math.Point;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _count:Float;\n\tvar _points:Array;\n\tvar _length:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.AUTO);\n\n\t\t_count = 0;\n\t\t_points = [];\n\t\t_length = 918 / 20;\n\n\t\tfor (i in 0 ... 20) {\n\t\t\tvar segSize = _length;\n\t\t\t_points.push(new Point(i * _length, 0));\n\t\t};\n\n\t\tvar strip = new Rope(Texture.fromImage(\"assets/rope/snake.png\"), _points);\n\t\tstrip.x = -918 / 2;\n\n\t\tvar snakeContainer:Container = new Container();\n\t\tsnakeContainer.position.x = width / 2;\n\t\tsnakeContainer.position.y = height / 2;\n\n\t\tsnakeContainer.scale.x = width / 1100;\n\t\tstage.addChild(snakeContainer);\n\n\t\tsnakeContainer.addChild(strip);\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.1;\n\n\t\tfor (i in 0 ... _points.length) {\n\t\t\t_points[i].y = Math.sin(i * 0.5 + _count) * 30;\n\t\t\t_points[i].x = i * _length + Math.cos(i * 0.3 + _count) * 20;\n\t\t}\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK,DAAM,FAAY;IACvC;IACA,AAAa;IACb,DAAS,AAAU,FAAS,AAAS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AA0B;EAC1C,AAAI,EAAqB,HAAM,EAAoB,FAAqC;;iBAG1E,DAAsC;EACpD,CAAQ;EACR,CAAS;EACT,DAAgB,AAAO;EACvB,CAAqB,AAAQ;EAC7B,CAAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;oBC1OtE,TAAe;CACrB;CACA;;yBAuCM,dACN;;;;;OArCD,IAAiB;EAChB,CAAkB;EAClB,CAAW;EACX,DAAY;EAEZ,CAAS;EACT,CAAU;EACV,CAAU;EAEA;EAAV,CAAgB,FAAI;GAApB;GACe;GACd,FAAa,UAAU,RAAI,FAAS;;EAGzB,aAAS,dAAkB,AAA0B;EACjE,CAAU;EAEqB;EAC/B,CAA4B,AAAQ;EACpC,CAA4B,AAAS;EAErC,CAAyB,AAAQ;EACjC,DAAe;EAEf,DAAwB;;WAGzB,WAAsC;EACrC,EAAU;EAEA;EAAM;EAAhB,DAAgC;GAAhC;GACC,FAAQ,EAAO,FAAS,EAAI,AAAM,AAAU;GAC5C,FAAQ,EAAO,AAAI,AAAU,FAAS,EAAI,AAAM,AAAU;;;;;;4BH9Cf;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/spine.js b/samples/_output/spine.js index b59982b4..7542e932 100644 --- a/samples/_output/spine.js +++ b/samples/_output/spine.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/spine.js.map b/samples/_output/spine.js.map index 5cf574d7..5a714c07 100644 --- a/samples/_output/spine.js.map +++ b/samples/_output/spine.js.map @@ -3,7 +3,7 @@ "file":"spine.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/spine/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.spine;\n\nimport pixi.loaders.Loader;\nimport pixi.plugins.app.Application;\nimport pixi.plugins.spine.Spine;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _spine:Spine;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tbackgroundColor = 0x00FF66;\n\t\tsuper.start();\n\n\t\tstage.interactive = true;\n\t\tvar assetsToLoader:Array = [];\n\n\t\t_loader = new Loader();\n\t\t_loader.add(\"spinedata\", \"assets/spine/spineboy.json\");\n\t\t_loader.load(onAssetsLoaded);\n\t}\n\n\tfunction onAssetsLoaded() {\n\t\t_spine = new Spine(Reflect.field(_loader.resources, \"spinedata\").spineData);\n\n\t\t_spine.position.set(400, 600);\n\n\t\t_spine.scale.set(1.5);\n\n\t\t_spine.stateData.setMixByName(\"walk\", \"jump\", 0.2);\n\t\t_spine.stateData.setMixByName(\"jump\", \"walk\", 0.4);\n\n\t\t_spine.state.setAnimationByName(0, \"walk\", true);\n\n\t\tstage.addChild(_spine);\n\n\t\tstage.on(\"click\", _stageOnClick);\n\t\tstage.on(\"tap\", _stageOnClick);\n\t}\n\n\tfunction _stageOnClick() {\n\t\t_spine.state.setAnimationByName(0, \"jump\", false);\n\t\t_spine.state.addAnimationByName(0, \"walk\", true, 0);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.spine;\n\nimport pixi.loaders.Loader;\nimport pixi.plugins.app.Application;\nimport pixi.plugins.spine.Spine;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _spine:Spine;\n\n\tpublic function new() {\n\t\tsuper();\n\t\tbackgroundColor = 0x00FF66;\n\t\tsuper.start();\n\n\t\tstage.interactive = true;\n\t\tvar assetsToLoader:Array = [];\n\n\t\t_loader = new Loader();\n\t\t_loader.add(\"spinedata\", \"assets/spine/spineboy.json\");\n\t\t_loader.load(onAssetsLoaded);\n\t}\n\n\tfunction onAssetsLoaded() {\n\t\t_spine = new Spine(Reflect.field(_loader.resources, \"spinedata\").spineData);\n\n\t\t_spine.position.set(400, 600);\n\n\t\t_spine.scale.set(1.5);\n\n\t\t_spine.stateData.setMixByName(\"walk\", \"jump\", 0.2);\n\t\t_spine.stateData.setMixByName(\"jump\", \"walk\", 0.4);\n\n\t\t_spine.state.setAnimationByName(0, \"walk\", true);\n\n\t\tstage.addChild(_spine);\n\n\t\tstage.on(\"click\", _stageOnClick);\n\t\tstage.on(\"tap\", _stageOnClick);\n\t}\n\n\tfunction _stageOnClick() {\n\t\t_spine.state.setAnimationByName(0, \"jump\", false);\n\t\t_spine.state.addAnimationByName(0, \"walk\", true, 0);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA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ples/_output/spritesheet.js b/samples/_output/spritesheet.js index 3098279a..c2ae8d83 100644 --- a/samples/_output/spritesheet.js +++ b/samples/_output/spritesheet.js @@ -200,7 +200,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/spritesheet.js.map b/samples/_output/spritesheet.js.map index 2adb614a..4c9e0870 100644 --- a/samples/_output/spritesheet.js.map +++ b/samples/_output/spritesheet.js.map @@ -3,7 +3,7 @@ "file":"spritesheet.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/usr/local/lib/haxe/std/js/_std/Std.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/spritesheet/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.spritesheet;\n\nimport pixi.core.text.Text;\nimport js.html.DivElement;\nimport pixi.loaders.Loader;\nimport pixi.extras.MovieClip;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _label:Text;\n\tvar _fighterTextures:Array;\n\tvar _counter:DivElement;\n\tvar _count:Int;\n\tvar _isAdding:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.AUTO);\n\n\t\t_loader = new Loader();\n\t\t_loader.baseUrl = \"assets/spritesheet/\";\n\t\t_loader.add(\"fighter\", \"fighter.json\");\n\t\t_loader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\t_count = 0;\n\t\t_isAdding = false;\n\t\t_fighterTextures = [];\n\t\tfor (i in 0 ... 29) {\n\t\t\tvar frame:String = \"\" + i;\n\t\t\tif (i < 10) frame = \"0\" + frame;\n\t\t\t_fighterTextures.push(Texture.fromFrame(\"rollSequence00\" + frame + \".png\"));\n\t\t}\n\n\t\trenderer.view.onmouseup = _onTouchEnd;\n\t\tBrowser.document.addEventListener(\"touchend\", _onTouchEnd, true);\n\n\t\trenderer.view.onmousedown = _onTouchStart;\n\t\tBrowser.document.addEventListener(\"touchstart\", _onTouchStart, true);\n\n\t\t_addCounter();\n\t\t_addFighter(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t}\n\n\tfunction _onTouchStart(event) {\n\t\t_isAdding = true;\n\t}\n\n\tfunction _onTouchEnd(event) {\n\t\t_isAdding = false;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\tif (_isAdding) _addFighter(Std.random(Browser.window.innerWidth), Std.random(Browser.window.innerHeight));\n\t}\n\n\tfunction _addFighter(x:Float, y:Float) {\n\t\tvar fighter:MovieClip = new MovieClip(_fighterTextures);\n\t\tfighter.anchor.set(0.5);\n\t\tfighter.position.set(x, y);\n\t\tfighter.play();\n\n\t\tstage.addChild(fighter);\n\t\t_count++;\n\t\t_counter.innerHTML = _count + \" SPRITES\";\n\t}\n\n\tfunction _addCounter() {\n\t\t_counter = Browser.document.createDivElement();\n\t\t_counter.style.position = \"absolute\";\n\t\t_counter.style.top = \"1px\";\n\t\t_counter.style.left = \"1px\";\n\t\t_counter.style.width = \"90px\";\n\t\t_counter.style.background = \"#CCCCC\";\n\t\t_counter.style.backgroundColor = \"#105CB6\";\n\t\t_counter.style.fontFamily = \"Helvetica,Arial\";\n\t\t_counter.style.padding = \"3px\";\n\t\t_counter.style.color = \"#0FF\";\n\t\t_counter.style.fontSize = \"10px\";\n\t\t_counter.style.fontWeight = \"bold\";\n\t\t_counter.style.textAlign = \"center\";\n\t\t_counter.className = \"counter\";\n\t\tBrowser.document.body.appendChild(_counter);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn (cast x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static inline function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.spritesheet;\n\nimport pixi.core.text.Text;\nimport js.html.DivElement;\nimport pixi.loaders.Loader;\nimport pixi.extras.MovieClip;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _loader:Loader;\n\tvar _label:Text;\n\tvar _fighterTextures:Array;\n\tvar _counter:DivElement;\n\tvar _count:Int;\n\tvar _isAdding:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start(Application.AUTO);\n\n\t\t_loader = new Loader();\n\t\t_loader.baseUrl = \"assets/spritesheet/\";\n\t\t_loader.add(\"fighter\", \"fighter.json\");\n\t\t_loader.load(_onLoaded);\n\t}\n\n\tfunction _onLoaded() {\n\t\t_count = 0;\n\t\t_isAdding = false;\n\t\t_fighterTextures = [];\n\t\tfor (i in 0 ... 29) {\n\t\t\tvar frame:String = \"\" + i;\n\t\t\tif (i < 10) frame = \"0\" + frame;\n\t\t\t_fighterTextures.push(Texture.fromFrame(\"rollSequence00\" + frame + \".png\"));\n\t\t}\n\n\t\trenderer.view.onmouseup = _onTouchEnd;\n\t\tBrowser.document.addEventListener(\"touchend\", _onTouchEnd, true);\n\n\t\trenderer.view.onmousedown = _onTouchStart;\n\t\tBrowser.document.addEventListener(\"touchstart\", _onTouchStart, true);\n\n\t\t_addCounter();\n\t\t_addFighter(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t}\n\n\tfunction _onTouchStart(event) {\n\t\t_isAdding = true;\n\t}\n\n\tfunction _onTouchEnd(event) {\n\t\t_isAdding = false;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\tif (_isAdding) _addFighter(Std.random(Browser.window.innerWidth), Std.random(Browser.window.innerHeight));\n\t}\n\n\tfunction _addFighter(x:Float, y:Float) {\n\t\tvar fighter:MovieClip = new MovieClip(_fighterTextures);\n\t\tfighter.anchor.set(0.5);\n\t\tfighter.position.set(x, y);\n\t\tfighter.play();\n\n\t\tstage.addChild(fighter);\n\t\t_count++;\n\t\t_counter.innerHTML = _count + \" SPRITES\";\n\t}\n\n\tfunction _addCounter() {\n\t\t_counter = Browser.document.createDivElement();\n\t\t_counter.style.position = \"absolute\";\n\t\t_counter.style.top = \"1px\";\n\t\t_counter.style.left = \"1px\";\n\t\t_counter.style.width = \"90px\";\n\t\t_counter.style.background = \"#CCCCC\";\n\t\t_counter.style.backgroundColor = \"#105CB6\";\n\t\t_counter.style.fontFamily = \"Helvetica,Arial\";\n\t\t_counter.style.padding = \"3px\";\n\t\t_counter.style.color = \"#0FF\";\n\t\t_counter.style.fontSize = \"10px\";\n\t\t_counter.style.fontWeight = \"bold\";\n\t\t_counter.style.textAlign = \"center\";\n\t\t_counter.className = \"counter\";\n\t\tBrowser.document.body.appendChild(_counter);\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf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AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;2BCtOtE,hBAAe;CACrB;CACA;;gCA0EM,rBACN;;;;;OAxED,IAAiB;EAChB,CAAW;EACX,DAAY;EAEZ,CAAU;EACV,CAAkB;EAClB,DAAY,AAAW;EACvB,DAAa;;WAGd,AAAqB;EACpB,CAAS;EACT,CAAY;EACZ,CAAmB;EACT;EAAV,CAAgB,FAAI;GAApB;GACoB,AAAK;GACxB,DAAI,CAAI,FAAI,EAAQ,AAAM;GAC1B,FAAsB,AAAkB,EAAmB,AAAQ;;EAGpE,CAA0B;EAC1B,DAAkC,AAAY,AAAa;EAE3D,CAA4B;EAC5B,DAAkC,AAAc,AAAe;EAE/D;EACA,DAAY,EAA4B,FAAG,EAA6B;;eAGzE,CACC;GAAY;;aAGb,GACC;GAAY;;WAGb,WACC;EAAI,DAAW,AAAY,AAAW,AAA4B,AAAW;;aAG9E,CAAuC;EACd,oBAAc;EACtC,DAAmB;EACnB,DAAqB,AAAG;EACxB;EAEA,DAAe;EACf;EACA,CAAqB,AAAS;;aAG/B,FAAuB;EACX;EAAX,CAAW;EACX,CAA0B;EAC1B,CAAqB;EACrB,CAAsB;EACtB,CAAuB;EACvB,CAA4B;EAC5B,CAAiC;EACjC,CAA4B;EAC5B,CAAyB;EACzB,CAAuB;EACvB,CAA0B;EAC1B,CAA4B;EAC5B,CAA2B;EAC3B,CAAqB;EACrB,DAAkC;;;;;4BJtFU;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/textureswap.js b/samples/_output/textureswap.js index 57865313..4ad612c8 100644 --- a/samples/_output/textureswap.js +++ b/samples/_output/textureswap.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/textureswap.js.map b/samples/_output/textureswap.js.map index 7dd44eaa..e98ddfae 100644 --- a/samples/_output/textureswap.js.map +++ b/samples/_output/textureswap.js.map @@ -3,7 +3,7 @@ "file":"textureswap.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/textureswap/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.textureswap;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.sprites.Sprite;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _texture1:Texture;\n\tvar _texture2:Texture;\n\n\tvar _bunny:Sprite;\n\tvar _swap:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\t_swap = false;\n\t\t_texture1 = Texture.fromImage(\"assets/bunnymark/bunny2.png\");\n\t\t_texture2 = Texture.fromImage(\"assets/bunnymark/bunny4.png\");\n\n\t\t_bunny = new Sprite(_texture1);\n\t\t_bunny.anchor.set(0.5);\n\t\t_bunny.scale.set(3);\n\t\t_bunny.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\t_bunny.interactive = true;\n\t\t_bunny.on(\"click\", _onClick);\n\t\tstage.addChild(_bunny);\n\t}\n\n\tfunction _onClick(target:EventTarget) {\n\t\t_swap = !_swap;\n\t\t_bunny.texture = (_swap) ? _texture2 : _texture1;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_bunny.rotation += 0.1;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.textureswap;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.sprites.Sprite;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\nimport js.Browser;\n\nclass Main extends Application {\n\n\tvar _texture1:Texture;\n\tvar _texture2:Texture;\n\n\tvar _bunny:Sprite;\n\tvar _swap:Bool;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\t_swap = false;\n\t\t_texture1 = Texture.fromImage(\"assets/bunnymark/bunny2.png\");\n\t\t_texture2 = Texture.fromImage(\"assets/bunnymark/bunny4.png\");\n\n\t\t_bunny = new Sprite(_texture1);\n\t\t_bunny.anchor.set(0.5);\n\t\t_bunny.scale.set(3);\n\t\t_bunny.position.set(Browser.window.innerWidth / 2, Browser.window.innerHeight / 2);\n\t\t_bunny.interactive = true;\n\t\t_bunny.on(\"click\", _onClick);\n\t\tstage.addChild(_bunny);\n\t}\n\n\tfunction _onClick(target:EventTarget) {\n\t\t_swap = !_swap;\n\t\t_bunny.texture = (_swap) ? _texture2 : _texture1;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_bunny.rotation += 0.1;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6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GAA3B,HAAuC;;WAGxC,WACC;IAAmB;;;;;4BHxCyB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/tiling.js b/samples/_output/tiling.js index 752e54d4..ed96d5ac 100644 --- a/samples/_output/tiling.js +++ b/samples/_output/tiling.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/tiling.js.map b/samples/_output/tiling.js.map index aa7dbac6..1e33e16c 100644 --- a/samples/_output/tiling.js.map +++ b/samples/_output/tiling.js.map @@ -3,7 +3,7 @@ "file":"tiling.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/tiling/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.tiling;\n\nimport pixi.core.textures.Texture;\nimport pixi.extras.TilingSprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _tilingSprite:TilingSprite;\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x97C56E;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\tvar texture = Texture.fromImage(\"assets/tiling/p2.jpeg\");\n\t\t_tilingSprite = new TilingSprite(texture, width, height);\n\n\t\tstage.addChild(_tilingSprite);\n\n\t\t_count = 0;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.005;\n\t\t_tilingSprite.tileScale.x = 2 + Math.sin(_count);\n\t\t_tilingSprite.tileScale.y = 2 + Math.cos(_count);\n\n\t\t_tilingSprite.tilePosition.x += 1;\n\t\t_tilingSprite.tilePosition.y += 1;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.tiling;\n\nimport pixi.core.textures.Texture;\nimport pixi.extras.TilingSprite;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _tilingSprite:TilingSprite;\n\tvar _count:Float;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0x97C56E;\n\t\tonUpdate = _onUpdate;\n\t\tsuper.start();\n\n\t\tvar texture = Texture.fromImage(\"assets/tiling/p2.jpeg\");\n\t\t_tilingSprite = new TilingSprite(texture, width, height);\n\n\t\tstage.addChild(_tilingSprite);\n\n\t\t_count = 0;\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\t\t_count += 0.005;\n\t\t_tilingSprite.tileScale.x = 2 + Math.sin(_count);\n\t\t_tilingSprite.tileScale.y = 2 + Math.cos(_count);\n\n\t\t_tilingSprite.tilePosition.x += 1;\n\t\t_tilingSprite.tilePosition.y += 1;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD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AAmB,nBAAO,AAAQ,KACzE,HAAW,gBAAkB,lBAAO,AAAQ;EAEjD,AAAI,DAAa,EAAuB;EAExC,AAAI,EAAa,HAAM,AAAkC,KACpD,LAAsB;EAC3B;EACU;;iBAWJ,NAA2B;EACjC,AAAI,DAAY,EAA0B;EAC1C,AAAI,EAAqB,HAAM,EAAoB,FAAqC;;iBAG1E,DAAsC;EACpD,CAAQ;EACR,CAAS;EACT,DAAgB,AAAO;EACvB,CAAqB,AAAQ;EAC7B,CAAsB,AAAS;EAE/B,AAAI,EAAY,HAAM;;0BAGR,JAAqD;EACnE;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;sBC9OtE,XAAe;CACrB;CACA;;2BAyBM,hBACN;;;;;OAvBD,IAAiB;EAChB,CAAkB;EAClB,CAAW;EACX;EAEc,DAAkB;EAChC,CAAgB,sBAAiB,xBAAS,AAAO;EAEjD,DAAe;EAEf,CAAS;;WAGV,WAAsC;EACrC,EAAU;EACV,CAA4B,AAAI,FAAS;EACzC,CAA4B,AAAI,FAAS;EAEzC,EAAgC;EAChC,EAAgC;;;;;4BH7BY;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/samples/_output/video.js b/samples/_output/video.js index a14aae34..102b182d 100644 --- a/samples/_output/video.js +++ b/samples/_output/video.js @@ -196,7 +196,7 @@ pixi_plugins_app_Application.prototype = { renderingOptions.preserveDrawingBuffer = this.preserveDrawingBuffer; if(rendererType == "auto") this.renderer = PIXI.autoDetectRenderer(this.width,this.height,renderingOptions); else if(rendererType == "canvas") this.renderer = new PIXI.CanvasRenderer(this.width,this.height,renderingOptions); else this.renderer = new PIXI.WebGLRenderer(this.width,this.height,renderingOptions); if(this.roundPixels) this.renderer.roundPixels = true; - window.document.body.appendChild(this.renderer.view); + if(parentDom == null) window.document.body.appendChild(this.renderer.view); else parentDom.appendChild(this.renderer.view); this.resumeRendering(); this.addStats(); } diff --git a/samples/_output/video.js.map b/samples/_output/video.js.map index 925db64f..7ad7c504 100644 --- a/samples/_output/video.js.map +++ b/samples/_output/video.js.map @@ -3,7 +3,7 @@ "file":"video.js", "sourceRoot":"file:///", "sources":["/projects/pixi-haxe/.haxelib/perf,js/1,1,8/src/Perf.hx","/usr/local/lib/haxe/std/js/_std/Reflect.hx","/projects/pixi-haxe/src/pixi/plugins/app/Application.hx","/projects/pixi-haxe/samples/video/Main.hx"], -"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\n\t\tBrowser.document.body.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.video;\n\nimport js.html.VideoElement;\nimport js.Browser;\nimport pixi.core.sprites.Sprite;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _vidTexture:Texture;\n\tvar _vidSprite:Sprite;\n\tvar _vidElement:VideoElement;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tonResize = _onResize;\n\t\tautoResize = true;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tsuper.start();\n\n\t\t_vidTexture = Texture.fromVideoUrl(\"assets/video/test.mp4\");\n\t\t_vidSprite = new Sprite(_vidTexture);\n\t\tstage.addChild(_vidSprite);\n\n\t\t//haxe.Timer.delay(_setup, 3000);\n\t}\n\n\tfunction _setup() {\n\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\n\t}\n\n\tfunction _onResize() {\n\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["import js.html.Performance;\nimport js.html.DivElement;\nimport js.Browser;\n\n@:expose class Perf {\n\n\tpublic static var MEASUREMENT_INTERVAL:Int = 1000;\n\n\tpublic static var FONT_FAMILY:String = \"Helvetica,Arial\";\n\n\tpublic static var FPS_BG_CLR:String = \"#00FF00\";\n\tpublic static var FPS_WARN_BG_CLR:String = \"#FF8000\";\n\tpublic static var FPS_PROB_BG_CLR:String = \"#FF0000\";\n\n\tpublic static var MS_BG_CLR:String = \"#FFFF00\";\n\tpublic static var MEM_BG_CLR:String = \"#086A87\";\n\tpublic static var INFO_BG_CLR:String = \"#00FFFF\";\n\tpublic static var FPS_TXT_CLR:String = \"#000000\";\n\tpublic static var MS_TXT_CLR:String = \"#000000\";\n\tpublic static var MEM_TXT_CLR:String = \"#FFFFFF\";\n\tpublic static var INFO_TXT_CLR:String = \"#000000\";\n\n\tpublic static var TOP_LEFT:String = \"TL\";\n\tpublic static var TOP_RIGHT:String = \"TR\";\n\tpublic static var BOTTOM_LEFT:String = \"BL\";\n\tpublic static var BOTTOM_RIGHT:String = \"BR\";\n\n\tstatic var DELAY_TIME:Int = 4000;\n\n\tpublic var fps:DivElement;\n\tpublic var ms:DivElement;\n\tpublic var memory:DivElement;\n\tpublic var info:DivElement;\n\n\tpublic var lowFps:Float;\n\tpublic var avgFps:Float;\n\tpublic var currentFps:Float;\n\tpublic var currentMs:Float;\n\tpublic var currentMem:String;\n\n\tvar _time:Float;\n\tvar _startTime:Float;\n\tvar _prevTime:Float;\n\tvar _ticks:Int;\n\tvar _fpsMin:Float;\n\tvar _fpsMax:Float;\n\tvar _memCheck:Bool;\n\tvar _pos:String;\n\tvar _offset:Float;\n\tvar _measureCount:Int;\n\tvar _totalFps:Float;\n\n\tvar _perfObj:Performance;\n\tvar _memoryObj:Memory;\n\tvar _raf:Int;\n\n\tvar RAF:Dynamic;\n\tvar CAF:Dynamic;\n\n\tpublic function new(?pos = \"TR\", ?offset:Float = 0) {\n\t\t_perfObj = Browser.window.performance;\n\t\tif (Reflect.field(_perfObj, \"memory\") != null) _memoryObj = Reflect.field(_perfObj, \"memory\");\n\t\t_memCheck = (_perfObj != null && _memoryObj != null && _memoryObj.totalJSHeapSize > 0);\n\n\t\t_pos = pos;\n\t\t_offset = offset;\n\n\t\t_init();\n\t\t_createFpsDom();\n\t\t_createMsDom();\n\t\tif (_memCheck) _createMemoryDom();\n\n\t\tif (Browser.window.requestAnimationFrame != null) RAF = Browser.window.requestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozRequestAnimationFrame != null) RAF = untyped __js__(\"window\").mozRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitRequestAnimationFrame != null) RAF = untyped __js__(\"window\").webkitRequestAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msRequestAnimationFrame != null) RAF = untyped __js__(\"window\").msRequestAnimationFrame;\n\n\t\tif (Browser.window.cancelAnimationFrame != null) CAF = Browser.window.cancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").mozCancelAnimationFrame != null) CAF = untyped __js__(\"window\").mozCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").webkitCancelAnimationFrame != null) CAF = untyped __js__(\"window\").webkitCancelAnimationFrame;\n\t\telse if (untyped __js__(\"window\").msCancelAnimationFrame != null) CAF = untyped __js__(\"window\").msCancelAnimationFrame;\n\n\t\tif (RAF != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tinline function _init() {\n\t\tcurrentFps = 60;\n\t\tcurrentMs = 0;\n\t\tcurrentMem = \"0\";\n\n\t\tlowFps = 60;\n\t\tavgFps = 60;\n\n\t\t_measureCount = 0;\n\t\t_totalFps = 0;\n\t\t_time = 0;\n\t\t_ticks = 0;\n\t\t_fpsMin = 60;\n\t\t_fpsMax = 60;\n\t\t_startTime = _now();\n\t\t_prevTime = -MEASUREMENT_INTERVAL;\n\t}\n\n\tinline function _now():Float {\n\t\treturn (_perfObj != null && _perfObj.now != null) ? _perfObj.now() : Date.now().getTime();\n\t}\n\n\tfunction _tick(val:Float) {\n\t\tvar time = _now();\n\t\t_ticks++;\n\n\t\tif (_raf != null && time > _prevTime + MEASUREMENT_INTERVAL) {\n\t\t\tcurrentMs = Math.round(time - _startTime);\n\t\t\tms.innerHTML = \"MS: \" + currentMs;\n\n\t\t\tcurrentFps = Math.round((_ticks * 1000) / (time - _prevTime));\n\t\t\tif (currentFps > 0 && val > DELAY_TIME) {\n\t\t\t\t_measureCount++;\n\t\t\t\t_totalFps += currentFps;\n\t\t\t\tlowFps = _fpsMin = Math.min(_fpsMin, currentFps);\n\t\t\t\t_fpsMax = Math.max(_fpsMax, currentFps);\n\t\t\t\tavgFps = Math.round(_totalFps / _measureCount);\n\t\t\t}\n\n\t\t\tfps.innerHTML = \"FPS: \" + currentFps + \" (\" + _fpsMin + \"-\" + _fpsMax + \")\";\n\n\t\t\tif (currentFps >= 30) fps.style.backgroundColor = FPS_BG_CLR;\n\t\t\telse if (currentFps >= 15) fps.style.backgroundColor = FPS_WARN_BG_CLR;\n\t\t\telse fps.style.backgroundColor = FPS_PROB_BG_CLR;\n\n\t\t\t_prevTime = time;\n\t\t\t_ticks = 0;\n\n\t\t\tif (_memCheck) {\n\t\t\t\tcurrentMem = _getFormattedSize(_memoryObj.usedJSHeapSize, 2);\n\t\t\t\tmemory.innerHTML = \"MEM: \" + currentMem;\n\t\t\t}\n\t\t}\n\t\t_startTime = time;\n\n\t\tif (_raf != null) _raf = Reflect.callMethod(Browser.window, RAF, [_tick]);\n\t}\n\n\tfunction _createDiv(id:String, ?top:Float = 0):DivElement {\n\t\tvar div:DivElement = Browser.document.createDivElement();\n\t\tdiv.id = id;\n\t\tdiv.className = id;\n\t\tdiv.style.position = \"absolute\";\n\n\t\tswitch (_pos) {\n\t\t\tcase \"TL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"TR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.top = top + \"px\";\n\t\t\tcase \"BL\":\n\t\t\t\tdiv.style.left = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t\tcase \"BR\":\n\t\t\t\tdiv.style.right = _offset + \"px\";\n\t\t\t\tdiv.style.bottom = ((_memCheck) ? 48 : 32) - top + \"px\";\n\t\t}\n\n\t\tdiv.style.width = \"80px\";\n\t\tdiv.style.height = \"12px\";\n\t\tdiv.style.lineHeight = \"12px\";\n\t\tdiv.style.padding = \"2px\";\n\t\tdiv.style.fontFamily = FONT_FAMILY;\n\t\tdiv.style.fontSize = \"9px\";\n\t\tdiv.style.fontWeight = \"bold\";\n\t\tdiv.style.textAlign = \"center\";\n\t\tBrowser.document.body.appendChild(div);\n\t\treturn div;\n\t}\n\n\tfunction _createFpsDom() {\n\t\tfps = _createDiv(\"fps\");\n\t\tfps.style.backgroundColor = FPS_BG_CLR;\n\t\tfps.style.zIndex = \"995\";\n\t\tfps.style.color = FPS_TXT_CLR;\n\t\tfps.innerHTML = \"FPS: 0\";\n\t}\n\n\tfunction _createMsDom() {\n\t\tms = _createDiv(\"ms\", 16);\n\t\tms.style.backgroundColor = MS_BG_CLR;\n\t\tms.style.zIndex = \"996\";\n\t\tms.style.color = MS_TXT_CLR;\n\t\tms.innerHTML = \"MS: 0\";\n\t}\n\n\tfunction _createMemoryDom() {\n\t\tmemory = _createDiv(\"memory\", 32);\n\t\tmemory.style.backgroundColor = MEM_BG_CLR;\n\t\tmemory.style.color = MEM_TXT_CLR;\n\t\tmemory.style.zIndex = \"997\";\n\t\tmemory.innerHTML = \"MEM: 0\";\n\t}\n\n\tfunction _getFormattedSize(bytes:Float, ?frac:Int = 0):String {\n\t\tvar sizes = [\"Bytes\", \"KB\", \"MB\", \"GB\", \"TB\"];\n\t\tif (bytes == 0) return \"0\";\n\t\tvar precision = Math.pow(10, frac);\n\t\tvar i = Math.floor(Math.log(bytes) / Math.log(1024));\n\t\treturn Math.round(bytes * precision / Math.pow(1024, i)) / precision + \" \" + sizes[i];\n\t}\n\n\tpublic function addInfo(val:String) {\n\t\tinfo = _createDiv(\"info\", (_memCheck) ? 48 : 32);\n\t\tinfo.style.backgroundColor = INFO_BG_CLR;\n\t\tinfo.style.color = INFO_TXT_CLR;\n\t\tinfo.style.zIndex = \"998\";\n\t\tinfo.innerHTML = val;\n\t}\n\n\tpublic function clearInfo() {\n\t\tif (info != null) {\n\t\t\tBrowser.document.body.removeChild(info);\n\t\t\tinfo = null;\n\t\t}\n\t}\n\n\tpublic function destroy() {\n\t\t_cancelRAF();\n\t\t_perfObj = null;\n\t\t_memoryObj = null;\n\t\tif (fps != null) {\n\t\t\tBrowser.document.body.removeChild(fps);\n\t\t\tfps = null;\n\t\t}\n\t\tif (ms != null) {\n\t\t\tBrowser.document.body.removeChild(ms);\n\t\t\tms = null;\n\t\t}\n\t\tif (memory != null) {\n\t\t\tBrowser.document.body.removeChild(memory);\n\t\t\tmemory = null;\n\t\t}\n\t\tclearInfo();\n\t\t_init();\n\t}\n\n\tinline function _cancelRAF() {\n\t\tReflect.callMethod(Browser.window, CAF, [_raf]);\n\t\t_raf = null;\n\t}\n}\n\ntypedef Memory = {\n\tvar usedJSHeapSize:Float;\n\tvar totalJSHeapSize:Float;\n\tvar jsHeapSizeLimit:Float;\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic {\n\t\ttry return untyped o[field] catch( e : Dynamic ) return null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : haxe.Constraints.Function, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package pixi.plugins.app;\n\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.Element;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio:Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(default, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width:Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height:Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent:Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias:Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster).\n\t * default - false\n\t */\n\tpublic var forceFXAA:Bool;\n\n\t/**\n\t * Force round pixels.\n\t * default - false\n\t */\n\tpublic var roundPixels:Bool;\n\n\t/**\n\t * This sets if the CanvasRenderer will clear the canvas or not before the new render pass.\n * If the scene is NOT transparent Pixi will use a canvas sized fillRect operation every frame to set the canvas background color.\n * If the scene is transparent Pixi will use clearRect to clear the canvas every frame.\n * Disable this by setting this to false. For example if your game has a canvas filling background image you often don't need this set.\n\t * default - true\n\t */\n\tpublic var clearBeforeRender:Bool;\n\n\t/**\n\t * enables drawing buffer preservation, enable this if you need to call toDataUrl on the webgl context\n\t * default - false\n\t */\n\tpublic var preserveDrawingBuffer:Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize:Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor:Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Canvas Element\n\t * Read-only\n\t */\n\tpublic var canvas(default, null):CanvasElement;\n\n\t/**\n\t * Renderer\n\t * Read-only\n\t */\n\tpublic var renderer(default, null):Dynamic;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tpublic var stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _frameCount:Int;\n\tvar _animationFrameId:Null;\n\n\tpublic function new() {\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tinline function _setDefaultValues() {\n\t\t_animationFrameId = null;\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\troundPixels = false;\n\t\tclearBeforeRender = true;\n\t\tpreserveDrawingBuffer = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [rendererType] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\n\tpublic function start(?rendererType:String = \"auto\", ?parentDom:Element) {\n\t\tcanvas = Browser.document.createCanvasElement();\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\t\tcanvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(canvas);\n\t\telse parentDom.appendChild(canvas);\n\n\t\tstage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\t\trenderingOptions.clearBeforeRender = clearBeforeRender;\n\t\trenderingOptions.preserveDrawingBuffer = preserveDrawingBuffer;\n\n\t\tif (rendererType == AUTO) renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (rendererType == CANVAS) renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tif (roundPixels) renderer.roundPixels = true;\n\t\t\n\t\tif (parentDom == null) Browser.document.body.appendChild(renderer.view);\n\t\telse parentDom.appendChild(renderer.view);\n\t\tresumeRendering();\n\t\t#if stats addStats(); #end\n\t}\n\n\tpublic function pauseRendering() {\n\t\tBrowser.window.onresize = null;\n\t\tif (_animationFrameId != null) {\n\t\t\tBrowser.window.cancelAnimationFrame(_animationFrameId);\n\t\t\t_animationFrameId = null;\n\t\t}\n\t}\n\n\tpublic function resumeRendering() {\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tif (_animationFrameId == null) _animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\trenderer.resize(width, height);\n\t\tcanvas.style.width = width + \"px\";\n\t\tcanvas.style.height = height + \"px\";\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame(elapsedTime:Float) {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\tif (onUpdate != null) onUpdate(elapsedTime);\n\t\t\trenderer.render(stage);\n\t\t}\n\t\t_animationFrameId = Browser.window.requestAnimationFrame(_onRequestAnimationFrame);\n\t}\n\n\tpublic function addStats() {\n\t\tif (untyped __js__(\"window\").Perf != null) {\n\t\t\tnew Perf().addInfo([\"UNKNOWN\", \"WEBGL\", \"CANVAS\"][renderer.type] + \" - \" + pixelRatio);\n\t\t}\n\t}\n}","package samples.video;\n\nimport js.html.VideoElement;\nimport js.Browser;\nimport pixi.core.sprites.Sprite;\nimport pixi.core.display.Container;\nimport pixi.core.textures.Texture;\nimport pixi.plugins.app.Application;\n\nclass Main extends Application {\n\n\tvar _vidTexture:Texture;\n\tvar _vidSprite:Sprite;\n\tvar _vidElement:VideoElement;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xE0E6F8;\n\t\tonUpdate = _onUpdate;\n\t\tonResize = _onResize;\n\t\tautoResize = true;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tsuper.start();\n\n\t\t_vidTexture = Texture.fromVideoUrl(\"assets/video/test.mp4\");\n\t\t_vidSprite = new Sprite(_vidTexture);\n\t\tstage.addChild(_vidSprite);\n\n\t\t//haxe.Timer.delay(_setup, 3000);\n\t}\n\n\tfunction _setup() {\n\n\t}\n\n\tfunction _onUpdate(elapsedTime:Float) {\n\n\t}\n\n\tfunction _onResize() {\n\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;mBA2DO;;;CACN,EAAW;CACX,CAAI,DAAc,AAAU,GAAa,HAAM,EAAa,FAAc,AAAU;CACpF,EAAY,AAAC,CAAY,AAAQ,AAAc,AAAQ,DAA6B;CAEpF,EAAO;CACP,EAAU;CAEV;;;;;;;;;;;;;CACA;CACA;CACA,CAAI,DAAW;CAEf,CAAI,EAAwC,HAAM,EAAM,GACnD,JAAY,EAA6C,HAAM,EAAc,GAC7E,JAAY,EAAgD,HAAM,EAAc,GAChF,JAAY,EAA4C,HAAM,EAAc;CAEjF,CAAI,EAAuC,HAAM,EAAM,GAClD,JAAY,EAA4C,HAAM,EAAc,GAC5E,JAAY,EAA+C,HAAM,EAAc,GAC/E,JAAY,EAA2C,HAAM,EAAc;CAEhF,CAAI,EAAO,HAAM,EAAO,FAAmB,AAAgB,AAAK,AAAC;;;OAyBlE,OAA0B;EACd;;EACX;EAEA,AAAI,EAAQ,AAAQ,DAAO,AAAY,FAAsB;GAC5D,AAAY,FAAW,EAAO;GAC9B,AAAe,AAAS;GAExB,AAAa,FAAW,AAAC,EAAS,AAAQ,FAAC,EAAO;GAClD,DAAI,CAAa,CAAK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AK,AAAb,FAAmB;GACrC,AAAc;GACd,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAgB;;EAEjB,CAAoB,FAAqC;;UAGnD,CACN;EAAY,EAAyB,HACpC,AAAmB,AAAC,AAAW,AAAS,AAAU,EAAiB,AAAQ;;;qBC1OtE,VAAe;CACrB;CACA;;0BA+BM,fACN;;;;;OA7BD,IAAiB;EAChB,CAAkB;EAClB,CAAW;EACX,CAAW;EACX,CAAa;EACb,CAAQ;EACR,CAAS;EACT;EAEA,CAAc,FAAqB;EACnC,CAAa,SAAW;EACxB,DAAe;;WAShB,WAAsC;;WAItC,AAAqB;;;;;4BHtCwB;mBAEN;kBAED;uBACK;uBACA;iBAEN;kBACC;mBACC;mBACA;kBACD;mBACC;oBACC;kBAOZ;;;;" } \ No newline at end of file diff --git a/src/pixi/core/particles/ParticleContainer.hx b/src/pixi/core/particles/ParticleContainer.hx index 5e6439c2..927a20a6 100644 --- a/src/pixi/core/particles/ParticleContainer.hx +++ b/src/pixi/core/particles/ParticleContainer.hx @@ -2,7 +2,7 @@ package pixi.core.particles; import pixi.core.display.Container; -@:native("PIXI.ParticleContainer") +@:native("PIXI.particles.ParticleContainer") extern class ParticleContainer extends Container { /** From bf0f6d69ba9cad388cd263d47b5787d9daa24030 Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:11:43 +0100 Subject: [PATCH 5/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ded26cdf..054cfdbe 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![Haxelib version](https://badge.fury.io/gh/pixijs%2Fpixi-haxe.svg)](http://lib.haxe.org/p/pixijs) [![npm version](https://badge.fury.io/js/hxpixijs.svg)](http://badge.fury.io/js/hxpixijs) [![Build Status](https://travis-ci.org/pixijs/pixi-haxe.svg?branch=master)](https://travis-ci.org/pixijs/pixi-haxe) [![Stories in Ready](https://badge.waffle.io/pixijs/pixi-haxe.png?label=ready&title=Ready)](https://waffle.io/pixijs/pixi-haxe) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) ========= -![haxe pixi logo](https://raw.githubusercontent.com/pixijs/pixi-haxe/master/logo.png) +![haxe pixi logo](logo.png) Externs of Pixi.js v3.x for Haxe - A fast and lightweight 2D javascript rendering library that works across all devices. From a606c9e40bab9699689a167fef6028a41bf4da5f Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:12:50 +0100 Subject: [PATCH 6/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 054cfdbe..d283a4b9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![Haxelib version](https://badge.fury.io/gh/pixijs%2Fpixi-haxe.svg)](http://lib.haxe.org/p/pixijs) [![npm version](https://badge.fury.io/js/hxpixijs.svg)](http://badge.fury.io/js/hxpixijs) [![Build Status](https://travis-ci.org/pixijs/pixi-haxe.svg?branch=master)](https://travis-ci.org/pixijs/pixi-haxe) [![Stories in Ready](https://badge.waffle.io/pixijs/pixi-haxe.png?label=ready&title=Ready)](https://waffle.io/pixijs/pixi-haxe) [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) +[![Haxelib Version](https://badge.fury.io/gh/pixijs%2Fpixi-haxe.svg)](http://lib.haxe.org/p/pixijs) [![npm version](https://badge.fury.io/js/hxpixijs.svg)](http://badge.fury.io/js/hxpixijs) [![Build Status](https://travis-ci.org/pixijs/pixi-haxe.svg?branch=dev)](https://travis-ci.org/pixijs/pixi-haxe)[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) ========= ![haxe pixi logo](logo.png) -Externs of Pixi.js v3.x for Haxe - A fast and lightweight 2D javascript rendering library that works across all devices. +Externs of Pixi.js v4.x for Haxe - A fast and lightweight 2D javascript rendering library that works across all devices. ### Installation ### From 78e1bd7a9894f7b1db5778714a6cfa7ff274bb79 Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:16:43 +0100 Subject: [PATCH 7/9] Update README.md --- README.md | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index d283a4b9..5b186219 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Externs of Pixi.js v4.x for Haxe - A fast and lightweight 2D javascript rendering library that works across all devices. -### Installation ### +### Installation ``` haxelib install pixijs @@ -14,21 +14,16 @@ or via npm npm install hxpixijs ``` -### API Documentation ### - -[Documentation](http://adireddy.github.io/docs/pixi-haxe/) - -### Issues ### +### Issues Found any bug? Please create a new [issue](https://github.com/pixijs/pixi-haxe/issues/new). -### Demos ### +### Demos * [Basics](http://adireddy.github.io/demos/pixi-haxe/basics.html) * [Graphics](http://adireddy.github.io/demos/pixi-haxe/graphics.html) * [Movieclip](http://adireddy.github.io/demos/pixi-haxe/movieclip.html) * [Spritesheet](http://adireddy.github.io/demos/pixi-haxe/spritesheet.html) -* [Texture Swap](http://adireddy.github.io/demos/pixi-haxe/textureswap.html) * [Rope](http://adireddy.github.io/demos/pixi-haxe/rope.html) * [Dragging](http://adireddy.github.io/demos/pixi-haxe/dragging.html) * [Tiling](http://adireddy.github.io/demos/pixi-haxe/tiling.html) @@ -40,12 +35,6 @@ Found any bug? Please create a new [issue](https://github.com/pixijs/pixi-haxe/i * [Loader](http://adireddy.github.io/demos/pixi-haxe/loader.html) * [Video](http://adireddy.github.io/demos/pixi-haxe/video.html) * [Nape](http://adireddy.github.io/demos/pixi-haxe/nape.html) -* [Device Info](http://adireddy.github.io/demos/pixi-haxe/deviceinfo.html) -* [Device Detection](http://adireddy.github.io/demos/pixi-haxe/devicedetection.html) - -**Plugins** - -* [Spine](http://adireddy.github.io/demos/pixi-haxe/spine.html) **Filters (WebGL only)** @@ -56,7 +45,7 @@ Found any bug? Please create a new [issue](https://github.com/pixijs/pixi-haxe/i Look at the `samples` folder for the source code of above examples. -### Usage ### +### Usage ```haxe @@ -106,7 +95,7 @@ class Main { } ``` -### Licensing Information ### +### Licensing Information MIT license @@ -115,6 +104,6 @@ This content is released under the [MIT](http://opensource.org/licenses/MIT) Lic [Pixi.js](https://github.com/GoodBoyDigital/pixi.js) is licensed under the [MIT](http://opensource.org/licenses/MIT) License. -### Contributor Code of Conduct ### +### Contributor Code of Conduct [Code of Conduct](https://github.com/CoralineAda/contributor_covenant) is adapted from [Contributor Covenant, version 1.4](http://contributor-covenant.org/version/1/4) From bcbb07483ba63f76c62325856ad0b1d6e8035375 Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:20:56 +0100 Subject: [PATCH 8/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b186219..6c5b7622 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Found any bug? Please create a new [issue](https://github.com/pixijs/pixi-haxe/i * [ColorMatrix](http://adireddy.github.io/demos/pixi-haxe/colormatrix.html) * [Blur](http://adireddy.github.io/demos/pixi-haxe/blur.html) -**[COHERE](http://adireddy.github.io/cohere/)** - Sample MVC application using haxe and pixi.js +**[COHERE](http://adireddy.github.io/cohere/)** - Sample MVC application using Haxe and Pixi.js Look at the `samples` folder for the source code of above examples. From 150ce1913d219c477ec2c0be46c763d5f21821a6 Mon Sep 17 00:00:00 2001 From: Adi Date: Mon, 4 Apr 2016 10:25:56 +0100 Subject: [PATCH 9/9] haxelib release --- haxelib.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/haxelib.json b/haxelib.json index c584d330..c998e0b0 100644 --- a/haxelib.json +++ b/haxelib.json @@ -16,7 +16,7 @@ "adireddy" ], "releasenote": "v4 update", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.1", "url": "https://github.com/pixijs/pixi-haxe", "dependencies": { "perf.js": "" diff --git a/package.json b/package.json index 8d3205c2..498b2c74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pixijs", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.1", "description": "Externs of pixi.js v4.x for Haxe - a fast and lightweight 2D rendering library that works across all devices", "author": "Adi Reddy Mora", "homepage": "http://adireddy.github.io",